nvidia/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.
npx skills add https://github.com/NVIDIA/skills --skill nemo-mbridge-perf-moe-long-context
Stable docs: @docs/training/moe-optimization.md
Card: @skills/nemo-mbridge-perf-moe-long-context/card.yaml
Once sequence length moves well past the 4K-class regime, attention memory and
activation residency become the dominant constraints. For MoE models, that
usually means you need some combination of:
The DSV3 long-context runs show a stable pattern:
shortest contexts
contexts if CP is increased appropriately
In other words, long context does not immediately collapse utilization if the
layout is chosen well, but it does consume the DP budget very quickly.
Qwen3-Next behaves more like a memory-sensitive medium-scale model:
much tighter
Qwen3 235B shows that long context can still be efficient on NVL72 systems when
TP, CP, and HybridEP are coordinated. The best 128K-class configurations are
not just "fit-only" recipes; they can remain highly efficient if routing,
parallelism, and recompute are balanced.
CP ~= seq_len / 4096, then round to a practical power-of-two layout.
EP, TP, and PP together squeeze DP down to the floor.
up_proj, norm,moe, moe_act, or mlp before reaching for full recompute.
internals can add a lot of work for less memory benefit than recomputing
smaller MoE and MLP-side modules.
sometimes trade some CP for TP while still staying efficient.
to reduce global batch size or accept higher GA.
TP=1 CP=32 EP=32 PP=8 VPP=4
Precision: FP8-class
Dispatcher: DeepEP
Recompute: up_proj, norm, moe, mlp
Extra memory help: optimizer CPU offload
TP=1 CP=64 EP=32 PP=8 EDP=2 VPP=4
Precision: FP8-class
Dispatcher: DeepEP
Recompute: up_proj, norm, moe, mlp
Extra memory help: optimizer CPU offload
TP=4 CP=4 EP=32 PP=4 VPP=12
Precision: BF16 or MXFP8
Dispatcher: HybridEP
Recompute: moe_act, norm
CUDA Graph: attn + moe_router + moe_preprocess
For long-context MoE training:
Useful references:
the others disappear.
recompute choice, and offload strategy often need to change.
look fine in a single recipe, then become impossible once EP and PP are added
honestly across the full model.
padding strategies can silently break the path.
tend to rely on newer kernels and bug fixes than short-context bring-up does.
Take nvidia/nemo-mbridge-perf-moe-long-context from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.