cuda.core: add executable graph node updates - #2473
Draft
Andy-Jost wants to merge 7 commits into
Draft
Conversation
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
/ok to test |
Install a private CUDA user object per graph executable so later node updates can retain replacement resources safely.
Expose ephemeral graph-node views that update complete executable parameters while retaining every replacement resource CUDA may still use.
Exercise public mutators, rollback, source reclamation, independent ownership, whole updates, and in-flight cleanup end to end.
Andy-Jost
force-pushed
the
ajost/graph-exec-attachments
branch
from
July 31, 2026 19:43
450d1d5 to
dd97efa
Compare
Contributor
Author
|
/ok to test |
Instantiation and whole-graph update each went through a prepare/commit pair. That exposed an opaque transaction type over the internal C++ interface and split the exec ownership contract between C++ and Cython, unlike every other resource handle, which a single create_* function owns end to end. Replace the pairs with create_graph_exec_handle and graph_exec_update. Each stages a fresh attachment accumulator on the source graph, makes the CUDA call with the GIL released, and adopts or publishes the result, so the staging transaction becomes a stack guard in the anonymous namespace instead of a header type. Cython keeps only what belongs to it: filling the instantiation params and decoding the failure reasons. The two driver entry points move into the C++ loader table with the calls. Convert the attachment append transaction to the unique_ptr plus rollback deleter pattern that node attachments already use, which retires the committed flag in favor of the same release-and-delete mechanism. Drop GraphExecBox::attachment_object, which nothing reads.
Three gaps remained around owners attached to an executable graph. Sequential updates to the same node must keep the superseded owner reachable, because CUDA cannot detach user objects from an executable; verified by breaking the append into a replace, which fails the new test on exactly that assertion. Closing an executable while a launch is in flight must not retire the accumulator, since the launch still writes through the buffer that an individual node update attached. A child-graph update attaches no owner of its own and relies on CUDA cloning the replacement graph's user object references into the executable. Assert that contract directly: the callback outlives the definition that supplied it and is released with the executable.
CUDA accepts user objects on a CUgraph only, so an executable graph can never receive an owner after it exists. Document the consequence: one accumulator is retained on the source graph, propagated by instantiation or whole-graph update, and then released from the source so the executable becomes its only owner. Record why an owner is never removed once appended, and correct the two Scope entries that still described executable graphs as untracked. State the retention limit in the release notes as well. The API reference already documents it, but the note is what a reader sees when adopting the feature, and retention that looks unbounded deserves the warning there.
Contributor
Author
|
/ok to test |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
graph[node]views for complete kernel, memcpy, memset, host-callback, child-graph, and event updates, plus executable enable state where CUDA supports it.Changes
cuGraphExecNodeSetParamswhile CUDA remains authoritative for node association.Notes
GPU tests were intentionally deferred to CI.
Related Work
Closes #2353.
Closes #2354.