Skip to main content

Module exec

Module exec 

Source
Expand description

Instantiated executable graph — a CPU-side model of CUDA graph instantiation and update.

On real hardware, a ComputeGraph is instantiated into an executable graph (cudaGraphExec_t) once, and then launched many times. Between launches the cheap thing to do is to update node parameters in place (cudaGraphExecKernelNodeSetParams, cudaGraphExecUpdate) rather than re-instantiate from scratch — but an in-place update is only legal when the new topology matches the instantiated one exactly.

This module models that lifecycle purely on the CPU:

  • ExecGraph::instantiate validates a ComputeGraph is a DAG and snapshots its topology (nodes + edges) and node parameters.
  • ExecGraph::update_node applies a single-node parameter update, validating the parameter shape (e.g. a kernel node may only be updated with kernel parameters, and a memcpy’s size may not change).
  • ExecGraph::update applies a whole-graph update against a freshly built ComputeGraph, requiring identical topology and only differing parameters — exactly the cudaGraphExecUpdate contract.
  • ExecGraph::diff computes a structural / parameter diff against another ComputeGraph, reporting whether an in-place update is possible at all.
  • ExecGraph::clone preserves the full topology of the executable graph.

No GPU is required; this is pure data-structure and validation work.

Structs§

ExecGraph
An instantiated executable graph: a validated topology snapshot plus the per-node parameters that an in-place update may modify.
ExecGraphDiff
The result of diffing an ExecGraph against a ComputeGraph.

Enums§

NodeParamUpdate
A parameter-only update to a single instantiated node.