computation-graph 65__tar.gz → 66__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.
- {computation_graph-65 → computation_graph-66}/PKG-INFO +1 -1
- {computation_graph-65 → computation_graph-66}/computation_graph/run.py +15 -32
- {computation_graph-65 → computation_graph-66}/computation_graph.egg-info/PKG-INFO +1 -1
- {computation_graph-65 → computation_graph-66}/setup.py +1 -1
- {computation_graph-65 → computation_graph-66}/LICENSE.md +0 -0
- {computation_graph-65 → computation_graph-66}/README.md +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/__init__.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/base_types.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/__init__.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/composers_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/condition.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/condition_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/debug.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/duplication.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/lift.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/lift_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/logic.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/memory.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/composers/memory_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/graph.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/graph_runners.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/graph_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/legacy.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/signature.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/__init__.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/ascii.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/graphviz.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/graphviz_test.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/mermaid.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph/trace/trace_utils.py +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph.egg-info/SOURCES.txt +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph.egg-info/dependency_links.txt +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph.egg-info/requires.txt +0 -0
- {computation_graph-65 → computation_graph-66}/computation_graph.egg-info/top_level.txt +0 -0
- {computation_graph-65 → computation_graph-66}/pyproject.toml +0 -0
- {computation_graph-65 → computation_graph-66}/setup.cfg +0 -0
|
@@ -276,14 +276,6 @@ def _node_incoming_edges_to_input_spec(
|
|
|
276
276
|
)
|
|
277
277
|
|
|
278
278
|
|
|
279
|
-
def _to_awaitable(v) -> Awaitable:
|
|
280
|
-
if inspect.isawaitable(v):
|
|
281
|
-
return v
|
|
282
|
-
f = asyncio.get_event_loop().create_future()
|
|
283
|
-
f.set_result(v)
|
|
284
|
-
return f
|
|
285
|
-
|
|
286
|
-
|
|
287
279
|
def _make_get_node_executor(
|
|
288
280
|
edges, handled_exceptions, single_node_side_effect: _SingleNodeSideEffect
|
|
289
281
|
):
|
|
@@ -301,25 +293,6 @@ def _make_get_node_executor(
|
|
|
301
293
|
)
|
|
302
294
|
)
|
|
303
295
|
|
|
304
|
-
async def gather(
|
|
305
|
-
args: Tuple[Awaitable, ...], kwargs: Mapping[str, Awaitable]
|
|
306
|
-
) -> tuple[tuple[Any, ...], dict[str, Any]]:
|
|
307
|
-
if args or kwargs:
|
|
308
|
-
try:
|
|
309
|
-
gathered = await asyncio.gather(*args, *kwargs.values())
|
|
310
|
-
return gathered[: len(args)], dict(
|
|
311
|
-
zip(kwargs.keys(), gathered[len(args) :])
|
|
312
|
-
)
|
|
313
|
-
except (
|
|
314
|
-
_DepNotFoundError,
|
|
315
|
-
base_types.SkipComputationError,
|
|
316
|
-
*handled_exceptions,
|
|
317
|
-
):
|
|
318
|
-
# We delete the references to the upstream tasks to avoid circular reference (task->exception->traceback->task) and improve memory performance
|
|
319
|
-
del args, kwargs
|
|
320
|
-
raise _DepNotFoundError() from None
|
|
321
|
-
return (), {}
|
|
322
|
-
|
|
323
296
|
def node_to_input_sync(
|
|
324
297
|
accumulated_results: Mapping[base_types.ComputationNode, base_types.Result],
|
|
325
298
|
input_options: Iterable[_ComputationInputSpec],
|
|
@@ -349,12 +322,20 @@ def _make_get_node_executor(
|
|
|
349
322
|
accumulated_results.get(kwarg, CG_NO_RESULT) is not CG_NO_RESULT
|
|
350
323
|
for kwarg in kwargs_spec.values()
|
|
351
324
|
):
|
|
325
|
+
# Resolve inputs in place: await only the still-pending ones
|
|
326
|
+
# (already-scheduled tasks, so concurrency is preserved) and pass
|
|
327
|
+
# concrete values straight through. This avoids allocating a
|
|
328
|
+
# resolved Future per concrete input and the asyncio.gather
|
|
329
|
+
# machinery; the comprehension does zero awaits when nothing is
|
|
330
|
+
# pending, so it completes without suspending.
|
|
331
|
+
args = [accumulated_results[a] for a in args_spec]
|
|
332
|
+
kwargs = {k: accumulated_results[v] for k, v in kwargs_spec.items()}
|
|
352
333
|
try:
|
|
353
|
-
return
|
|
354
|
-
tuple(
|
|
334
|
+
return (
|
|
335
|
+
tuple([await x if inspect.isawaitable(x) else x for x in args]),
|
|
355
336
|
{
|
|
356
|
-
k:
|
|
357
|
-
for k,
|
|
337
|
+
k: (await x if inspect.isawaitable(x) else x)
|
|
338
|
+
for k, x in kwargs.items()
|
|
358
339
|
},
|
|
359
340
|
)
|
|
360
341
|
except (
|
|
@@ -362,7 +343,9 @@ def _make_get_node_executor(
|
|
|
362
343
|
base_types.SkipComputationError,
|
|
363
344
|
*handled_exceptions,
|
|
364
345
|
):
|
|
365
|
-
|
|
346
|
+
# Drop refs to the upstream tasks to avoid a
|
|
347
|
+
# task -> exception -> traceback -> task reference cycle.
|
|
348
|
+
del args, kwargs
|
|
366
349
|
return None
|
|
367
350
|
|
|
368
351
|
@opt_gamla.after(asyncio.create_task)
|
|
@@ -7,7 +7,7 @@ with open("README.md", "r") as fh:
|
|
|
7
7
|
setuptools.setup(
|
|
8
8
|
name="computation-graph",
|
|
9
9
|
python_requires=">=3",
|
|
10
|
-
version="
|
|
10
|
+
version="66",
|
|
11
11
|
long_description=_LONG_DESCRIPTION,
|
|
12
12
|
long_description_content_type="text/markdown",
|
|
13
13
|
packages=setuptools.find_namespace_packages(),
|
|
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
|
{computation_graph-65 → computation_graph-66}/computation_graph.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|