What problem does it solve?
CUDA graph capture can substantially reduce host-driver overhead, but it is easy to misconfigure in Megatron Bridge and TE-scoped setups due to strict constraints (static shapes, RNG tracker requirements, scope/impl compatibility, and environment limitations).
Core Features & Use Cases
- CUDA graph capture with two implementations: choose
"local" for full fwd+bwd full_iteration capture, or "transformer_engine" for TE-scoped graphs per layer scope such as attn, mlp, and MoE-related modules.
- Bring-up guidance for performance tuning: select the narrowest useful scope first, validate replay timing vs eager after warmup, and only then widen scope or combine with overlap features.
- Safety checks and failure-mode awareness: enforces TE RNG tracker requirements, validates NaN-check constraints for
full_iteration, and documents known blockers like packed-sequence incompatibility and scope restrictions for MoE.
Quick Start
Enable TE-scoped CUDA graphs by setting model.cuda_graph_impl to transformer_engine and model.cuda_graph_scope to attn,moe_router,moe_preprocess, while also turning on model.use_te_rng_tracker and rng.te_rng_tracker.