Skip to main content

Module cuda_graph

Module cuda_graph 

Source
Expand description

CUDA Graph capture backend.

Converts an ExecutionPlan into an oxicuda_driver::graph::Graph, which can be instantiated and launched with minimal CPU overhead via the CUDA driver’s graph API.

§Mapping

PlanStepdriver::graph::GraphNode
KernelLaunchGraphNode::KernelLaunch
MemcpyGraphNode::Memcpy
MemsetGraphNode::Memset
BarrierGraphNode::Empty
EventRecord/WaitGraphNode::Empty (sync barrier)
HostCallbackGraphNode::Empty (placeholder)

The dependency edges from the original plan are preserved: each step depends on all steps that produced an event it is waiting for.

§Limitations

  • Stream-parallel execution is not yet mapped to separate CUDA stream arguments — all nodes are enqueued on the same graph-internal stream. Proper multi-stream CUDA graph support requires the cuGraphAddNode API with cuGraphNodeParams, which is future work.
  • EventRecord/EventWait steps collapse into Empty nodes with a dependency edge, which enforces ordering without the overhead of true event signalling within a CUDA graph.

Functions§

capture
Captures an ExecutionPlan into a driver::graph::Graph.