nemo_automodel.components.cuda_graphs.partial
nemo_automodel.components.cuda_graphs.partial
Component-owned partial CUDA graphs for fixed-shape attention and MoE preprocessing.
Attention, the parameterless router core, and HybridEP metadata preprocessing may be captured. Dynamic dispatch, expert compute, and combine remain eager.
Module Contents
Classes
Functions
Data
API
Capture selected TE attention and MoE submodules after one eager iteration.
Batch-capture all observed targets in real forward order.
Idempotently destroy every partial graph before distributed teardown.
Discover graph targets from an already-built training model.
Log visible aggregate graph activity counters.
Install first-call recorders on every selected target.
Return aggregate capture, replay, and eager-fallback counters.
Detached sample inputs and the invariants required for a safe replay.
Reconstruct the target call and its aliases from unique tensor inputs.
Validate a replay call and return its flattened tensor inputs.
One structurally discovered transformer or MTP block.
Bases: Module
Present module parameters as graph inputs instead of captured module state.
Return dynamic samples followed by graph-owned parameter samples.
Run the target with explicit parameter values.
Hide the registered target parameters from generic module utilities.
Hide the registered target parameters from TE module-parameter discovery.
Append the currently materialized live parameters for graph replay.
Discovery and entry-construction contract for one user-facing graph module.
One graphable module invocation and its replay safety state.
Build the tensor-only capture adapter after an eager sample was observed.
Return the sample surface passed to Transformer Engine.
Return the distinct iteration-0 input contracts in call order.
Destroy graph replay state and restore the eager target.
Return an FSDP2 owner to its normal sharded state after capture.
Install validated graph replay around the original target forward.
Materialize FSDP2 parameters before constructing explicit graph inputs.
Record the first eager call through a temporary pre-hook.
Remove the temporary eager-call recorder.
Bases: Module
Expose a mixed tensor/control module call as a tensor-only module call.
Rebuild and execute the captured target call.
Encode repeated tensor objects without depending on their absolute identities.
Build one fused HybridEP metadata-preprocessing graph entry.
Build one parameterless MoE router graph entry.
Build one TE fused-attention graph entry.
Build one whole-attention graph entry with graph-safe explicit parameters.
Remove ignored FP8 metadata while requiring the DPA compute itself to be BF16.
Return a bounded diagnostic for one non-tensor graph control.
Discover main-stack and MTP blocks using shared structural traversal.
Find the whole attention module in a transformer block.
Find an MoE sublayer by its gate-and-experts capability.
Find graphable fused HybridEP metadata preprocessing.
Find the parameterless routing core in an MoE transformer block.
Find the parameterless TE fused-attention boundary in a transformer block.
Load Transformer Engine’s graph helper only when the feature is enabled.
Return whether value is an immutable enum exported by TE’s extension.
Return a diagnostic model label without using it as a capability gate.
Return buffer identities and storage properties captured by a graph.
Reject sharded or otherwise unmaterialized parameters before graph capture.
Reject graph boundaries that own parameters managed outside the graph.
Compare non-tensor graph controls without invoking tensor-like equality.
Select graph targets while rejecting shared/repeated physical call sites.
Return metadata that must stay invariant across graph replays.
Parameters:
Tensor of arbitrary shape whose type, layout, shape, strides, dtype, device, and autograd requirement define the replay contract.
Returns: Any
Tuple containing the tensor subclass and replay-critical metadata. The
Return the module beneath any nested PyTorch checkpoint wrappers.
Return whether one physical MTP layer is invoked repeatedly per forward.