Skip to content

Commit 05952a3

Browse files
Fix an apparent mistake in GraphBuilder.add_child (#879)
* Fix an apparent mistake in GraphBuilder.add_child While working on C++ stand-alone code executing what `test_graph.py` does in gh-843, I noticed that `add_child` passes dependendencies extracted from capturing stream inconsistently with num_dependencies parameter obtained in the same cuStreamGetCaptureInfo call. Incidentally, after correcting this error, I can no longer reproduce errors reported in gh-843 * Implemented fix to work with both CTK 12.9 and CTK 13.0
1 parent 85da64b commit 05952a3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

cuda_core/cuda/core/experimental/_graph.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,14 @@ def add_child(self, child_graph: GraphBuilder):
683683
driver.cuStreamGetCaptureInfo(stream_handle)
684684
)
685685

686+
# See https://github.com/NVIDIA/cuda-python/pull/879#issuecomment-3211054159
687+
# for rationale
688+
deps_info_trimmed = deps_info_out[:num_dependencies_out]
686689
deps_info_update = [
687690
[
688691
handle_return(
689692
driver.cuGraphAddChildGraphNode(
690-
graph_out, deps_info_out[0], num_dependencies_out, child_graph._mnff.graph
693+
graph_out, *deps_info_trimmed, num_dependencies_out, child_graph._mnff.graph
691694
)
692695
)
693696
]

0 commit comments

Comments
 (0)