modal 0.73.141__py3-none-any.whl → 0.73.143__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
modal/client.pyi CHANGED
@@ -31,7 +31,7 @@ class _Client:
31
31
  server_url: str,
32
32
  client_type: int,
33
33
  credentials: typing.Optional[tuple[str, str]],
34
- version: str = "0.73.141",
34
+ version: str = "0.73.143",
35
35
  ): ...
36
36
  def is_closed(self) -> bool: ...
37
37
  @property
@@ -93,7 +93,7 @@ class Client:
93
93
  server_url: str,
94
94
  client_type: int,
95
95
  credentials: typing.Optional[tuple[str, str]],
96
- version: str = "0.73.141",
96
+ version: str = "0.73.143",
97
97
  ): ...
98
98
  def is_closed(self) -> bool: ...
99
99
  @property
modal/functions.pyi CHANGED
@@ -199,11 +199,11 @@ class Function(
199
199
 
200
200
  _call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
201
201
 
202
- class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
202
+ class __remote_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
203
203
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
204
204
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
205
205
 
206
- remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
206
+ remote: __remote_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
207
207
 
208
208
  class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
209
209
  def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
@@ -218,19 +218,19 @@ class Function(
218
218
  self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
219
219
  ) -> modal._functions.OriginalReturnType: ...
220
220
 
221
- class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
221
+ class ___experimental_spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
222
222
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
223
223
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
224
224
 
225
225
  _experimental_spawn: ___experimental_spawn_spec[
226
- modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
226
+ modal._functions.ReturnType, modal._functions.P, typing_extensions.Self
227
227
  ]
228
228
 
229
- class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
229
+ class __spawn_spec(typing_extensions.Protocol[ReturnType_INNER, P_INNER, SUPERSELF]):
230
230
  def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
231
231
  async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
232
232
 
233
- spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
233
+ spawn: __spawn_spec[modal._functions.ReturnType, modal._functions.P, typing_extensions.Self]
234
234
 
235
235
  def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
236
236
 
modal/parallel_map.py CHANGED
@@ -70,10 +70,7 @@ class _OutputValue:
70
70
  value: Any
71
71
 
72
72
 
73
- # maximum number of inputs that can be in progress (either queued to be sent,
74
- # or waiting for completion). if this limit is reached, we will block sending
75
- # more inputs to the server until some of the existing inputs are completed.
76
- MAP_MAX_INPUTS_OUTSTANDING = 1000
73
+ MAX_INPUTS_OUTSTANDING_DEFAULT = 1000
77
74
 
78
75
  # maximum number of inputs to send to the server in a single request
79
76
  MAP_INVOCATION_CHUNK_SIZE = 49
@@ -105,6 +102,9 @@ async def _map_invocation(
105
102
  function_call_jwt = response.function_call_jwt
106
103
  retry_policy = response.retry_policy
107
104
  sync_client_retries_enabled = response.sync_client_retries_enabled
105
+ # The server should always send a value back for max_inputs_outstanding.
106
+ # Falling back to a default just in case something very unexpected happens.
107
+ max_inputs_outstanding = response.max_inputs_outstanding or MAX_INPUTS_OUTSTANDING_DEFAULT
108
108
 
109
109
  have_all_inputs = False
110
110
  inputs_created = 0
@@ -127,7 +127,7 @@ async def _map_invocation(
127
127
  completed_outputs: set[str] = set() # Set of input_ids whose outputs are complete (expecting no more values)
128
128
  input_queue: asyncio.Queue[api_pb2.FunctionPutInputsItem | None] = asyncio.Queue()
129
129
  map_items_manager = _MapItemsManager(
130
- retry_policy, function_call_invocation_type, retry_queue, sync_client_retries_enabled
130
+ retry_policy, function_call_invocation_type, retry_queue, sync_client_retries_enabled, max_inputs_outstanding
131
131
  )
132
132
 
133
133
  async def create_input(argskwargs):
@@ -700,13 +700,17 @@ class _MapItemsManager:
700
700
  retry_policy: api_pb2.FunctionRetryPolicy,
701
701
  function_call_invocation_type: "api_pb2.FunctionCallInvocationType.ValueType",
702
702
  retry_queue: TimestampPriorityQueue,
703
- sync_client_retries_enabled: bool
703
+ sync_client_retries_enabled: bool,
704
+ max_inputs_outstanding: int
705
+
704
706
  ):
705
707
  self._retry_policy = retry_policy
706
708
  self.function_call_invocation_type = function_call_invocation_type
707
709
  self._retry_queue = retry_queue
708
- # semaphore to limit the number of inputs that can be in progress at once
709
- self._inputs_outstanding = asyncio.BoundedSemaphore(MAP_MAX_INPUTS_OUTSTANDING)
710
+ # semaphore to control the maximum number of inputs that can be in progress (either queued to be sent,
711
+ # or waiting for completion). if this limit is reached, we will block sending more inputs to the server
712
+ # until some of the existing inputs are completed.
713
+ self._inputs_outstanding = asyncio.BoundedSemaphore(max_inputs_outstanding)
710
714
  self._item_context: dict[int, _MapItemContext] = {}
711
715
  self._sync_client_retries_enabled = sync_client_retries_enabled
712
716
 
modal/parallel_map.pyi CHANGED
@@ -138,6 +138,7 @@ class _MapItemsManager:
138
138
  function_call_invocation_type: int,
139
139
  retry_queue: modal._utils.async_utils.TimestampPriorityQueue,
140
140
  sync_client_retries_enabled: bool,
141
+ max_inputs_outstanding: int,
141
142
  ): ...
142
143
  async def add_items(self, items: list[modal_proto.api_pb2.FunctionPutInputsItem]): ...
143
144
  async def prepare_items_for_retry(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: modal
3
- Version: 0.73.141
3
+ Version: 0.73.143
4
4
  Summary: Python client library for Modal
5
5
  Author-email: Modal Labs <support@modal.com>
6
6
  License: Apache-2.0
@@ -23,7 +23,7 @@ modal/app.py,sha256=NKH7Cw1M6eyyrMXFbhWfdo3uRd28-8kv0Pcw56kPiPU,47312
23
23
  modal/app.pyi,sha256=pUEqciyGZ446sc_QoG8XcQ_oc6oU-U4dqjkxjhgOX98,26968
24
24
  modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
25
25
  modal/client.py,sha256=j9D3hNis1lfhnz9lVFGgJgowbH3PaGUzNKgHPWYG778,15372
26
- modal/client.pyi,sha256=wUA26R-m9YbCJpEDqB_HnyIaUVPCszc-tEhAG4IQoec,7661
26
+ modal/client.pyi,sha256=CfDyx-Nfu0CC1bs8CypPA7qvaTvjCabL-FpRgUm6cog,7661
27
27
  modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
28
28
  modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
29
29
  modal/cls.py,sha256=PJimWA9q_sbQJNLbYy7fzjZGBm_hdfXuuZ7O_pKLXdk,31586
@@ -40,7 +40,7 @@ modal/file_io.py,sha256=lcMs_E9Xfm0YX1t9U2wNIBPnqHRxmImqjLW1GHqVmyg,20945
40
40
  modal/file_io.pyi,sha256=NTRft1tbPSWf9TlWVeZmTlgB5AZ_Zhu2srWIrWr7brk,9445
41
41
  modal/file_pattern_matcher.py,sha256=trosX-Bp7dOubudN1bLLhRAoidWy1TcoaR4Pv8CedWw,6497
42
42
  modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
43
- modal/functions.pyi,sha256=PqApQjvICj11NIMEVCmaUIUyJUfEIuY_KkEzCZ4t6iI,14438
43
+ modal/functions.pyi,sha256=0Au1n37DimTZVvxCIR7HWALuNGxfJ_fcNR-or37eo5k,14438
44
44
  modal/gpu.py,sha256=Kbhs_u49FaC2Zi0TjCdrpstpRtT5eZgecynmQi5IZVE,6752
45
45
  modal/image.py,sha256=JVnSSAm7wmull3H_plU-bdPkc4Dx_2EPG_229YJd81U,92174
46
46
  modal/image.pyi,sha256=DQ4DLOCPr6_yV7z4LS0bTY0rOyvQP9-dQOrzaW7pPG8,25260
@@ -53,8 +53,8 @@ modal/network_file_system.pyi,sha256=4N3eqMbTSlqmS8VV_aJK-uvrgJC8xnf_YtW5FHfRfc8
53
53
  modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
54
54
  modal/object.pyi,sha256=kyJkRQcVv3ct7zSAxvvXcuhBVeH914v80uSlqeS7cA4,5632
55
55
  modal/output.py,sha256=q4T9uHduunj4NwY-YSwkHGgjZlCXMuJbfQ5UFaAGRAc,1968
56
- modal/parallel_map.py,sha256=AB4YH4ZBGmCOe-X_1kB3hm-kNoRnOxCMzpkTUim4tT8,33586
57
- modal/parallel_map.pyi,sha256=-D_z-K1GOpQcMSUMVHRVLr2rgEA5CXlX6dU5P6msa58,5671
56
+ modal/parallel_map.py,sha256=2d30AM43g8SazkhGbbP1t2sACa4NRqeZrw3JEAqqZDg,33867
57
+ modal/parallel_map.pyi,sha256=mEenHruPiZDq3ucV_6RM8ctc0c_Qpqra5MBagXeHiiQ,5708
58
58
  modal/partial_function.py,sha256=y0h-EvlPnfvZr7nlJLOFk7NB-K-ZO41XJnsGtQTesAI,1200
59
59
  modal/partial_function.pyi,sha256=-xWrvFMhLT6ulx9B82u1g8kL69vt3nYAvp8pV0d__uw,5407
60
60
  modal/proxy.py,sha256=NrOevrWxG3G7-zlyRzG6BcIvop7AWLeyahZxitbBaOk,1418
@@ -153,10 +153,10 @@ modal_docs/mdmd/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,2
153
153
  modal_docs/mdmd/mdmd.py,sha256=Irx49MCCTlBOP4FBdLR--JrpA3-WhsVeriq0LGgsRic,6232
154
154
  modal_docs/mdmd/signatures.py,sha256=XJaZrK7Mdepk5fdX51A8uENiLFNil85Ud0d4MH8H5f0,3218
155
155
  modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
156
- modal_proto/api.proto,sha256=y3LTZW1byZ9JnqAZCdJsUDabIJWX3ZAhk_DHLdqy2ZQ,88302
156
+ modal_proto/api.proto,sha256=xAyUzn2fMh2rD4Dgbo9CkHSkLB8XyB6uhulYCVe7LWE,88339
157
157
  modal_proto/api_grpc.py,sha256=SJOfs3Y1cOzzF_ZcDj-UNnOWz59sfU8a4JISp4Y_1Kw,109923
158
- modal_proto/api_pb2.py,sha256=ReGCQmtxu2oZypORBqReLIBMNYyJD5RKph3EXnWhHAk,316476
159
- modal_proto/api_pb2.pyi,sha256=zkaVdAsymuiFhRvuQoPvDsJHICNzVlgodZopDiIOESU,428429
158
+ modal_proto/api_pb2.py,sha256=R15Aqz5ITP6txs2lYIbcnQecMW2u_MVZqPz0lNvB8V4,316528
159
+ modal_proto/api_pb2.pyi,sha256=KSjBR3gIFd8g9J3x4faPTGkrmdwvpimYp-lLRe2JZzE,428629
160
160
  modal_proto/api_pb2_grpc.py,sha256=0XeCIL2B6UGLBh1MEGPFPz1k8qLWNyp-yj_cJrK3NE8,237541
161
161
  modal_proto/api_pb2_grpc.pyi,sha256=BsnRBinG0KC9Cp70UkdxuzgZA9KLCTl7T5ze0RK-Mmk,55323
162
162
  modal_proto/modal_api_grpc.py,sha256=i9HTreJ5FpBvtz9NwuTC52fZTWZO_M_DWdIYT2lOjs8,14666
@@ -170,10 +170,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
170
170
  modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
171
171
  modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
172
172
  modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
173
- modal_version/_version_generated.py,sha256=dXZA5TgCLJO64ZdN-xONJ9Q5XItbDZRjxGP-U3ZPdjQ,150
174
- modal-0.73.141.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
- modal-0.73.141.dist-info/METADATA,sha256=GOvxr2yutKOj0UF4WqS8VIyYthKuOekhbTkdYJKIyNQ,2453
176
- modal-0.73.141.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
- modal-0.73.141.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
- modal-0.73.141.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
- modal-0.73.141.dist-info/RECORD,,
173
+ modal_version/_version_generated.py,sha256=Swo3V9IveICUpIFVpIVccS8muTG9yF2vONXjcIswZwg,150
174
+ modal-0.73.143.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
175
+ modal-0.73.143.dist-info/METADATA,sha256=RIQlD3ToI9VKKHLrS0I7OnNSeHbBVL6WfzoINs9kuZA,2453
176
+ modal-0.73.143.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
177
+ modal-0.73.143.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
178
+ modal-0.73.143.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
179
+ modal-0.73.143.dist-info/RECORD,,
modal_proto/api.proto CHANGED
@@ -1619,6 +1619,7 @@ message FunctionMapResponse {
1619
1619
  FunctionRetryPolicy retry_policy = 3;
1620
1620
  string function_call_jwt = 4;
1621
1621
  bool sync_client_retries_enabled = 5;
1622
+ uint32 max_inputs_outstanding = 6;
1622
1623
  }
1623
1624
 
1624
1625
  message FunctionOptions {