nemo-mbridge-perf-moe-long-context
Long-context MoE training guidance for Megatron Bridge. Covers CP sizing, selective recompute, dispatcher choices, and practical patterns from DSV3, Qwen3, and Qwen3-Next long-context experiments.
Security Assessment
About nemo-mbridge-perf-moe-long-context
This skill is an NVIDIA performance-tuning reference for training Mixture-of-Experts (MoE) models at long sequence lengths with Megatron Bridge. It solves the problem of fitting and efficiently running long-context MoE training, where attention memory and activation residency dominate and naive configurations cause out-of-memory errors or degraded throughput. It explains what changes past the 4K-class regime and which levers help: context parallelism, selective recompute, lower precision, CPU offload for optimizer state, and dispatcher and pipeline layouts that preserve the shrinking data-parallel budget.
The skill distills practical patterns from real long-context experiments on DSV3 (H100) and Qwen3 and Qwen3-Next (GB200), noting for each how throughput and memory behave as context grows and how selective recompute, CP sizing, pipeline layout, and grouped-GEMM improvements interact. It offers CP sizing rules of thumb (starting from a 4K shard target of roughly seq_len over 4096 rounded to a power-of-two layout, keeping DP alive, preferring selective recompute of modules like up_proj, norm, moe, and mlp, and avoiding SDPA-heavy recompute). It gives representative config families for 128K and 256K contexts including TP, CP, EP, PP, VPP, precision, dispatcher, and recompute choices, plus CUDA graph guidance and common pitfalls. Its bundled benchmark reports a 100% security score in NVSkills-Eval.
It targets ML performance engineers and researchers training large MoE models at long context. Typical use cases include planning parallelism for 128K-token training, choosing recompute strategy, and investigating a commit that caused long-context MoE OOM or throughput regressions. It is guidance and configuration knowledge rather than executable tooling.
FAQ
When should I use this skill?
When training MoE models at long sequence lengths, or investigating a commit that caused long-context MoE out-of-memory or degraded throughput, for scenarios like 128K tokens and CP sizing.
How do I choose the context parallelism size?
Start from a 4K shard target (roughly CP = seq_len / 4096), round to a practical power-of-two layout, keep data parallelism alive, and prefer selective recompute before full recompute.
Which recompute modules does it recommend?
Selective recompute of smaller modules such as up_proj, norm, moe, moe_act, or mlp, while avoiding SDPA-heavy attention-internal recompute at very long context where it adds work for less memory benefit.
Does it provide concrete configurations?
Yes, it lists representative config families (e.g., DSV3 at 128K and 256K on H100, Qwen3 235B at 128K on GB200) with TP, CP, EP, PP, VPP, precision, dispatcher, and recompute settings.
Is this executable code?
No, it is performance guidance and configuration knowledge with reference config families and CUDA graph advice, meant to inform how you configure Megatron Bridge training runs.
Install nemo-mbridge-perf-moe-long-context
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
nvidia/skills