bladekit 4.43.2__tar.gz → 4.43.3__tar.gz
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.
- {bladekit-4.43.2 → bladekit-4.43.3}/.gitignore +2 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/PKG-INFO +1 -1
- {bladekit-4.43.2 → bladekit-4.43.3}/pyproject.toml +1 -1
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_app.py +4 -2
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_cls.py +16 -1
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_map.py +9 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/README.md +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/__init__.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_banner.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_batch.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_bucket.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_build.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_bundle.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_client.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_constants.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_cron.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_dict.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_env.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_exported_metrics.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_image.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_loader.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_metrics_cli.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_preempt.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_queue.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_render.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_runner_api.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_sandbox.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_secret.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_serialize.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_serve.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_volume.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/_webhook.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/cli.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/config.py +0 -0
- {bladekit-4.43.2 → bladekit-4.43.3}/src/bladekit/exceptions.py +0 -0
|
@@ -30,6 +30,8 @@ node_modules/
|
|
|
30
30
|
/e2e/artifacts/
|
|
31
31
|
/e2e/tutorials/artifacts/
|
|
32
32
|
/e2e/artifacts-*
|
|
33
|
+
/e2e/metrics/.bin/
|
|
34
|
+
/e2e/metrics/artifacts/
|
|
33
35
|
|
|
34
36
|
# Inference outputs from running the tutorials by hand — the tutorial code
|
|
35
37
|
# writes these to the working directory, so they land at the repo root. The
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
# uninstalled during an upgrade, and `forge` is a different project's name on
|
|
17
17
|
# public PyPI.
|
|
18
18
|
name = "bladekit"
|
|
19
|
-
version = "4.43.
|
|
19
|
+
version = "4.43.3"
|
|
20
20
|
description = "Blade AI Fabric SDK + CLI — run Python functions on Blade's GPU fleet."
|
|
21
21
|
readme = "README.md"
|
|
22
22
|
requires-python = ">=3.10"
|
|
@@ -1365,10 +1365,11 @@ class Function:
|
|
|
1365
1365
|
gpu_class=self.gpu_class,
|
|
1366
1366
|
best_effort=self.best_effort,
|
|
1367
1367
|
max_interruptions=self.max_interruptions,
|
|
1368
|
-
# The worker runs carry the function's volumes
|
|
1369
|
-
# single run does.
|
|
1368
|
+
# The worker runs carry the function's volumes, secrets and
|
|
1369
|
+
# @batched config, as a single run does.
|
|
1370
1370
|
volumes=self._volume_specs(),
|
|
1371
1371
|
secrets=self._secret_names(),
|
|
1372
|
+
batch_config=self.batch_config,
|
|
1372
1373
|
)
|
|
1373
1374
|
|
|
1374
1375
|
def _run_map(
|
|
@@ -1431,6 +1432,7 @@ class Function:
|
|
|
1431
1432
|
max_interruptions=self.max_interruptions,
|
|
1432
1433
|
volumes=self._volume_specs(),
|
|
1433
1434
|
secrets=self._secret_names(),
|
|
1435
|
+
batch_config=self.batch_config,
|
|
1434
1436
|
)
|
|
1435
1437
|
|
|
1436
1438
|
def _refuse_map_bucket_mounts(self) -> None:
|
|
@@ -272,7 +272,8 @@ class Method:
|
|
|
272
272
|
|
|
273
273
|
|
|
274
274
|
class _BoundMethod:
|
|
275
|
-
"""``instance.method`` — exposes ``.remote()`` / ``.spawn()`` / ``.local()
|
|
275
|
+
"""``instance.method`` — exposes ``.remote()`` / ``.spawn()`` / ``.local()``
|
|
276
|
+
and the map fan-outs, all carrying the instance's bound parameters."""
|
|
276
277
|
|
|
277
278
|
def __init__(self, method: Method, instance: Any) -> None:
|
|
278
279
|
self._method = method
|
|
@@ -303,6 +304,20 @@ class _BoundMethod:
|
|
|
303
304
|
def spawn(self, *args: Any, **kwargs: Any):
|
|
304
305
|
return self._function().spawn(*args, **kwargs)
|
|
305
306
|
|
|
307
|
+
# Map fan-outs: every worker constructs the class with this instance's
|
|
308
|
+
# bound parameters, as .remote() does (they ride in FunctionRef.parameters).
|
|
309
|
+
def map(self, iterable: Any, **kwargs: Any) -> Any:
|
|
310
|
+
return self._function().map(iterable, **kwargs)
|
|
311
|
+
|
|
312
|
+
def starmap(self, iterable: Any, **kwargs: Any) -> Any:
|
|
313
|
+
return self._function().starmap(iterable, **kwargs)
|
|
314
|
+
|
|
315
|
+
def spawn_map(self, iterable: Any, **kwargs: Any) -> Any:
|
|
316
|
+
return self._function().spawn_map(iterable, **kwargs)
|
|
317
|
+
|
|
318
|
+
def spawn_starmap(self, iterable: Any, **kwargs: Any) -> Any:
|
|
319
|
+
return self._function().spawn_starmap(iterable, **kwargs)
|
|
320
|
+
|
|
306
321
|
|
|
307
322
|
class Cls:
|
|
308
323
|
"""An ``@app.cls()``-decorated class: a namespace of remote methods.
|
|
@@ -116,6 +116,7 @@ def _create_map_batch(
|
|
|
116
116
|
max_interruptions: Optional[int],
|
|
117
117
|
volumes: Optional[List[dict]],
|
|
118
118
|
secrets: Optional[List[str]],
|
|
119
|
+
batch_config: Optional[dict],
|
|
119
120
|
) -> str:
|
|
120
121
|
"""Create a map invocation, push inputs, finalize; return its ``map_id``.
|
|
121
122
|
|
|
@@ -162,6 +163,10 @@ def _create_map_batch(
|
|
|
162
163
|
body["best_effort"] = True
|
|
163
164
|
if max_interruptions is not None:
|
|
164
165
|
body["max_interruptions"] = max_interruptions
|
|
166
|
+
# @batched: each worker fuses up to max_batch_size inputs into one call,
|
|
167
|
+
# as a batched run does (batching.md §4). Omitted when unbatched.
|
|
168
|
+
if batch_config is not None:
|
|
169
|
+
body["batch_config"] = batch_config
|
|
165
170
|
|
|
166
171
|
map_resp = client.create_map(body)
|
|
167
172
|
map_id = map_resp["map_id"]
|
|
@@ -209,6 +214,7 @@ def run_map(
|
|
|
209
214
|
max_interruptions: Optional[int] = None,
|
|
210
215
|
volumes: Optional[List[dict]] = None,
|
|
211
216
|
secrets: Optional[List[str]] = None,
|
|
217
|
+
batch_config: Optional[dict] = None,
|
|
212
218
|
) -> Generator[Any, None, None]:
|
|
213
219
|
"""Create a map batch, push inputs, finalize, stream results.
|
|
214
220
|
|
|
@@ -238,6 +244,7 @@ def run_map(
|
|
|
238
244
|
max_interruptions=max_interruptions,
|
|
239
245
|
volumes=volumes,
|
|
240
246
|
secrets=secrets,
|
|
247
|
+
batch_config=batch_config,
|
|
241
248
|
)
|
|
242
249
|
|
|
243
250
|
# Stream results.
|
|
@@ -270,6 +277,7 @@ def spawn_map(
|
|
|
270
277
|
max_interruptions: Optional[int] = None,
|
|
271
278
|
volumes: Optional[List[dict]] = None,
|
|
272
279
|
secrets: Optional[List[str]] = None,
|
|
280
|
+
batch_config: Optional[dict] = None,
|
|
273
281
|
) -> "MapHandle":
|
|
274
282
|
"""Fire an async fan-out and return a :class:`MapHandle` WITHOUT blocking.
|
|
275
283
|
|
|
@@ -299,6 +307,7 @@ def spawn_map(
|
|
|
299
307
|
max_interruptions=max_interruptions,
|
|
300
308
|
volumes=volumes,
|
|
301
309
|
secrets=secrets,
|
|
310
|
+
batch_config=batch_config,
|
|
302
311
|
)
|
|
303
312
|
return MapHandle(client, map_id)
|
|
304
313
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|