cuda.core: add graph definition node updates#2395
Draft
Andy-Jost wants to merge 14 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 |
|
Andy-Jost
force-pushed
the
graph-definition-node-updates
branch
from
July 22, 2026 23:04
4ce2862 to
fffa9fd
Compare
mdboom
reviewed
Jul 23, 2026
mdboom
left a comment
Contributor
There was a problem hiding this comment.
The general organization and approach looks fine to me.
One small suggestion (that I can't really evaluate because I don't deeply understand the use cases).
Andy-Jost
force-pushed
the
graph-definition-node-updates
branch
2 times, most recently
from
July 23, 2026 22:22
6bafe1a to
84bcfab
Compare
Contributor
Author
|
/ok to test |
This was referenced Jul 24, 2026
Use the generic node setter with failure-atomic attachment replacement, establishing the shared path for definition-level parameter mutation.
Extend definition-level mutation to event waits and both Python and ctypes host callbacks while preserving old executable state and attachment ownership.
Report unsupported driver or binding versions before preparing mutation attachments or calling the generic node setter.
Allow partial memset parameter replacement while preserving graph-owned destination lifetimes and previously instantiated graph behavior.
Support partial copy parameter replacement while preserving independent source and destination ownership across graph instantiations.
Support independent launch configuration and argument replacement while requiring explicit arguments when changing kernels.
Replace embedded child hierarchies while preserving attachment metadata, invalidating stale views, and keeping existing executables independent.
Describe supported mutation methods, CUDA 12.2 requirements, and executable graph behavior in the API and release notes.
Use type-erased shared ownership for prepared child updates so extension loading does not depend on a hidden C++ deleter symbol.
Reflect shared ownership for the opaque child update transaction in the generated stub.
Make memcpy and memset mutation calls explicit and unambiguous before the public API freezes.
Preserve memory-node contexts, reject unsupported node forms, and fail clearly when child graph metadata cannot be updated.
Andy-Jost
force-pushed
the
graph-definition-node-updates
branch
from
July 24, 2026 21:08
84bcfab to
f500f26
Compare
Contributor
Author
|
/ok to test f500f26 |
Resolve the CUDA 13.2 graph parameter getter dynamically so CUDA 12 binding builds remain compilable.
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
Add subclass-specific
update()methods for mutable graph definition nodes. The new API supports kernel, memcpy, memset, child-graph, event-record, event-wait, and host-callback nodes while leaving inspection properties read-only.Updates replace one complete CUDA parameter structure through
cuGraphNodeSetParams. Optional keyword arguments preserve existing values where coherent, coupled values such as kernels and arguments are replaced together, and existing executable graphs continue using their previous parameters and retained resources. This feature requires CUDA driver andcuda.bindingsversions 12.2 or newer.Changes
update()methods forKernelNode,MemcpyNode,MemsetNode,ChildGraphNode,EventRecordNode,EventWaitNode, andHostCallbackNode.args=()for a no-argument kernel.Review guide
cuda_core/cuda/core/graph/_subclasses.pyxand_subclasses.pyifor the public update signatures and node-specific parameter construction._set_definition_node_paramsfor the common CUDA 12.2 gate and attachment transaction ordering.resource_handles.cpp/.hppfor staged child-hierarchy metadata replacement and shared clone/rekey primitives.test_graph_node_update.pyfor old-versus-new executable behavior and failure preservation, thentest_graph_definition_lifetime.pyfor child-view invalidation and attachment lifetime coverage.Related Work