NVIDIA/skills/skills/nemo-mbridge-perf-expert-parallel-overlap/SKILL.md
nemo-mbridge-perf-expert-parallel-overlap
Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlap_moe_expert_parallel_comm, delay_wgrad_compute, and flex dispatcher backends such as DeepEP and HybridEP.
- Source repository stars
- 3,093
- Declared platforms
- 0
- Static risk flags
- 0
- Last source update
- 2026-08-25
- Source checked
- 2026-08-25
Decision brief
What it does: where it fits
Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlap_moe_expert_parallel_comm, delay_wgrad_compute, and flex dispatcher backends such as DeepEP and HybridEP.
Not for
- Setting moeflexdispatcherbackend alone does not activate flex dispatch —
- Public recipes are often conservative and leave MoE overlap disabled by
What changed when the Skill was used
In this controlled same-task single run, enabling nemo-mbridge-perf-expert-parallel-overlap changed the output from 3978 non-whitespace characters and 11 headings to 4608 characters and 7 headings. Matches among 8 signals extracted from the pinned source changed from 1 to 3. Both actual outputs are shown; this is a structural observation, not a quality score or a universal performance claim.
Same test task
Design and implement a representative production change for a TypeScript webhook retry service. Include the key code or pseudocode, tradeoffs, and verification steps. The deliverable must specifically reflect this user intent: Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlap_moe_expert_parallel_comm, delay_wgrad_compute, and flex dispatcher backends such as DeepEP and HybridEP.

Baseline: 3978 non-whitespace characters, 11 headings, and 29 list items.

