[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CSKYNM41XYCPAA8ZHX6B04":3,"skill-same:01M7CSKYNM41XYCPAA8ZHX6B04":72},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7CSKYNM41XYCPAA8ZHX6B04","nemo-mbridge-perf-expert-parallel-overlap",null,"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.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nemo-mbridge-perf-expert-parallel-overlap\ndescription: 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.\nlicense: Apache-2.0\nwhen_to_use: Enabling EP overlap to hide dispatch\u002Fcombine latency, or tracing a throughput regression to an EP overlap config change; 'overlap_moe_expert_parallel_comm', 'delay_wgrad_compute', 'flex dispatcher', 'DeepEP overlap', 'HybridEP overlap'.\n---\n\n# MoE Expert-Parallel Overlap Skill\n\n## References\n\n- Stable docs: @docs\u002Ftraining\u002Fcommunication-overlap.md\n- Structured metadata: @skills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fcard.yaml\n\n## What It Is\n\nExpert-parallel (EP) overlap hides the cost of token dispatch\u002Fcombine all-to-all\ncommunication by running it concurrently with expert FFN compute. Optionally,\ndelayed expert weight-gradient computation (`delay_wgrad_compute`) provides\nadditional overlap by deferring wgrad to overlap with the next layer's forward.\n\nBridge supports two dispatcher paths:\n\n| Dispatcher | Backend | When to use |\n|---|---|---|\n| `alltoall` | Standard MoE all-to-all | Default, broadest compatibility |\n| `flex` | DeepEP or HybridEP | Higher overlap on Ampere\u002FHopper\u002FBlackwell |\n\n## Quick Decision\n\nUse EP overlap when:\n\n- the model is MoE with `EP > 1`\n- expert dispatch\u002Fcombine communication is a meaningful part of step time\n- you have memory headroom and are tuning for throughput\n\nPrefer:\n\n- `alltoall` dispatcher for the first rollout (broader compatibility)\n- `flex` + DeepEP\u002FHybridEP when running on supported GPUs and seeking\n  additional gains\n\nAvoid EP overlap when:\n\n- full activation recompute is enabled\n- `moe_shared_expert_overlap` is enabled\n- the run is still being brought up for correctness\n- PyTorch \u003C 2.6.0\n\nExpected outcome:\n\n- if all-to-all dispatch is a clear profile bottleneck, overlap can produce a\n  modest to meaningful speedup\n- if the run is tiny, communication-light, or dominated by another wall, the\n  gain may be negligible\n\n## Correctness-First alltoall Benchmark\n\nFor the plain EP-overlap isolation benchmark, keep flex dispatch and delayed\nwgrad disabled. The measured shape was Qwen3 MoE 30B-A3B SFT on 16 H100 GPUs:\n`EP=16`, `alltoall`, BF16, global batch size 1024, CUDA graphs disabled,\n`moe_permute_fusion=false`, measured over iterations 3-8.\n\nUse these overrides for the plain-overlap case:\n\n```bash\n--cuda_graph_impl none \\\n--moe_flex_dispatcher_backend None \\\n--moe_a2a_overlap false \\\ncomm_overlap.overlap_moe_expert_parallel_comm=true \\\ncomm_overlap.delay_wgrad_compute=false \\\nmodel.moe_shared_expert_overlap=false\n```\n\nDo not use `--moe_a2a_overlap true` for this isolation test: the performance\nharness helper enables both `overlap_moe_expert_parallel_comm` and\n`delay_wgrad_compute`, so it does not isolate plain EP overlap.\n\nSteady-window timing from that benchmark:\n\n| Case | Steady mean | Relative |\n|---|---:|---:|\n| no EP overlap | 41.25s | 1.000x |\n| EP overlap | 31.31s | 1.317x |\n| EP overlap plus `delay_wgrad_compute` | 31.20s | 1.322x |\n\nThis is evidence for enabling plain EP overlap on this inter-node all-to-all\nshape. It does not show a meaningful independent win from delayed wgrad, and it\ndoes not validate fused MoE permutation because that path was disabled for the\nruntime stack.\n\n## Enablement\n\n### alltoall dispatcher\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = False\ncfg.model.moe_shared_expert_overlap = False\n\ncfg.model.expert_model_parallel_size = 8\ncfg.model.num_moe_experts = 64\ncfg.model.moe_token_dispatcher_type = \"alltoall\"\ncfg.model.bf16 = True\ncfg.model.fp16 = False\n```\n\nEnable `delay_wgrad_compute=True` only after the plain overlap path is known to\nwork and its extra compatibility constraints have been checked.\n\n### flex dispatcher (DeepEP or HybridEP)\n\n```python\nfrom megatron.bridge.training.flex_dispatcher_backend import apply_flex_dispatcher_backend\n\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = True\ncfg.model.moe_shared_expert_overlap = False\n\napply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend=\"deepep\")\n# or: apply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend=\"hybridep\")\n```\n\n## Compatibility And Constraints\n\n- `expert_model_parallel_size > 1`\n- `num_moe_experts > 1`\n- `moe_token_dispatcher_type` must be `\"alltoall\"` or `\"flex\"`\n- `moe_shared_expert_overlap = False`\n- Base precision is BF16 or FP16\n- PyTorch `>= 2.6.0`\n- If `PP > 1`, `virtual_pipeline_model_parallel_size` must be set\n- `recompute_granularity != \"full\"`, `recompute_method = None`,\n  `recompute_num_layers = None`\n- `mtp_num_layers` must be `None` or `1`\n- `delay_wgrad_compute` requires `overlap_moe_expert_parallel_comm` as a\n  prerequisite\n- `delay_wgrad_compute` with `overlap_grad_reduce` requires TE >= 2.7.0\n- `delay_wgrad_compute` with `gradient_accumulation_fusion` requires TE >= 2.7.0\n- CUDA graph `attn` scope + `delay_wgrad_compute` requires TE >= 2.12.0,\n  `gradient_accumulation_fusion = True`, and no attention bias\n- DeepEP: Ampere, Hopper, B200, B300 GPUs only\n- HybridEP: Ampere, Hopper, B200, B300, GB200\u002FGB300 with NVL72\n\n## Minimal Working Config\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = False\ncfg.model.expert_model_parallel_size = 4\ncfg.model.num_moe_experts = 64\ncfg.model.moe_token_dispatcher_type = \"alltoall\"\ncfg.model.moe_shared_expert_overlap = False\ncfg.model.bf16 = True\n```\n\nUse this as the correctness-first starting point. Add delayed wgrad, flex\ndispatch, and CUDA-graph interactions only after the plain overlap path is\nknown to work.\n\n## Minimal Runnable Command\n\nPerformance harness example inside a Slurm allocation. Keep the model,\nparallelism, dispatcher, and runtime fixed, and vary only the two overlap\noverrides:\n\n```bash\nuv run python scripts\u002Fperformance\u002Frun_script.py \\\n  -m qwen \\\n  -mr qwen3_30b_a3b \\\n  --task pretrain \\\n  -g h100 \\\n  -c bf16 \\\n  -ng 16 \\\n  -gn 8 \\\n  --max_steps 8 \\\n  --config_variant v1 \\\n  --cuda_graph_impl none \\\n  --moe_flex_dispatcher_backend None \\\n  --moe_a2a_overlap false \\\n  --tokenizer_type NullTokenizer \\\n  comm_overlap.overlap_moe_expert_parallel_comm=true \\\n  comm_overlap.delay_wgrad_compute=false \\\n  model.moe_shared_expert_overlap=false\n```\n\nDo not use `--moe_a2a_overlap true` when separating plain EP overlap from\ndelayed wgrad: the performance harness helper enables both\n`overlap_moe_expert_parallel_comm` and `delay_wgrad_compute`.\n\nUnit test verification:\n\n```bash\nuv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py -k \"moe\" \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py -q\n```\n\n## Verification\n\n### Unit tests\n\n```bash\nuv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py -q\n```\n\n### Log checks\n\nAfter a successful run with EP overlap:\n\n1. Confirm no assertion errors during `CommOverlapConfig` finalization\n2. Confirm `overlap_moe_expert_parallel_comm` appears as `True` in the logged\n   config\n3. If using flex dispatcher, confirm `moe_token_dispatcher_type = \"flex\"` and\n   the correct backend in logs\n\n### Success criteria\n\n- Config validation passes for the selected dispatcher and overlap settings\n- Training runs complete without hangs or assertion failures\n- Throughput improves or at least does not regress for the target workload\n- Loss trajectory matches baseline (overlap should not affect convergence)\n\n## Code Anchors\n\n### Bridge overlap validation\n\n```470:505:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py\nif self.user_comm_overlap_cfg.overlap_moe_expert_parallel_comm is True:\n    assert model_cfg.expert_model_parallel_size > 1, ...\n    assert model_cfg.num_moe_experts > 1, ...\n    assert model_cfg.moe_token_dispatcher_type in [\"alltoall\", \"flex\"], ...\n    assert model_cfg.bf16 or model_cfg.fp16, ...\n    assert is_torch_min_version(\"2.6.0\"), ...\n    # ... PP + VPP check, recompute checks, shared_expert_overlap check ...\n```\n\n### Delayed wgrad validation\n\n```507:557:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py\nif self.user_comm_overlap_cfg.delay_wgrad_compute is True:\n    # TE version checks for overlap_grad_reduce and gradient_accumulation_fusion\n    # CUDA graph scope validations for delayed wgrad\n    assert overlap_moe_expert_parallel_comm, ...\n```\n\n### Flex-dispatcher activation\n\n```27:72:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fflex_dispatcher_backend.py\ndef apply_flex_dispatcher_backend(...):\n    # GPU architecture check for DeepEP \u002F HybridEP\n    model_config.moe_token_dispatcher_type = \"flex\"\n    model_config.moe_flex_dispatcher_backend = moe_flex_dispatcher_backend\n    model_config.moe_shared_expert_overlap = False\n```\n\n### Perf harness override\n\n```149:156:scripts\u002Fperformance\u002Futils\u002Foverrides.py\ndef _set_moe_a2a_overlap_overrides(recipe, moe_a2a_overlap=False):\n    if moe_a2a_overlap:\n        recipe.comm_overlap.overlap_moe_expert_parallel_comm = True\n        recipe.comm_overlap.delay_wgrad_compute = True\n        recipe.model.moe_shared_expert_overlap = False\n```\n\n### Tests\n\n| File | Coverage |\n|---|---|\n| `tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py` | EP overlap validation, delayed wgrad, CUDA graph + wgrad interaction |\n| `tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py` | DeepEP\u002FHybridEP helper activation and GPU gating |\n\n## Failure Diagnosis\n\n| Symptom | Likely Cause | How To Confirm | Fix |\n|---|---|---|---|\n| assert `expert_model_parallel_size > 1` | EP not configured | Check `expert_model_parallel_size` | Set EP > 1 |\n| assert `moe_token_dispatcher_type` | Wrong dispatcher | Check dispatcher type | Use `\"alltoall\"` or `\"flex\"` |\n| assert on BF16\u002FFP16 | Wrong precision | Check `bf16` and `fp16` | Set `bf16 = True` |\n| hang during training | PyTorch \u003C 2.6 | Check PyTorch version | Upgrade to >= 2.6.0 |\n| assert `virtual_pipeline_model_parallel_size` | PP > 1 without VPP | Check PP and VPP config | Set VPP when PP > 1 |\n| assert `recompute_granularity` | Full recompute enabled | Check recompute settings | Disable full recompute |\n| assert `overlap_moe_expert_parallel_comm required` | delayed wgrad without EP overlap | Check `delay_wgrad_compute` without overlap | Enable EP overlap first |\n| assert `gradient_accumulation_fusion` | CUDA graph + delayed wgrad | Check graph scope + wgrad settings | Enable `gradient_accumulation_fusion` |\n| assert on attention bias | CUDA graph attn + delayed wgrad + bias | Check `add_bias_linear` \u002F `add_qkv_bias` | Disable attention bias |\n| no throughput gain from flex dispatcher | `apply_flex_dispatcher_backend` not called | Check `moe_token_dispatcher_type` in logs | Call `apply_flex_dispatcher_backend(...)` |\n| DeepEP\u002FHybridEP silently skipped | Unsupported GPU | Check warning logs | Run on Ampere\u002FHopper\u002FBlackwell |\n\n## Known Limitations\n\n- Setting `moe_flex_dispatcher_backend` alone does not activate flex dispatch —\n  you must call `apply_flex_dispatcher_backend(...)`.\n- Public recipes are often conservative and leave MoE overlap disabled by\n  default.\n- End-to-end throughput gains have not yet been measured in a controlled Bridge\n  experiment for every model family. Code validation is stronger than a single\n  universal performance claim.\n- MoE overlap and shared-expert overlap are mutually exclusive.\n- CUDA graph plus delayed wgrad is a multi-constraint path that requires\n  careful TE version and scope validation.\n","# MoE Expert-Parallel Overlap Skill\n\n## References\n\n- Stable docs: @docs\u002Ftraining\u002Fcommunication-overlap.md\n- Structured metadata: @skills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fcard.yaml\n\n## What It Is\n\nExpert-parallel (EP) overlap hides the cost of token dispatch\u002Fcombine all-to-all\ncommunication by running it concurrently with expert FFN compute. Optionally,\ndelayed expert weight-gradient computation (`delay_wgrad_compute`) provides\nadditional overlap by deferring wgrad to overlap with the next layer's forward.\n\nBridge supports two dispatcher paths:\n\n| Dispatcher | Backend | When to use |\n|---|---|---|\n| `alltoall` | Standard MoE all-to-all | Default, broadest compatibility |\n| `flex` | DeepEP or HybridEP | Higher overlap on Ampere\u002FHopper\u002FBlackwell |\n\n## Quick Decision\n\nUse EP overlap when:\n\n- the model is MoE with `EP > 1`\n- expert dispatch\u002Fcombine communication is a meaningful part of step time\n- you have memory headroom and are tuning for throughput\n\nPrefer:\n\n- `alltoall` dispatcher for the first rollout (broader compatibility)\n- `flex` + DeepEP\u002FHybridEP when running on supported GPUs and seeking\n  additional gains\n\nAvoid EP overlap when:\n\n- full activation recompute is enabled\n- `moe_shared_expert_overlap` is enabled\n- the run is still being brought up for correctness\n- PyTorch \u003C 2.6.0\n\nExpected outcome:\n\n- if all-to-all dispatch is a clear profile bottleneck, overlap can produce a\n  modest to meaningful speedup\n- if the run is tiny, communication-light, or dominated by another wall, the\n  gain may be negligible\n\n## Correctness-First alltoall Benchmark\n\nFor the plain EP-overlap isolation benchmark, keep flex dispatch and delayed\nwgrad disabled. The measured shape was Qwen3 MoE 30B-A3B SFT on 16 H100 GPUs:\n`EP=16`, `alltoall`, BF16, global batch size 1024, CUDA graphs disabled,\n`moe_permute_fusion=false`, measured over iterations 3-8.\n\nUse these overrides for the plain-overlap case:\n\n```bash\n--cuda_graph_impl none \\\n--moe_flex_dispatcher_backend None \\\n--moe_a2a_overlap false \\\ncomm_overlap.overlap_moe_expert_parallel_comm=true \\\ncomm_overlap.delay_wgrad_compute=false \\\nmodel.moe_shared_expert_overlap=false\n```\n\nDo not use `--moe_a2a_overlap true` for this isolation test: the performance\nharness helper enables both `overlap_moe_expert_parallel_comm` and\n`delay_wgrad_compute`, so it does not isolate plain EP overlap.\n\nSteady-window timing from that benchmark:\n\n| Case | Steady mean | Relative |\n|---|---:|---:|\n| no EP overlap | 41.25s | 1.000x |\n| EP overlap | 31.31s | 1.317x |\n| EP overlap plus `delay_wgrad_compute` | 31.20s | 1.322x |\n\nThis is evidence for enabling plain EP overlap on this inter-node all-to-all\nshape. It does not show a meaningful independent win from delayed wgrad, and it\ndoes not validate fused MoE permutation because that path was disabled for the\nruntime stack.\n\n## Enablement\n\n### alltoall dispatcher\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = False\ncfg.model.moe_shared_expert_overlap = False\n\ncfg.model.expert_model_parallel_size = 8\ncfg.model.num_moe_experts = 64\ncfg.model.moe_token_dispatcher_type = \"alltoall\"\ncfg.model.bf16 = True\ncfg.model.fp16 = False\n```\n\nEnable `delay_wgrad_compute=True` only after the plain overlap path is known to\nwork and its extra compatibility constraints have been checked.\n\n### flex dispatcher (DeepEP or HybridEP)\n\n```python\nfrom megatron.bridge.training.flex_dispatcher_backend import apply_flex_dispatcher_backend\n\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = True\ncfg.model.moe_shared_expert_overlap = False\n\napply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend=\"deepep\")\n# or: apply_flex_dispatcher_backend(cfg.model, moe_flex_dispatcher_backend=\"hybridep\")\n```\n\n## Compatibility And Constraints\n\n- `expert_model_parallel_size > 1`\n- `num_moe_experts > 1`\n- `moe_token_dispatcher_type` must be `\"alltoall\"` or `\"flex\"`\n- `moe_shared_expert_overlap = False`\n- Base precision is BF16 or FP16\n- PyTorch `>= 2.6.0`\n- If `PP > 1`, `virtual_pipeline_model_parallel_size` must be set\n- `recompute_granularity != \"full\"`, `recompute_method = None`,\n  `recompute_num_layers = None`\n- `mtp_num_layers` must be `None` or `1`\n- `delay_wgrad_compute` requires `overlap_moe_expert_parallel_comm` as a\n  prerequisite\n- `delay_wgrad_compute` with `overlap_grad_reduce` requires TE >= 2.7.0\n- `delay_wgrad_compute` with `gradient_accumulation_fusion` requires TE >= 2.7.0\n- CUDA graph `attn` scope + `delay_wgrad_compute` requires TE >= 2.12.0,\n  `gradient_accumulation_fusion = True`, and no attention bias\n- DeepEP: Ampere, Hopper, B200, B300 GPUs only\n- HybridEP: Ampere, Hopper, B200, B300, GB200\u002FGB300 with NVL72\n\n## Minimal Working Config\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\ncfg.comm_overlap.delay_wgrad_compute = False\ncfg.model.expert_model_parallel_size = 4\ncfg.model.num_moe_experts = 64\ncfg.model.moe_token_dispatcher_type = \"alltoall\"\ncfg.model.moe_shared_expert_overlap = False\ncfg.model.bf16 = True\n```\n\nUse this as the correctness-first starting point. Add delayed wgrad, flex\ndispatch, and CUDA-graph interactions only after the plain overlap path is\nknown to work.\n\n## Minimal Runnable Command\n\nPerformance harness example inside a Slurm allocation. Keep the model,\nparallelism, dispatcher, and runtime fixed, and vary only the two overlap\noverrides:\n\n```bash\nuv run python scripts\u002Fperformance\u002Frun_script.py \\\n  -m qwen \\\n  -mr qwen3_30b_a3b \\\n  --task pretrain \\\n  -g h100 \\\n  -c bf16 \\\n  -ng 16 \\\n  -gn 8 \\\n  --max_steps 8 \\\n  --config_variant v1 \\\n  --cuda_graph_impl none \\\n  --moe_flex_dispatcher_backend None \\\n  --moe_a2a_overlap false \\\n  --tokenizer_type NullTokenizer \\\n  comm_overlap.overlap_moe_expert_parallel_comm=true \\\n  comm_overlap.delay_wgrad_compute=false \\\n  model.moe_shared_expert_overlap=false\n```\n\nDo not use `--moe_a2a_overlap true` when separating plain EP overlap from\ndelayed wgrad: the performance harness helper enables both\n`overlap_moe_expert_parallel_comm` and `delay_wgrad_compute`.\n\nUnit test verification:\n\n```bash\nuv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py -k \"moe\" \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py -q\n```\n\n## Verification\n\n### Unit tests\n\n```bash\nuv run python -m pytest \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py \\\n  tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py -q\n```\n\n### Log checks\n\nAfter a successful run with EP overlap:\n\n1. Confirm no assertion errors during `CommOverlapConfig` finalization\n2. Confirm `overlap_moe_expert_parallel_comm` appears as `True` in the logged\n   config\n3. If using flex dispatcher, confirm `moe_token_dispatcher_type = \"flex\"` and\n   the correct backend in logs\n\n### Success criteria\n\n- Config validation passes for the selected dispatcher and overlap settings\n- Training runs complete without hangs or assertion failures\n- Throughput improves or at least does not regress for the target workload\n- Loss trajectory matches baseline (overlap should not affect convergence)\n\n## Code Anchors\n\n### Bridge overlap validation\n\n```470:505:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py\nif self.user_comm_overlap_cfg.overlap_moe_expert_parallel_comm is True:\n    assert model_cfg.expert_model_parallel_size > 1, ...\n    assert model_cfg.num_moe_experts > 1, ...\n    assert model_cfg.moe_token_dispatcher_type in [\"alltoall\", \"flex\"], ...\n    assert model_cfg.bf16 or model_cfg.fp16, ...\n    assert is_torch_min_version(\"2.6.0\"), ...\n    # ... PP + VPP check, recompute checks, shared_expert_overlap check ...\n```\n\n### Delayed wgrad validation\n\n```507:557:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py\nif self.user_comm_overlap_cfg.delay_wgrad_compute is True:\n    # TE version checks for overlap_grad_reduce and gradient_accumulation_fusion\n    # CUDA graph scope validations for delayed wgrad\n    assert overlap_moe_expert_parallel_comm, ...\n```\n\n### Flex-dispatcher activation\n\n```27:72:src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fflex_dispatcher_backend.py\ndef apply_flex_dispatcher_backend(...):\n    # GPU architecture check for DeepEP \u002F HybridEP\n    model_config.moe_token_dispatcher_type = \"flex\"\n    model_config.moe_flex_dispatcher_backend = moe_flex_dispatcher_backend\n    model_config.moe_shared_expert_overlap = False\n```\n\n### Perf harness override\n\n```149:156:scripts\u002Fperformance\u002Futils\u002Foverrides.py\ndef _set_moe_a2a_overlap_overrides(recipe, moe_a2a_overlap=False):\n    if moe_a2a_overlap:\n        recipe.comm_overlap.overlap_moe_expert_parallel_comm = True\n        recipe.comm_overlap.delay_wgrad_compute = True\n        recipe.model.moe_shared_expert_overlap = False\n```\n\n### Tests\n\n| File | Coverage |\n|---|---|\n| `tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py` | EP overlap validation, delayed wgrad, CUDA graph + wgrad interaction |\n| `tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py` | DeepEP\u002FHybridEP helper activation and GPU gating |\n\n## Failure Diagnosis\n\n| Symptom | Likely Cause | How To Confirm | Fix |\n|---|---|---|---|\n| assert `expert_model_parallel_size > 1` | EP not configured | Check `expert_model_parallel_size` | Set EP > 1 |\n| assert `moe_token_dispatcher_type` | Wrong dispatcher | Check dispatcher type | Use `\"alltoall\"` or `\"flex\"` |\n| assert on BF16\u002FFP16 | Wrong precision | Check `bf16` and `fp16` | Set `bf16 = True` |\n| hang during training | PyTorch \u003C 2.6 | Check PyTorch version | Upgrade to >= 2.6.0 |\n| assert `virtual_pipeline_model_parallel_size` | PP > 1 without VPP | Check PP and VPP config | Set VPP when PP > 1 |\n| assert `recompute_granularity` | Full recompute enabled | Check recompute settings | Disable full recompute |\n| assert `overlap_moe_expert_parallel_comm required` | delayed wgrad without EP overlap | Check `delay_wgrad_compute` without overlap | Enable EP overlap first |\n| assert `gradient_accumulation_fusion` | CUDA graph + delayed wgrad | Check graph scope + wgrad settings | Enable `gradient_accumulation_fusion` |\n| assert on attention bias | CUDA graph attn + delayed wgrad + bias | Check `add_bias_linear` \u002F `add_qkv_bias` | Disable attention bias |\n| no throughput gain from flex dispatcher | `apply_flex_dispatcher_backend` not called | Check `moe_token_dispatcher_type` in logs | Call `apply_flex_dispatcher_backend(...)` |\n| DeepEP\u002FHybridEP silently skipped | Unsupported GPU | Check warning logs | Run on Ampere\u002FHopper\u002FBlackwell |\n\n## Known Limitations\n\n- Setting `moe_flex_dispatcher_backend` alone does not activate flex dispatch —\n  you must call `apply_flex_dispatcher_backend(...)`.\n- Public recipes are often conservative and leave MoE overlap disabled by\n  default.\n- End-to-end throughput gains have not yet been measured in a controlled Bridge\n  experiment for every model family. Code validation is stronger than a single\n  universal performance claim.\n- MoE overlap and shared-expert overlap are mutually exclusive.\n- CUDA graph plus delayed wgrad is a multi-constraint path that requires\n  careful TE version and scope validation.\n",{"name":5,"license":15,"description":7,"when_to_use":24},"Enabling EP overlap to hide dispatch\u002Fcombine latency, or tracing a throughput regression to an EP overlap config change; 'overlap_moe_expert_parallel_comm', 'delay_wgrad_compute', 'flex dispatcher', 'DeepEP overlap', 'HybridEP overlap'.","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill nemo-mbridge-perf-expert-parallel-overlap",{"tool":40,"command":41},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill nemo-mbridge-perf-expert-parallel-overlap",{"tool":43,"command":44},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill nemo-mbridge-perf-expert-parallel-overlap","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002FSKILL.md",true,[48,54,58,62,66],{"path":49,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":52,"sourceHtmlUrl":53},"BENCHMARK.md","REFERENCE","参考文档",4411,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002FBENCHMARK.md",{"path":55,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":56,"sourceHtmlUrl":57},"card.yaml",7519,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fcard.yaml",{"path":59,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":60,"sourceHtmlUrl":61},"evals\u002Fevals.json",2093,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fevals\u002Fevals.json",{"path":63,"resourceType":50,"resourceTypeDesc":51,"sizeBytes":64,"sourceHtmlUrl":65},"skill-card.md",3937,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fskill-card.md",{"path":67,"resourceType":68,"resourceTypeDesc":69,"sizeBytes":70,"sourceHtmlUrl":71},"skill.oms.sig","OTHER","其他",4837,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-skills\u002Fskills\u002Fnemo-mbridge-perf-expert-parallel-overlap\u002Fskill.oms.sig",[73,81,88,95,102,109],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":89,"name":90,"nameZh":6,"description":91,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":101,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":103,"name":104,"nameZh":6,"description":105,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":106,"categories":107,"keywords":108,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":110,"name":111,"nameZh":6,"description":112,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":77,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":115,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]