NVIDIA / NVIDIA/cuda-python

cuda.core: expose GraphDefinition cloning

Open
#2,438 0 comments 0 reactions 1 assignee View on GitHub

@Andy-Jost is already working on this.

Since Jul 28, 2026.

cuda.core feature P0
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.