With Skill: 4608 non-whitespace characters, 7 headings, and 33 list items.
| Observation | Without Skill | With Skill |
|---|---|---|
| Source-signal coverage | 1/8: overlap | 3/8: overlap, correctness-first, alltoall |
| Output structure | 3978 chars · 11 headings · 29 list items · 4 code blocks | 4608 chars · 7 headings · 33 list items · 4 code blocks |
| Verification and caution signals | 9 verification signals · 5 risk/limitation signals | 11 verification signals · 5 risk/limitation signals |
A prompt you can use
Use the nemo-mbridge-perf-expert-parallel-overlap Skill pinned at 20bb6aaea832 for my task. Follow its source-specific constraints around `nemo-mbridge-perf-expert-parallel-overlap`, `expert-parallel`, `overlap`, `references`, then return the finished deliverable with explicit assumptions, verification, failure conditions, and limits. Do not treat the Skill text as a factual source or claim that a single demonstration proves universal performance.
Method and limitationsExpandCollapse
Test method
- Baseline and treatment used the same task, model (gpt-5.3-codex-low), and runner; the only planned difference was whether the complete target Skill text was injected.
- The treatment used snapshot ed2db6f3eba61ff522d164b5437f4413af2319bd; the current source commit 20bb6aaea832ba254dca639c5e8cbfb3e6de0baa was verified against content hash fd85bd73d680. The baseline explicitly prohibited loading any Skill or external rule file.
- The same deterministic script counted characters, headings, lists, code blocks, verification terms, caution terms, and source signals in both artifacts. Source signals: `nemo-mbridge-perf-expert-parallel-overlap`, `expert-parallel`, `overlap`, `references`, `quick`, `decision`, `correctness-first`, `alltoall`.
- The visuals are local screenshots of the actual Markdown artifacts in a fixed 1200 × 800 evidence canvas, not recreated product mockups. Raw JSON artifacts and request records are retained in the research directory.
Do not over-read this demo
- This is one controlled demonstration per condition, not a multi-run statistical benchmark; the model is stochastic.
- Character, structure, and keyword counts show observable differences but cannot by themselves prove correctness, originality, or business impact.
- The task is a representative test designed for repeatability, not every real-world use of the Skill; rerun after a material source change.
- Editorial review
- SkillSignal editorial
- Runner
- Cursor Agent 2026.08.04-aaa8809
- Model
- gpt-5.3-codex-low
- Refresh due
- 2026-11-18
- Reviewed commit
- 20bb6aaea832ba254dca639c5e8cbfb3e6de0baa
- Test snapshot
- ed2db6f3eba61ff522d164b5437f4413af2319bd
Compatibility matrix
Platform support, with evidence labels
| Platform | Status | Evidence | What to check |
|---|---|---|---|
| Codex | Not declared | No explicit evidence | Portability before use |
| Claude Code | Not declared | No explicit evidence | Portability before use |
| Cursor | Not declared | No explicit evidence | Portability before use |
| Gemini CLI | Not declared | No explicit evidence | Portability before use |
Installation
Inspect first. Install second.
The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.
npx skills add https://github.com/NVIDIA/skills --skill "skills/nemo-mbridge-perf-expert-parallel-overlap"Inspect the Agent Skill "nemo-mbridge-perf-expert-parallel-overlap" from https://github.com/NVIDIA/skills/blob/3a38625bf3e863eb9f26ea0d985130ddfb5c66ae/skills/nemo-mbridge-perf-expert-parallel-overlap/SKILL.md at commit 3a38625bf3e863eb9f26ea0d985130ddfb5c66ae. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.
Workflow
What the source asks the agent to do
- 01
Verification
After a successful run with EP overlap:
Confirm no assertion errors during CommOverlapConfig finalizationConfirm overlapmoeexpertparallelcomm appears as True in the loggedIf using flex dispatcher, confirm moetokendispatchertype = "flex" and - 02
What It Is
Expert-parallel (EP) overlap hides the cost of token dispatch/combine all-to-all communication by running it concurrently with expert FFN compute. Optionally, delayed expert weight-gradient computation (delaywgradcompute) provides additional overlap by deferring wgrad to overlap…
Expert-parallel (EP) overlap hides the cost of token dispatch/combine all-to-all communication by running it concurrently with expert FFN compute. Optionally, delayed expert weight-gradient computation (delaywgradcomput…Bridge supports two dispatcher paths: - 03
Quick Decision
the model is MoE with EP 1
the model is MoE with EP 1expert dispatch/combine communication is a meaningful part of step timeyou have memory headroom and are tuning for throughput - 04
Correctness-First alltoall Benchmark
For the plain EP-overlap isolation benchmark, keep flex dispatch and delayed wgrad disabled. The measured shape was Qwen3 MoE 30B-A3B SFT on 16 H100 GPUs: EP=16, alltoall, BF16, global batch size 1024, CUDA graphs disabled, moepermutefusion=false, measured over iterations 3-8.
For the plain EP-overlap isolation benchmark, keep flex dispatch and delayed wgrad disabled. The measured shape was Qwen3 MoE 30B-A3B SFT on 16 H100 GPUs: EP=16, alltoall, BF16, global batch size 1024, CUDA graphs disab…Use these overrides for the plain-overlap case:Do not use --moea2aoverlap true for this isolation test: the performance harness helper enables both overlapmoeexpertparallelcomm and delaywgradcompute, so it does not isolate plain EP overlap. - 05
HybridEP Production-Shape Benchmark
A 2026-07-25 controlled Qwen3 30B-A3B pretraining comparison validated plain EP overlap with the production HybridEP path:
A 2026-07-25 controlled Qwen3 30B-A3B pretraining comparison validated plain EP overlap with the production HybridEP path:The independent run reduced step time by 15.059% and raised throughput by 17.729% over the reproduced baseline. Loss was finite, skipped and NaN iterations remained zero, and rank-0 peak allocated memory was 62.166 GiB.A matched Nsight Systems comparison captured the same 463,348 rank-0 kernels per case. Enabling overlap increased communication concurrent with GEMM and attention from 9.079ms (0.11% of communication time) to 3,958.997m…
Permission review
Static risk signals and limitations
No configured static risk pattern was detected
This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.
Evidence record
Why each signal appears
| Signal | Value | Evidence type | Meaning |
|---|---|---|---|
| Quality score | 95/100 | Computed | Documentation, specificity, maintenance, and trust rules |
| Repository stars | 3,093 | Source | Repository attention, not individual Skill quality |
| Compatibility | 0 platforms | Source | Declared in the catalog source record |
| Usage guide | tested outcome page | Tested | Generated or reviewed according to the visible evidence level |
Pinned source
Provenance and original SKILL.md
- Repository
- NVIDIA/skills
- Skill path
- skills/nemo-mbridge-perf-expert-parallel-overlap/SKILL.md
- Commit
- 3a38625bf3e863eb9f26ea0d985130ddfb5c66ae
- License
- Apache-2.0
- Collected
- 2026-08-25
- Default branch
- main
View the original SKILL.md
MoE Expert-Parallel Overlap Skill
References
- Stable docs: @docs/training/communication-overlap.md
- Structured metadata: @skills/nemo-mbridge-perf-expert-parallel-overlap/card.yaml
What It Is
Expert-parallel (EP) overlap hides the cost of token dispatch/combine all-to-all
communication by running it concurrently with expert FFN compute. Optionally,
delayed expert weight-gradient computation (delay_wgrad_compute) provides
additional overlap by deferring wgrad to overlap with the next layer's forward.
Bridge supports two dispatcher paths:
| Dispatcher | Backend | When to use |
|---|---|---|
alltoall | Standard MoE all-to-all | Default, broadest compatibility |
flex | DeepEP or HybridEP | Higher overlap on Ampere/Hopper/Blackwell |
Quick Decision
Use EP overlap when:
- the model is MoE with
EP > 1 - expert dispatch/combine communication is a meaningful part of step time
- you have memory headroom and are tuning for throughput
Prefer:
alltoalldispatcher for the first rollout (broader compatibility)flex+ DeepEP/HybridEP when running on supported GPUs and seeking additional gains
Avoid EP overlap when:
- full activation recompute is enabled
moe_shared_expert_overlapis enabled- the run is still being brought up for correctness
- PyTorch < 2.6.0
Expected outcome:
- if all-to-all dispatch is a clear profile bottleneck, overlap can produce a modest to meaningful speedup
- if the run is tiny, communication-light, or dominated by another wall, the gain may be negligible
Correctness-First alltoall Benchmark
For the plain EP-overlap isolation benchmark, keep flex dispatch and delayed
wgrad disabled. The measured shape was Qwen3 MoE 30B-A3B SFT on 16 H100 GPUs:
EP=16, alltoall, BF16, global batch size 1024, CUDA graphs disabled,
moe_permute_fusion=false, measured over iterations 3-8.
Use these overrides for the plain-overlap case:
--cuda_graph_impl none \
--moe_flex_dispatcher_backend None \
--moe_a2a_overlap false \
comm_overlap.overlap_moe_expert_parallel_comm=true \
comm_overlap.delay_wgrad_compute=false \
model.moe_shared_expert_overlap=false
Do not use --moe_a2a_overlap true for this isolation test: the performance
harness helper enables both overlap_moe_expert_parallel_comm and
delay_wgrad_compute, so it does not isolate plain EP overlap.
Steady-window timing from that benchmark:
| Case | Steady mean | Relative |
|---|---|---|
| no EP overlap | 41.25s | 1.000x |
| EP overlap | 31.31s | 1.317x |
EP overlap plus delay_wgrad_compute | 31.20s | 1.322x |
This is evidence for enabling plain EP overlap on this inter-node all-to-all shape. It does not show a meaningful independent win from delayed wgrad, and it does not validate fused MoE permutation because that path was disabled for the runtime stack.
HybridEP Production-Shape Benchmark
A 2026-07-25 controlled Qwen3 30B-A3B pretraining comparison validated plain EP overlap with the production HybridEP path:
Hardware: 16×H100
Precision: BF16
Sequence: 4096
Parallelism: TP1 / PP1 / CP1 / EP16
Batch: MBS1 / GBS1024
Routing: force balance
Dispatcher: flex + HybridEP
CUDA graph: Transformer Engine scopes moe_router + moe_preprocess
Delayed wgrad: disabled
| Case | Steady window | Step time | Model TFLOPS/GPU |
|---|---|---|---|
| overlap off | iterations 5-20 | 24.7138s | 244.039 |
| overlap on, search run | iterations 5-20 | 21.0725s | 286.208 |
| overlap on, independent validation | iterations 41-50 | 20.9920s | 287.305 |
The independent run reduced step time by 15.059% and raised throughput by 17.729% over the reproduced baseline. Loss was finite, skipped and NaN iterations remained zero, and rank-0 peak allocated memory was 62.166 GiB.
A matched Nsight Systems comparison captured the same 463,348 rank-0 kernels per case. Enabling overlap increased communication concurrent with GEMM and attention from 9.079ms (0.11% of communication time) to 3,958.997ms (36.55%). GPU-active interval union fell from 22.821s to 21.221s.
Use this as evidence for the mechanism, not as a universal speedup promise. The dispatcher, graph scopes, routing, parallelism, batch shape, and runtime were held fixed while only plain EP overlap changed.
Enablement
alltoall dispatcher
cfg.comm_overlap.overlap_moe_expert_parallel_comm = True
cfg.comm_overlap.delay_wgrad_compute = False
cfg.model.moe_shared_expert_overlap = False
cfg.model.expert_model_parallel_size = 8
cfg.model.num_moe_experts = 64
cfg.model.moe_token_dispatcher_type = "alltoall"
cfg.model.bf16 = True
cfg.model.fp16 = False
Enable delay_wgrad_compute=True only after the plain overlap path is known to
work and its extra compatibility constraints have been checked.
flex dispatcher (DeepEP or HybridEP)
from megatron.bridge.training.flex_dispatcher_backend import apply_flex_dispatcher_backend
cfg.comm_overlap.overlap_moe_expert_parallel_comm = True
cfg.comm_overlap.delay_wgrad_compute = False
cfg.model.moe_shared_expert_overlap = False
apply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend="deepep")
# or: apply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend="hybridep")
Benchmark plain EP overlap first. Enable delay_wgrad_compute=True only as a
separate follow-up A/B after its CUDA-graph and TE compatibility constraints
are satisfied.
Compatibility And Constraints
expert_model_parallel_size > 1num_moe_experts > 1moe_token_dispatcher_typemust be"alltoall"or"flex"moe_shared_expert_overlap = False- Base precision is BF16 or FP16
- PyTorch
>= 2.6.0 - If
PP > 1,virtual_pipeline_model_parallel_sizemust be set recompute_granularity != "full",recompute_method = None,recompute_num_layers = Nonemtp_num_layersmust beNoneor1delay_wgrad_computerequiresoverlap_moe_expert_parallel_commas a prerequisitedelay_wgrad_computewithoverlap_grad_reducerequires TE >= 2.7.0delay_wgrad_computewithgradient_accumulation_fusionrequires TE >= 2.7.0- CUDA graph
attnscope +delay_wgrad_computerequires TE >= 2.12.0,gradient_accumulation_fusion = True, and no attention bias - DeepEP: Ampere, Hopper, B200, B300 GPUs only
- HybridEP: Ampere, Hopper, B200, B300, GB200/GB300 with NVL72
Minimal Working Config
cfg.comm_overlap.overlap_moe_expert_parallel_comm = True
cfg.comm_overlap.delay_wgrad_compute = False
cfg.model.expert_model_parallel_size = 4
cfg.model.num_moe_experts = 64
cfg.model.moe_token_dispatcher_type = "alltoall"
cfg.model.moe_shared_expert_overlap = False
cfg.model.bf16 = True
Use this as the correctness-first starting point. Add delayed wgrad, flex dispatch, and CUDA-graph interactions only after the plain overlap path is known to work.
Minimal Runnable Command
Performance harness example inside a Slurm allocation. Keep the model, parallelism, dispatcher, and runtime fixed, and vary only the two overlap overrides:
uv run python scripts/performance/run_script.py \
-m qwen \
-mr qwen3_30b_a3b \
--task pretrain \
-g h100 \
-c bf16 \
-ng 16 \
-gn 8 \
--max_steps 8 \
--cuda_graph_impl none \
--moe_flex_dispatcher_backend None \
--moe_a2a_overlap false \
--tokenizer_type NullTokenizer \
comm_overlap.overlap_moe_expert_parallel_comm=true \
comm_overlap.delay_wgrad_compute=false \
model.moe_shared_expert_overlap=false
Do not use --moe_a2a_overlap true when separating plain EP overlap from
delayed wgrad: the performance harness helper enables both
overlap_moe_expert_parallel_comm and delay_wgrad_compute.
Unit test verification:
uv run python -m pytest \
tests/unit_tests/training/test_comm_overlap.py -k "moe" \
tests/unit_tests/training/test_deepep.py -q
Verification
Unit tests
uv run python -m pytest \
tests/unit_tests/training/test_comm_overlap.py \
tests/unit_tests/training/test_deepep.py -q
Log checks
After a successful run with EP overlap:
- Confirm no assertion errors during
CommOverlapConfigfinalization - Confirm
overlap_moe_expert_parallel_commappears asTruein the logged config - If using flex dispatcher, confirm
moe_token_dispatcher_type = "flex"and the correct backend in logs
Success criteria
- Config validation passes for the selected dispatcher and overlap settings
- Training runs complete without hangs or assertion failures
- Throughput improves or at least does not regress for the target workload
- Loss trajectory matches baseline (overlap should not affect convergence)
Profile interpretation
Use an unprofiled steady window for the throughput acceptance result. Use a matched profile to explain the mechanism:
- Keep the dispatcher, routing, graph scopes, batch shape, parallel layout, and runtime fixed.
- Capture the same rank and steady iteration while toggling only plain EP overlap.
- Build interval unions for communication and compute kernels, then measure their intersection.
- Do not use summed kernel duration as wall time. Concurrent kernels can run longer under SM or bandwidth contention even when exposed time decreases.
- Corroborate interval results with dispatch/combine NVTX ranges, final step time, loss finiteness, skipped/NaN counts, and peak memory.
Code Anchors
Bridge overlap validation
if self.user_comm_overlap_cfg.overlap_moe_expert_parallel_comm is True:
assert model_cfg.expert_model_parallel_size > 1, ...
assert model_cfg.num_moe_experts > 1, ...
assert model_cfg.moe_token_dispatcher_type in ["alltoall", "flex"], ...
assert model_cfg.bf16 or model_cfg.fp16, ...
assert is_torch_min_version("2.6.0"), ...
# ... PP + VPP check, recompute checks, shared_expert_overlap check ...
Delayed wgrad validation
if self.user_comm_overlap_cfg.delay_wgrad_compute is True:
# TE version checks for overlap_grad_reduce and gradient_accumulation_fusion
# CUDA graph scope validations for delayed wgrad
assert overlap_moe_expert_parallel_comm, ...
Flex-dispatcher activation
def apply_flex_dispatcher_backend(...):
# GPU architecture check for DeepEP / HybridEP
model_config.moe_token_dispatcher_type = "flex"
model_config.moe_flex_dispatcher_backend = moe_flex_dispatcher_backend
model_config.moe_shared_expert_overlap = False
Perf harness override
def _set_moe_a2a_overlap_overrides(recipe, moe_a2a_overlap=False):
if moe_a2a_overlap:
recipe.comm_overlap.overlap_moe_expert_parallel_comm = True
recipe.comm_overlap.delay_wgrad_compute = True
recipe.model.moe_shared_expert_overlap = False
Tests
| File | Coverage |
|---|---|
tests/unit_tests/training/test_comm_overlap.py | EP overlap validation, delayed wgrad, CUDA graph + wgrad interaction |
tests/unit_tests/training/test_deepep.py | DeepEP/HybridEP helper activation and GPU gating |
Failure Diagnosis
| Symptom | Likely Cause | How To Confirm | Fix |
|---|---|---|---|
assert expert_model_parallel_size > 1 | EP not configured | Check expert_model_parallel_size | Set EP > 1 |
assert moe_token_dispatcher_type | Wrong dispatcher | Check dispatcher type | Use "alltoall" or "flex" |
| assert on BF16/FP16 | Wrong precision | Check bf16 and fp16 | Set bf16 = True |
| hang during training | PyTorch < 2.6 | Check PyTorch version | Upgrade to >= 2.6.0 |
assert virtual_pipeline_model_parallel_size | PP > 1 without VPP | Check PP and VPP config | Set VPP when PP > 1 |
assert recompute_granularity | Full recompute enabled | Check recompute settings | Disable full recompute |
assert overlap_moe_expert_parallel_comm required | delayed wgrad without EP overlap | Check delay_wgrad_compute without overlap | Enable EP overlap first |
assert gradient_accumulation_fusion | CUDA graph + delayed wgrad | Check graph scope + wgrad settings | Enable gradient_accumulation_fusion |
| assert on attention bias | CUDA graph attn + delayed wgrad + bias | Check add_bias_linear / add_qkv_bias | Disable attention bias |
| no throughput gain from flex dispatcher | apply_flex_dispatcher_backend not called | Check moe_token_dispatcher_type in logs | Call apply_flex_dispatcher_backend(...) |
| DeepEP/HybridEP silently skipped | Unsupported GPU | Check warning logs | Run on Ampere/Hopper/Blackwell |
| summed kernel time increases after overlap | Expected concurrency contention or a regression | Compare interval unions, comm/compute intersection, and unprofiled step time | Judge overlap from exposed wall time, not summed per-stream duration |
Known Limitations
- Setting
moe_flex_dispatcher_backendalone does not activate flex dispatch — you must callapply_flex_dispatcher_backend(...). - Public recipes are often conservative and leave MoE overlap disabled by default.
- Controlled end-to-end and profile evidence exists for one Qwen3 30B-A3B HybridEP H100 shape; repeat the matched A/B before generalizing it to another model, dispatcher, topology, precision, or batch shape.
- MoE overlap and shared-expert overlap are mutually exclusive.
- CUDA graph plus delayed wgrad is a multi-constraint path that requires careful TE version and scope validation.
Last signature refresh: 2026-08-03.
Frequently asked questions
What to verify before installation and use
What does the nemo-mbridge-perf-expert-parallel-overlap source document cover?
Validate and use MoE expert-parallel communication overlap in Megatron-Bridge, including overlap_moe_expert_parallel_comm, delay_wgrad_compute, and flex dispatcher backends such as DeepEP and HybridEP.
How do I install nemo-mbridge-perf-expert-parallel-overlap?
The source record exposes this install command: npx skills add https://github.com/NVIDIA/skills --skill "skills/nemo-mbridge-perf-expert-parallel-overlap". Inspect the command and pinned source before running it.
Alternatives
Compare before choosing
coreyhaines31/marketingskills
ab-testing
When the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program
garrytan/gbrain
bulk-ingestion
End-to-end discipline for turning any large data source (audio libraries, email takeouts, document corpora, chat exports, API dumps) into brain pages at scale. The lifecycle spine: SCHEMA → ACCESS → TRIAL → EVALUATE → IMPROVE → CODIFY → TEST → SKILLIFY → BULK → MONITOR. State is tracked in a durable JSON manifest (see MANIFEST-PATTERN.md) so any crash, session boundary, or subagent fan-out resumes from ground truth instead of memory.
alirezarezvani/claude-skills
app-store-optimization
App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklist
dotnet/skills
migrate-vstest-to-mtp
Migrates .NET test projects from VSTest to Microsoft.Testing.Platform (MTP). Use when user asks to "migrate to MTP", "switch from VSTest", "enable Microsoft.Testing.Platform", "use MTP runner", set OutputType=Exe only for test projects in Directory.Build.props, or mentions EnableMSTestRunner, EnableNUnitRunner, or UseMicrosoftTestingPlatformRunner. USE FOR: MTP behavioral differences vs VSTest (exit code 8, zero tests discovered, --ignore-exit-code, TESTINGPLATFORM_EXITCODE_IGNORE); centralizing