You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5dbc8d
Browse filesBrowse the repository at this point in the historyBrowse files
authored
cuda.core: preserve graph identity when CUDA reuses handles (#3294)
* cuda.core: preserve graph identity across native handle reuse
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
* cuda.core: scope the child-graph registry to the parent GraphBox
The process-wide graph registry mapped a raw CUgraph to its canonical
GraphHandle. Every handle of a hierarchy aliases the hierarchy's single
control block, so a lockable registry entry proved only that the hierarchy
was alive, not that the child graph was. CUDA destroys a child graph inside
cuGraphDestroyNode, cuGraphNodeSetParams, or capture invalidation, and the
box is retired only after the driver call returns. In that window the map
could hand one hierarchy's recycled address to another.
The only reader, create_child_graph_handle, always knows the parent, and
roots are never looked up. Each GraphBox now holds the registry of its
direct child graphs, next to its node registry. A recycled address can only
collide inside one hierarchy, where mutations are externally synchronized
and every retire precedes the matching registration. The conditional
unregister_handle overload, the bulk register_handles, the static registry,
and the hierarchy deleter's unregister loop are gone. The same-parent
registry test modeled two live generations at one address under one parent,
which the synchronization contract excludes, and is removed.
Written by Codex (gpt-6.1-sol); reviewed by Claude.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
* cuda.core: key child graphs by address and owner node
A child graph is identified within its parent by its CUgraph and the node
that owns it. Keying the per-parent registry by that pair makes the owner
check part of the lookup. A box whose graph CUDA destroyed before cuda.core
retired it keeps a key distinct from a newer child that reuses its address
under another owner, so retiring the stale box cannot erase the newer entry.
The same-parent registry test is restored; it passes under the pair key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
Co-authored-by: Andy Jost <ajost@nvidia.com>
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
0 commit comments