cuda-graphs

Capture and replay GPU operations to reduce host overhead in Megatron Bridge training.

2.8k|332|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill cuda-graphs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cuda-graphs
Source: https://github.com/NVIDIA/skills/tree/main/skills/Megatron-Bridge/perf-techniques/cuda-graphs
Command: npx skills add https://github.com/NVIDIA/skills --skill cuda-graphs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

CUDA graphs enable stable capture and replay of GPU operations to reduce host overhead during Megatron Bridge training.

Core Features & Use Cases

It supports two implementations: local full-iteration graphs via MCore and Transformer Engine scoped graphs for per-layer capture of attention, MLP, and MoE components, making it suitable for dense, MoE, and large-model training scenarios. Use cases include accelerating pretraining and fine-tuning by reducing iteration time and increasing throughput.

Quick Start

Enable CUDA graphs by selecting a graph implementation and scope, then start training as usual.

Frequently Asked Questions about cuda-graphs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I reduce GPU host overhead during Megatron Bridge training?

To reduce GPU host overhead during Megatron Bridge training, enable CUDA graphs to capture and replay GPU operations, which stabilizes execution and minimizes launch latency. This supports both full-iteration graphs and Transformer Engine scoped graphs for attention and MLP modules.

What is the difference between local full-iteration graphs and Transformer Engine scoped graphs?

Local full-iteration graphs capture entire training iterations via MCore, while Transformer Engine scoped graphs perform per-layer capture for attention, MLP, and MoE components. Both reduce host overhead but differ in their capture granularity and applicable module scopes.

Can I use CUDA graphs for Mixture of Experts (MoE) model training?

Yes, you can use CUDA graphs for MoE model training. The implementation supports Transformer Engine scoped graphs that specifically capture Mixture of Experts modules alongside attention and MLP components, making it suitable for both dense and MoE architectures.

How do I enable CUDA graphs for my training workflow?

To enable CUDA graphs, select a graph implementation and scope, then start training as usual. You must ensure your environment meets requirements like maintaining static tensor shapes and enabling the Transformer Engine RNG tracker before capture.

What are the limitations of using GPU graph capture for large model training?

Limitations of GPU graph capture include the requirement for static tensor shapes and adherence to mutual exclusions with other runtime constraints. You must also enable the Transformer Engine RNG tracker to ensure correct execution during graph replay.