[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7A9JEVTWT8RFS1WSA0QQ3V4":3,"skill-same:01M7A9JEVTWT8RFS1WSA0QQ3V4":73},{"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":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7A9JEVTWT8RFS1WSA0QQ3V4","nemo-mbridge-perf-moe-comm-overlap",null,"MoE expert-parallel communication overlap in Megatron Bridge. Covers dispatch\u002Fcombine overlap, flex dispatcher backends, and expert wgrad scheduling.","themusebook\u002Fskills","themusebook","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F349927247?v=4","01M7A5C1RV5S3V5FF6ZACVDNRN","musebook","01M7A5C1SFC3KRZAXNN60XJ7KM",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: nemo-mbridge-perf-moe-comm-overlap\ndescription: MoE expert-parallel communication overlap in Megatron Bridge. Covers dispatch\u002Fcombine overlap, flex dispatcher backends, and expert wgrad scheduling.\nlicense: Apache-2.0\nwhen_to_use: Tuning MoE communication overlap, or tracing a MoE throughput regression to a comm-overlap config change; 'overlap_moe_expert_parallel_comm', 'MoE dispatch overlap', 'flex dispatcher', 'DeepEP overlap', 'expert wgrad scheduling'.\n---\n\n# MoE Communication Overlap\n\nFor the higher-level overview, see:\n\n- @docs\u002Ftraining\u002Fcommunication-overlap.md\n- @skills\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fcard.yaml\n\n## Quick Decision\n\nUse MoE communication overlap when:\n\n- `EP > 1`\n- token dispatch or combine time is visible in the profile\n- the run is already correct and you are now tuning throughput\n\nAvoid turning it on as an early bring-up step. It is easier to validate after\nthe dispatcher, routing mode, and recompute plan are already stable.\n\n## Enablement\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\n\n# Optional: delayed wgrad for additional overlap\ncfg.comm_overlap.delay_wgrad_compute = True\n\n# IMPORTANT: disable shared expert overlap when using dispatch overlap\ncfg.model.moe_shared_expert_overlap = False\n```\n\n### Prerequisites\n\n- `expert_model_parallel_size > 1`\n- `num_moe_experts > 1`\n- `moe_token_dispatcher_type` must be `\"alltoall\"` or `\"flex\"`\n- Precision: BF16 or FP16\n- If PP is used, VPP (`virtual_pipeline_model_parallel_size`) must be set (non-`None`)\n\n### Flex dispatcher activation\n\nSetting `moe_flex_dispatcher_backend` alone does **not** activate flex dispatch.\nYou must also set `moe_token_dispatcher_type = \"flex\"`.\n\n## Recompute And CUDA Graph Interaction\n\n- Full recompute is not a good companion for the overlap path.\n- `delay_wgrad_compute` adds further constraints if CUDA-graph scopes include\n  attention or MoE-router work.\n- In practice, selective recompute is the safer pairing when overlap is enabled.\n\n## Measured Short-Run Caveat\n\nA 2026-05-18 current-main H100 x16 smoke on Qwen3 30B-A3B mock pretraining\nused `EP=16`, `alltoall`, global batch size 1024, CUDA graphs disabled, and\n`moe_permute_fusion=false` because the PyTorch 25.11 \u002F TE \u002F Triton stack failed\nin Transformer Engine fused permutation in prior bring-up.\n\nResults were directional rather than release-grade:\n\n- no EP overlap: 41.25s steady-state mean over iterations 3-8\n- EP overlap: 31.31s steady-state mean over iterations 3-8\n- EP overlap plus `delay_wgrad_compute`: 31.20s steady-state mean over\n  iterations 3-8\n\nTreat this as evidence that EP overlap can help an inter-node `alltoall` MoE\nshape when communication is exposed. It is not proof that delayed wgrad is a\nseparate win, and it does not validate the fused permutation path. An earlier\n2026-05-16 short smoke on the same shape showed the same pattern.\n\n## Code Anchors\n\n- Overlap validation: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py`\n- Flex dispatcher backend: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fflex_dispatcher_backend.py`\n- Config: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py`\n- Unit tests: `tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py`\n- DeepEP tests: `tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py`\n\n## Pitfalls\n\n1. **Shared expert overlap conflict**: `moe_shared_expert_overlap` and\n   `overlap_moe_expert_parallel_comm` can conflict. Disable shared expert\n   overlap when using the dispatch overlap path.\n\n2. **PP without VPP**: MoE overlap requires VPP when pipeline parallelism is\n   active. Without it, the overlap scheduling cannot interleave correctly.\n\n3. **Flex != backend flag**: `moe_flex_dispatcher_backend=\"deepep\"` alone\n   does nothing if `moe_token_dispatcher_type` is still `\"alltoall\"`.\n\n4. **Conservative recipe defaults**: Most public recipes leave MoE overlap\n   disabled. You need to explicitly enable it via overrides.\n\n5. **Performance gains are workload-dependent**: overlap helps most when dispatch\n   communication is already a visible slice of step time. It is not guaranteed\n   to help every small or lightly loaded EP run.\n\n## Verification\n\nLook for overlap-related log messages during initialization. The comm overlap\nvalidation in `comm_overlap.py` will raise if prerequisites are not met, so a\nclean startup confirms the feature is active.\n\nFor a short performance-harness smoke, keep the command shape explicit and vary\nonly one overlap knob at a time:\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  --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\nIf fused MoE permutation fails during bring-up, add\n`model.moe_permute_fusion=false` to separate overlap timing from runtime-stack\nvalidation, then retest with the matched production container.\n","# MoE Communication Overlap\n\nFor the higher-level overview, see:\n\n- @docs\u002Ftraining\u002Fcommunication-overlap.md\n- @skills\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fcard.yaml\n\n## Quick Decision\n\nUse MoE communication overlap when:\n\n- `EP > 1`\n- token dispatch or combine time is visible in the profile\n- the run is already correct and you are now tuning throughput\n\nAvoid turning it on as an early bring-up step. It is easier to validate after\nthe dispatcher, routing mode, and recompute plan are already stable.\n\n## Enablement\n\n```python\ncfg.comm_overlap.overlap_moe_expert_parallel_comm = True\n\n# Optional: delayed wgrad for additional overlap\ncfg.comm_overlap.delay_wgrad_compute = True\n\n# IMPORTANT: disable shared expert overlap when using dispatch overlap\ncfg.model.moe_shared_expert_overlap = False\n```\n\n### Prerequisites\n\n- `expert_model_parallel_size > 1`\n- `num_moe_experts > 1`\n- `moe_token_dispatcher_type` must be `\"alltoall\"` or `\"flex\"`\n- Precision: BF16 or FP16\n- If PP is used, VPP (`virtual_pipeline_model_parallel_size`) must be set (non-`None`)\n\n### Flex dispatcher activation\n\nSetting `moe_flex_dispatcher_backend` alone does **not** activate flex dispatch.\nYou must also set `moe_token_dispatcher_type = \"flex\"`.\n\n## Recompute And CUDA Graph Interaction\n\n- Full recompute is not a good companion for the overlap path.\n- `delay_wgrad_compute` adds further constraints if CUDA-graph scopes include\n  attention or MoE-router work.\n- In practice, selective recompute is the safer pairing when overlap is enabled.\n\n## Measured Short-Run Caveat\n\nA 2026-05-18 current-main H100 x16 smoke on Qwen3 30B-A3B mock pretraining\nused `EP=16`, `alltoall`, global batch size 1024, CUDA graphs disabled, and\n`moe_permute_fusion=false` because the PyTorch 25.11 \u002F TE \u002F Triton stack failed\nin Transformer Engine fused permutation in prior bring-up.\n\nResults were directional rather than release-grade:\n\n- no EP overlap: 41.25s steady-state mean over iterations 3-8\n- EP overlap: 31.31s steady-state mean over iterations 3-8\n- EP overlap plus `delay_wgrad_compute`: 31.20s steady-state mean over\n  iterations 3-8\n\nTreat this as evidence that EP overlap can help an inter-node `alltoall` MoE\nshape when communication is exposed. It is not proof that delayed wgrad is a\nseparate win, and it does not validate the fused permutation path. An earlier\n2026-05-16 short smoke on the same shape showed the same pattern.\n\n## Code Anchors\n\n- Overlap validation: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fcomm_overlap.py`\n- Flex dispatcher backend: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fflex_dispatcher_backend.py`\n- Config: `src\u002Fmegatron\u002Fbridge\u002Ftraining\u002Fconfig.py`\n- Unit tests: `tests\u002Funit_tests\u002Ftraining\u002Ftest_comm_overlap.py`\n- DeepEP tests: `tests\u002Funit_tests\u002Ftraining\u002Ftest_deepep.py`\n\n## Pitfalls\n\n1. **Shared expert overlap conflict**: `moe_shared_expert_overlap` and\n   `overlap_moe_expert_parallel_comm` can conflict. Disable shared expert\n   overlap when using the dispatch overlap path.\n\n2. **PP without VPP**: MoE overlap requires VPP when pipeline parallelism is\n   active. Without it, the overlap scheduling cannot interleave correctly.\n\n3. **Flex != backend flag**: `moe_flex_dispatcher_backend=\"deepep\"` alone\n   does nothing if `moe_token_dispatcher_type` is still `\"alltoall\"`.\n\n4. **Conservative recipe defaults**: Most public recipes leave MoE overlap\n   disabled. You need to explicitly enable it via overrides.\n\n5. **Performance gains are workload-dependent**: overlap helps most when dispatch\n   communication is already a visible slice of step time. It is not guaranteed\n   to help every small or lightly loaded EP run.\n\n## Verification\n\nLook for overlap-related log messages during initialization. The comm overlap\nvalidation in `comm_overlap.py` will raise if prerequisites are not met, so a\nclean startup confirms the feature is active.\n\nFor a short performance-harness smoke, keep the command shape explicit and vary\nonly one overlap knob at a time:\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  --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\nIf fused MoE permutation fails during bring-up, add\n`model.moe_permute_fusion=false` to separate overlap timing from runtime-stack\nvalidation, then retest with the matched production container.\n",{"name":5,"license":15,"description":7,"when_to_use":24},"Tuning MoE communication overlap, or tracing a MoE throughput regression to a comm-overlap config change; 'overlap_moe_expert_parallel_comm', 'MoE dispatch overlap', 'flex dispatcher', 'DeepEP overlap', 'expert wgrad scheduling'.","main","1c523aba5cdf867a79f078847075492d7778092a","skills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap",1,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills","https:\u002F\u002Fskills.x402.wtf","https:\u002F\u002Fgithub.com\u002Fthemusebook","https:\u002F\u002Fmusebook.trade","The official Github of musebook","2026-11-02 23:42:26",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add themusebook\u002Fskills --skill nemo-mbridge-perf-moe-comm-overlap",{"tool":41,"command":42},"bunx","bunx skills add themusebook\u002Fskills --skill nemo-mbridge-perf-moe-comm-overlap",{"tool":44,"command":45},"pnpm","pnpm dlx skills add themusebook\u002Fskills --skill nemo-mbridge-perf-moe-comm-overlap","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002FSKILL.md",true,[49,55,59,63,67],{"path":50,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":53,"sourceHtmlUrl":54},"BENCHMARK.md","REFERENCE","参考文档",4014,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002FBENCHMARK.md",{"path":56,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":57,"sourceHtmlUrl":58},"card.yaml",2075,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fcard.yaml",{"path":60,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":61,"sourceHtmlUrl":62},"evals\u002Fevals.json",1678,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fevals\u002Fevals.json",{"path":64,"resourceType":51,"resourceTypeDesc":52,"sizeBytes":65,"sourceHtmlUrl":66},"skill-card.md",4140,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fskill-card.md",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"skill.oms.sig","OTHER","其他",4829,"https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fnvidia\u002Fnemo-mbridge-perf-moe-comm-overlap\u002Fskill.oms.sig",[74,83,90,97,104,111],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":79,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M7AB34SPKVSDRRG009PM1CZH","youtube-clipper","YouTube 视频智能剪辑工具。下载视频和字幕，AI 分析生成精细章节（几分钟级别）， 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频，并生成总结文案。 使用场景：当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词：视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video","MIT","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fyoutube-clipper\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M7AB18BH6N7KR7939HRNWVMQ","viem-integration","Integrate EVM blockchains using viem. Use when user says \"read blockchain data\", \"send transaction\", \"interact with smart contract\", \"connect to Ethereum\", \"use viem\", \"use wagmi\", \"wallet integration\", \"viem setup\", or mentions blockchain\u002FEVM development with TypeScript.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fviem-integration\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7AB12GHGP48WCNXDQQ9222H","v4-security-foundations","Security-first Uniswap v4 hook development. Use when user mentions \"v4 hooks\", \"hook security\", \"PoolManager\", \"beforeSwap\", \"afterSwap\", or asks about V4 hook best practices, vulnerabilities, or audit requirements.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-security-foundations\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M7AB0XM3PSR7V3Q2ZRR0Q0FB","v4-sdk-integration","App-layer SDK guide for building swap and liquidity experiences directly with the Uniswap v4 SDK. Use when user asks about \"v4 sdk\", \"uniswap v4\", \"v4 swap\", \"v4 liquidity\", \"PoolManager\", \"V4Planner\", \"StateView\", \"PositionManager\", \"pool state\", \"v4 position\", \"uniswap sdk\", or when building swap\u002Fliquidity UX directly with SDKs rather than via the Trading API.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-sdk-integration\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":19},"01M7AB0SGA93ASA588DJW4P9WT","v4-hook-generator","Generate Uniswap v4 hook contracts via OpenZeppelin MCP. Use when building custom swap logic, async swaps, hook-owned liquidity, custom curves, dynamic fees, MEV protection, limit orders, or oracle hooks.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fv4-hook-generator\u002FSKILL.md",[],[],{"skillNo":112,"name":113,"nameZh":6,"description":114,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":78,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":19},"01M7AAZYH75H4CS03WSW2EZ8DM","testing","For testing with Light Protocol programs and clients on localnet, devnet, and mainnet validation.","https:\u002F\u002Fgithub.com\u002Fthemusebook\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002FSKILL.md",[],[]]