modal 0.73.21__py3-none-any.whl → 0.73.23__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 +2 -2
- modal/functions.pyi +6 -6
- modal/gpu.py +26 -36
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/METADATA +1 -1
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/RECORD +13 -13
- modal_proto/api.proto +4 -0
- modal_proto/api_pb2.py +270 -270
- modal_proto/api_pb2.pyi +10 -2
- modal_version/_version_generated.py +1 -1
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/LICENSE +0 -0
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/WHEEL +0 -0
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/entry_points.txt +0 -0
- {modal-0.73.21.dist-info → modal-0.73.23.dist-info}/top_level.txt +0 -0
modal/client.pyi
CHANGED
@@ -27,7 +27,7 @@ class _Client:
|
|
27
27
|
_snapshotted: bool
|
28
28
|
|
29
29
|
def __init__(
|
30
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
30
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.23"
|
31
31
|
): ...
|
32
32
|
def is_closed(self) -> bool: ...
|
33
33
|
@property
|
@@ -85,7 +85,7 @@ class Client:
|
|
85
85
|
_snapshotted: bool
|
86
86
|
|
87
87
|
def __init__(
|
88
|
-
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.
|
88
|
+
self, server_url: str, client_type: int, credentials: typing.Optional[tuple[str, str]], version: str = "0.73.23"
|
89
89
|
): ...
|
90
90
|
def is_closed(self) -> bool: ...
|
91
91
|
@property
|
modal/functions.pyi
CHANGED
@@ -200,11 +200,11 @@ class Function(
|
|
200
200
|
|
201
201
|
_call_generator_nowait: ___call_generator_nowait_spec[typing_extensions.Self]
|
202
202
|
|
203
|
-
class __remote_spec(typing_extensions.Protocol[
|
203
|
+
class __remote_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
204
204
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
205
205
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> ReturnType_INNER: ...
|
206
206
|
|
207
|
-
remote: __remote_spec[modal._functions.
|
207
|
+
remote: __remote_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
208
208
|
|
209
209
|
class __remote_gen_spec(typing_extensions.Protocol[SUPERSELF]):
|
210
210
|
def __call__(self, *args, **kwargs) -> typing.Generator[typing.Any, None, None]: ...
|
@@ -219,19 +219,19 @@ class Function(
|
|
219
219
|
self, *args: modal._functions.P.args, **kwargs: modal._functions.P.kwargs
|
220
220
|
) -> modal._functions.OriginalReturnType: ...
|
221
221
|
|
222
|
-
class ___experimental_spawn_spec(typing_extensions.Protocol[
|
222
|
+
class ___experimental_spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
223
223
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
224
224
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
225
225
|
|
226
226
|
_experimental_spawn: ___experimental_spawn_spec[
|
227
|
-
modal._functions.
|
227
|
+
modal._functions.P, modal._functions.ReturnType, typing_extensions.Self
|
228
228
|
]
|
229
229
|
|
230
|
-
class __spawn_spec(typing_extensions.Protocol[
|
230
|
+
class __spawn_spec(typing_extensions.Protocol[P_INNER, ReturnType_INNER, SUPERSELF]):
|
231
231
|
def __call__(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
232
232
|
async def aio(self, *args: P_INNER.args, **kwargs: P_INNER.kwargs) -> FunctionCall[ReturnType_INNER]: ...
|
233
233
|
|
234
|
-
spawn: __spawn_spec[modal._functions.
|
234
|
+
spawn: __spawn_spec[modal._functions.P, modal._functions.ReturnType, typing_extensions.Self]
|
235
235
|
|
236
236
|
def get_raw_f(self) -> collections.abc.Callable[..., typing.Any]: ...
|
237
237
|
|
modal/gpu.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Copyright Modal Labs 2022
|
2
2
|
from dataclasses import dataclass
|
3
|
-
from typing import
|
3
|
+
from typing import Union
|
4
4
|
|
5
5
|
from modal_proto import api_pb2
|
6
6
|
|
@@ -154,17 +154,19 @@ class Any(_GPUConfig):
|
|
154
154
|
return f"GPU(Any, count={self.count})"
|
155
155
|
|
156
156
|
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
"
|
161
|
-
"
|
162
|
-
"
|
163
|
-
"
|
164
|
-
"
|
165
|
-
"
|
157
|
+
STRING_TO_GPU_TYPE: dict[str, str] = {
|
158
|
+
# TODO(erikbern): we will move this table to the server soon,
|
159
|
+
# and let clients just pass any gpu type string through
|
160
|
+
"t4": "T4",
|
161
|
+
"l4": "L4",
|
162
|
+
"a100": "A100-40GB",
|
163
|
+
"a100-80gb": "A100-80GB",
|
164
|
+
"h100": "H100",
|
165
|
+
"a10g": "A10G",
|
166
|
+
"l40s": "L40S",
|
167
|
+
"any": "ANY",
|
166
168
|
}
|
167
|
-
display_string_to_config = "\n".join(f'- "{key}"
|
169
|
+
display_string_to_config = "\n".join(f'- "{key}"' for key in STRING_TO_GPU_TYPE.keys())
|
168
170
|
__doc__ = f"""
|
169
171
|
**GPU configuration shortcodes**
|
170
172
|
|
@@ -183,9 +185,9 @@ Other configurations can be created using the constructors documented below.
|
|
183
185
|
GPU_T = Union[None, bool, str, _GPUConfig]
|
184
186
|
|
185
187
|
|
186
|
-
def
|
188
|
+
def parse_gpu_config(value: GPU_T) -> api_pb2.GPUConfig:
|
187
189
|
if isinstance(value, _GPUConfig):
|
188
|
-
return value
|
190
|
+
return value._to_proto()
|
189
191
|
elif isinstance(value, str):
|
190
192
|
count = 1
|
191
193
|
if ":" in value:
|
@@ -195,33 +197,21 @@ def _parse_gpu_config(value: GPU_T) -> Optional[_GPUConfig]:
|
|
195
197
|
except ValueError:
|
196
198
|
raise InvalidError(f"Invalid GPU count: {count_str}. Value must be an integer.")
|
197
199
|
|
198
|
-
if value.lower() == "a100-
|
199
|
-
|
200
|
-
elif value.lower()
|
201
|
-
return A100(size="40GB", count=count)
|
202
|
-
elif value.lower() == "a100-80gb":
|
203
|
-
return A100(size="80GB", count=count)
|
204
|
-
elif value.lower() not in STRING_TO_GPU_CONFIG:
|
200
|
+
if value.lower() == "a100-40gb":
|
201
|
+
gpu_type = "A100-40GB"
|
202
|
+
elif value.lower() not in STRING_TO_GPU_TYPE:
|
205
203
|
raise InvalidError(
|
206
204
|
f"Invalid GPU type: {value}. "
|
207
|
-
f"Value must be one of {list(
|
205
|
+
f"Value must be one of {list(STRING_TO_GPU_TYPE.keys())} (case-insensitive)."
|
208
206
|
)
|
209
207
|
else:
|
210
|
-
|
208
|
+
gpu_type = STRING_TO_GPU_TYPE[value.lower()]
|
209
|
+
|
210
|
+
return api_pb2.GPUConfig(
|
211
|
+
gpu_type=gpu_type,
|
212
|
+
count=count,
|
213
|
+
)
|
211
214
|
elif value is None or value is False:
|
212
|
-
return
|
215
|
+
return api_pb2.GPUConfig()
|
213
216
|
else:
|
214
217
|
raise InvalidError(f"Invalid GPU config: {value}. Value must be a string, a `GPUConfig` object, or `None`.")
|
215
|
-
|
216
|
-
|
217
|
-
def parse_gpu_config(value: GPU_T) -> api_pb2.GPUConfig:
|
218
|
-
"""mdmd:hidden"""
|
219
|
-
gpu_config = _parse_gpu_config(value)
|
220
|
-
if gpu_config is None:
|
221
|
-
return api_pb2.GPUConfig()
|
222
|
-
return gpu_config._to_proto()
|
223
|
-
|
224
|
-
|
225
|
-
def display_gpu_config(value: GPU_T) -> str:
|
226
|
-
"""mdmd:hidden"""
|
227
|
-
return repr(_parse_gpu_config(value))
|
@@ -21,7 +21,7 @@ modal/app.py,sha256=MaWCYgNx8y2GQhmaXQBMKKAAfCYfdxrdYs6zCBoJzwI,44628
|
|
21
21
|
modal/app.pyi,sha256=lxiuWzE_OLb3WHg-H7Pek9DGBuCUzZ55P594VhJL5LA,26113
|
22
22
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
23
23
|
modal/client.py,sha256=8SQawr7P1PNUCq1UmJMUQXG2jIo4Nmdcs311XqrNLRE,15276
|
24
|
-
modal/client.pyi,sha256=
|
24
|
+
modal/client.pyi,sha256=Wv-EwfMQAwwr0eUOb__bx12ijf-0DFUiOJiTRJhJlRg,7593
|
25
25
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
26
26
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
27
27
|
modal/cls.py,sha256=agxclIXZbzBbgcI5PPVD7IfOiHzv-B82xaaXtw9cpv8,31126
|
@@ -40,8 +40,8 @@ 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=1cZ4V2wSLiaXqAqStETSwp3bzDD6QZOt6pmmjk3Okz4,6505
|
42
42
|
modal/functions.py,sha256=kcNHvqeGBxPI7Cgd57NIBBghkfbeFJzXO44WW0jSmao,325
|
43
|
-
modal/functions.pyi,sha256=
|
44
|
-
modal/gpu.py,sha256=
|
43
|
+
modal/functions.pyi,sha256=avRIY0KOFky6tDRI5_SvnLXz7PUnG2H0hQA385cRtb0,14289
|
44
|
+
modal/gpu.py,sha256=_h5KNEoDGsR9bAORTlvrrBrCoPkoM5pb7K8p11dCT1k,6602
|
45
45
|
modal/image.py,sha256=ekE2693foy30Xi1LM3swKZPW6HuaACj-OBvfspVSyIE,91509
|
46
46
|
modal/image.pyi,sha256=kdJzy1eaxNPZeCpE0TMYYLhJ6UWmkfRDeb_vzngJUoQ,26462
|
47
47
|
modal/io_streams.py,sha256=QkQiizKRzd5bnbKQsap31LJgBYlAnj4-XkV_50xPYX0,15079
|
@@ -154,10 +154,10 @@ modal_global_objects/mounts/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0
|
|
154
154
|
modal_global_objects/mounts/modal_client_package.py,sha256=W0E_yShsRojPzWm6LtIQqNVolapdnrZkm2hVEQuZK_4,767
|
155
155
|
modal_global_objects/mounts/python_standalone.py,sha256=EsC-hdPtiAPOwgW9emHN6muNUkrJwR8dYxroVArxHxM,1841
|
156
156
|
modal_proto/__init__.py,sha256=MIEP8jhXUeGq_eCjYFcqN5b1bxBM4fdk0VESpjWR0fc,28
|
157
|
-
modal_proto/api.proto,sha256
|
157
|
+
modal_proto/api.proto,sha256=-1UTgFwz_qrPvCLNv5xrztGIQXxlTaW2n8deTppCLnw,86504
|
158
158
|
modal_proto/api_grpc.py,sha256=FYGqDegM_w_qxdtlxum8k31mDibKoMvmNxv_p9cKdKs,109056
|
159
|
-
modal_proto/api_pb2.py,sha256=
|
160
|
-
modal_proto/api_pb2.pyi,sha256=
|
159
|
+
modal_proto/api_pb2.py,sha256=BCq06_U3wJXMKSq4MTzZQHrs1HF7jBxICK8ib870IUQ,312269
|
160
|
+
modal_proto/api_pb2.pyi,sha256=hjRUFcmO2epIMz4h5XjB-ZctgtnmS7EwRROpU6BvjP4,420220
|
161
161
|
modal_proto/api_pb2_grpc.py,sha256=DNp0Et5i_Ey4dKx_1o1LRtYhyWYyT0NzTcAY4EcHn-c,235765
|
162
162
|
modal_proto/api_pb2_grpc.pyi,sha256=RI6tWC3L8EIN4-izFSEGPPJl5Ta0lXPNuHUJaWAr35s,54892
|
163
163
|
modal_proto/modal_api_grpc.py,sha256=UG8WJU81afrWPwItWB4Ag64E9EpyREMpBbAVGVEYJiM,14550
|
@@ -171,10 +171,10 @@ modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0y
|
|
171
171
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
172
172
|
modal_version/__init__.py,sha256=wiJQ53c-OMs0Xf1UeXOxQ7FwlV1VzIjnX6o-pRYZ_Pk,470
|
173
173
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
174
|
-
modal_version/_version_generated.py,sha256=
|
175
|
-
modal-0.73.
|
176
|
-
modal-0.73.
|
177
|
-
modal-0.73.
|
178
|
-
modal-0.73.
|
179
|
-
modal-0.73.
|
180
|
-
modal-0.73.
|
174
|
+
modal_version/_version_generated.py,sha256=0TdhwUmZshKy03YiNeQOPHaLryEq2-1sH3wbFbzM3UA,149
|
175
|
+
modal-0.73.23.dist-info/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
176
|
+
modal-0.73.23.dist-info/METADATA,sha256=zo7qxRSzgUgf0X4JNxvvPak1yq2n7eYT54K8I1EvQJ0,2330
|
177
|
+
modal-0.73.23.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
178
|
+
modal-0.73.23.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
179
|
+
modal-0.73.23.dist-info/top_level.txt,sha256=1nvYbOSIKcmU50fNrpnQnrrOpj269ei3LzgB6j9xGqg,64
|
180
|
+
modal-0.73.23.dist-info/RECORD,,
|
modal_proto/api.proto
CHANGED
@@ -2280,6 +2280,10 @@ message Sandbox {
|
|
2280
2280
|
optional uint32 snapshot_version = 25;
|
2281
2281
|
|
2282
2282
|
string cloud_provider_str = 26; // Supersedes cloud_provider
|
2283
|
+
|
2284
|
+
// Specifies container runtime behavior for sandboxes which are restored from a snapshot.
|
2285
|
+
// Set by the backend at snapshot creation time.
|
2286
|
+
optional string runsc_runtime_version = 27;
|
2283
2287
|
}
|
2284
2288
|
|
2285
2289
|
message SandboxCreateRequest {
|