Skip to content

cuda.core: expose GraphDefinition cloning #2438

Description

@Andy-Jost

Background

CUDA provides cuGraphClone() to create an independent copy of a graph definition and cuGraphNodeFindInClone() to map source nodes to their clones. cuda.core already handles CUDA-created clones internally when embedding child graphs, including copying and rekeying attachment metadata, but GraphDefinition does not expose cloning publicly.

Scope

Add a public cloning API for GraphDefinition, including:

  • Clone the underlying CUgraph with cuGraphClone().
  • Create an independent cuda.core graph hierarchy for the clone.
  • Copy and rekey node attachment metadata across the complete hierarchy, including nested child graphs.
  • Provide a supported way to map or reconstruct corresponding nodes in the clone.
  • Preserve resource ownership and lifetime guarantees without coupling later source and clone mutations.
  • Document the API and add release notes.

Acceptance criteria

  • A graph definition can be cloned through a public cuda.core API.
  • Source and clone can be mutated, instantiated, and destroyed independently.
  • Nodes, edges, parameters, child graphs, and supported graph metadata are preserved.
  • Attached resources remain alive independently for each graph and are released at the appropriate lifetime boundary.
  • Tests cover node mapping, nested child graphs, attachments, mutation isolation, executable behavior, and cleanup.

Activity

  1. added this to the cuda.core next milestone on Jul 28, 2026
  2. self-assigned this
    on Jul 28, 2026
  3. added
    triage
    P2
    feature
    cuda.core
    P1
    and removed
    P2
    on Jul 28, 2026
  4. added
    P0
    and removed
    triage
    P1
    on Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P0cuda.corefeature

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions