nemo-mbridge-perf-moe-optimization-workflow
БесплатноБез исполняемых скриптовНе проверенEvidence-gated workflow for MoE performance optimization in Megatron Bridge. Covers measurement contracts, the Three Walls framework, parallel folding…
от NVIDIA★ 4 269 звёзд на GitHubОб этом скилле
MoE Training Optimization Workflow
Stable docs: @docs/training/moe-optimization.md Card: @skills/nemo-mbridge-perf-moe-optimization-workflow/card.yaml Source: Scalable Training of MoE Models with Megatron Core
Quick Reference
Start with the paper's Three Walls:
- memory wall
- communication wall
- compute-efficiency wall
For operational diagnosis, split the compute-efficiency wall into compute and host/launch bottlenecks. They need different evidence and different fixes. MoE tuning is iterative, so use this order:
freeze the measurement contract -> fit -> scale -> profile -> retune -> validate
First Answer Checklist
For MoE optimization workflow prompts, present the response in this order:
- Freeze the measurement contract: record the exact model and task, hardware and topology, container and commits, data and routing semantics, precision, sequence and batch shape, parallelism, graph scopes, and the steady-state metric window. Label each candidate as training-equivalent or benchmark-only.
- Fit: make the model memory-feasible first. Use the smallest model
parallelism that fits, prefer selective recompute before full recompute, add
offloading only after recompute and parallelism are insufficient, and use
--fake-init-process-groupto sanity-check large layouts. - Scale: maximize DP after the model fits, keep hot communication inside the fastest interconnect, use PP plus VPP for multi-node scaling, prefer EP over extra TP for expert layers, and add CP when long context makes attention memory dominant.
- Profile: identify the dominant wall: memory, communication, host overhead, or compute.
- Retune: change one variable at a time based on the profiled bottleneck. Dispatcher, overlap, lower precision, CUDA graphs, and recompute are candidates, not hardware defaults.
- Validate: use short matched screens to reject candidates, then run the winner for at least 50 steps. Verify the requested backend or graph replay actually ran, time a declared post-warmup window, and report loss health, skipped/NaN iterations, memory, step time, and model TFLOPS/GPU.
- Include the exact Parallel Folding meshes:
Attention: TP x CP x DP x PPandMoE: ETP x EP x EDP x PP. - Use
alltoallfor safe bring-up, then A/Bflex+deepepandflex+hybridepwhen their packages and target topology support them. Start from BF16 and eager execution; introduce lower precision or the narrowest useful CUDA-graph scope only after profiling justifies it.
Phase 0: Freeze The Measurement Contract
A comparison is valid only when the following stay fixed unless they are the single variable under test:
- Bridge, MCore, Transformer Engine, container, CUDA, and NCCL versions
- GPU count, SKU, node topology, and launcher/environment settings
- model, task, data path, sequence length, MBS, GBS, and optimizer settings
- TP, PP, VPP, CP, EP, ETP, and DP layout
- routing semantics, precision, recompute, dispatcher, overlap, and graph scope
- warmup and steady-state timing windows
Separate two acceptance classes:
- Training-equivalent changes preserve the intended routing, loss, data, optimizer, and checkpoint/resume behavior.
- Benchmark-only changes such as forced load balancing are useful for controlled kernel studies, but cannot establish production-training correctness or convergence.
Phase 1: Make The Run Memory-Feasible
Start with a configuration that fits reliably before chasing throughput.
Recommended order:
- Use the smallest amount of model parallelism that still fits.
- Turn on selective recompute before falling back to full recompute.
- Add offloading only when recompute and parallelism are still insufficient.
- Use
--fake-init-process-groupto sanity-check large parallel layouts on a single GPU before burning cluster time.
Recompute guidance
Prefer selective recompute for MoE runs:
- good first choices:
layernorm,core_attn,moe_act,mlp, or model-specific modules (shared_experts,mla_up_proj) - use full recompute only when the run still does not fit
- revisit recompute after enabling CUDA graphs, because some graph scopes and full recompute paths do not mix well
As a rule of thumb, fine-grained recompute often recovers most of the needed memory while keeping throughput much closer to the non-recompute baseline than full-layer recompute does.
Phase 2: Choose Parallelism For Scale
Priority order:
- Maximize DP once the model fits.
- Keep the hot communication path inside the fast interconnect when possible.
- Use PP, plus VPP if needed, for multi-node scaling.
- Prefer EP over extra TP for expert layers.
- Add CP for long context once sequence length makes attention memory dominant.
Parallel Folding
Parallel Folding decouples attention and MoE parallelism so you do not have to pick a single comprom
Установить nemo-mbridge-perf-moe-optimization-workflow в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nemo-mbridge-perf-moe-optimization-workflow?
Evidence-gated workflow for MoE performance optimization in Megatron Bridge. Covers measurement contracts, the Three Walls framework, parallel folding, profiling, matched A/B tuning, and final validation.
Как установить скилл nemo-mbridge-perf-moe-optimization-workflow?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nemo-mbridge-perf-moe-optimization-workflow запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic