Draft
[WIP]feat(moonep): 支持 MoonEP Forward/Backward overlap #8
&NewgateAdd on 15 days ago
[WIP]feat(moonep): 支持 MoonEP Forward/Backward overlap #8
Draft
Merge blocked
15 days ago Added label: featfixdocsstylerefactor
21 event messages are collapsed here。 See more
&Newgate
4 days ago Comments:
4 days ago Comments:
compile


3 days ago Modify description of pull request
3 days ago Modify description of pull request
3 days ago Modify description of pull request
2 days ago Force-pushed 27 commits:af3d28f9-Simplify MoonEP FB setup and reuse synchronous bindings,2414a611-Move MoonEP FB Buffer lifecycle into session,360ffda4-Restore shared VPP behavior and localize MoonEP adapters,0d2e5484-Merge refactor/moonep-runtime-coordination into integrate/pr4146-fb-overlap,b4edc351-refactor(moonep): localize norm guards and restore shared FB behavior,a3f55900-refactor(fb): restore upstream norm recompute flags,e9e01354-refactor(moonep): restrict FB recompute to fixed layer policies,deebf0e7-refactor(fb): preserve the original warmup increment placement,177c2767-refactor(moonep): make joint FB feature validation explicit,439cebff-test(moonep): verify FB replay input consumption behavior,c6e5a2bf-fix(moonep): guard optional Bridge and trim FB host overhead,50be6172-refactor(moonep): unify FB module and execution naming,8aa6a224-fix(moe): avoid duplicate MoonEP FB lifecycle wrapping,d09507f8-fix(moe): detach MoonEP FB native math operands,816756fd-fix(moonep): manage FB native compute segments and paired receipts,37a6505b-Merge runtime coordination updates into MoonEP FB overlap,7a2b9fe6-refactor(moonep): simplify FB resource manifest,48a8e6cb-feat(moonep): support custom pipeline layouts in FB overlap,13398ab6-fix(moonep): shorten FB activation lifetimes,d8f1683c-perf(moonep): defer FB release at last consumer,1a5b9e39-Merge MoonEP runtime coordination into FB overlap,bfd08167-Merge MoonEP FB last-consumer release fixes,25eaafcc-perf(moonep): enable last-consumer FB release by default,d247f18d-refactor(moonep): drop FB debug controls and trim tests,3f9958a9-Merge MoonEP target license headers into FB overlap,3a0d6ee7-docs(moonep): add license headers to FB overlap files,b8e974c6-test(moonep): preserve FB schedule context in overlap UT
2 days ago Force-pushed 27 commits:af3d28f9-Simplify MoonEP FB setup and reuse synchronous bindings,2414a611-Move MoonEP FB Buffer lifecycle into session,360ffda4-Restore shared VPP behavior and localize MoonEP adapters,0d2e5484-Merge refactor/moonep-runtime-coordination into integrate/pr4146-fb-overlap,b4edc351-refactor(moonep): localize norm guards and restore shared FB behavior,a3f55900-refactor(fb): restore upstream norm recompute flags,e9e01354-refactor(moonep): restrict FB recompute to fixed layer policies,deebf0e7-refactor(fb): preserve the original warmup increment placement,177c2767-refactor(moonep): make joint FB feature validation explicit,439cebff-test(moonep): verify FB replay input consumption behavior,c6e5a2bf-fix(moonep): guard optional Bridge and trim FB host overhead,50be6172-refactor(moonep): unify FB module and execution naming,8aa6a224-fix(moe): avoid duplicate MoonEP FB lifecycle wrapping,d09507f8-fix(moe): detach MoonEP FB native math operands,816756fd-fix(moonep): manage FB native compute segments and paired receipts,37a6505b-Merge runtime coordination updates into MoonEP FB overlap,7a2b9fe6-refactor(moonep): simplify FB resource manifest,48a8e6cb-feat(moonep): support custom pipeline layouts in FB overlap,13398ab6-fix(moonep): shorten FB activation lifetimes,d8f1683c-perf(moonep): defer FB release at last consumer,1a5b9e39-Merge MoonEP runtime coordination into FB overlap,bfd08167-Merge MoonEP FB last-consumer release fixes,25eaafcc-perf(moonep): enable last-consumer FB release by default,d247f18d-refactor(moonep): drop FB debug controls and trim tests,3f9958a9-Merge MoonEP target license headers into FB overlap,3a0d6ee7-docs(moonep): add license headers to FB overlap files,b8e974c6-test(moonep): preserve FB schedule context in overlap UT
&Newgate
2 days ago Comments:
2 days ago Comments:
/check-cla


2 days ago Force-pushed 37 commits:5487f145-Integrate FB Overlap with PR4146 v10 MoonEP adapter,bcf9f987-Batch MoonEP release waits at the Q0 tail,19336f45-Simplify MoonEP FB lifecycle and admission,ce046074-Guard FB rollback and remove validation residue,f3674ea5-Simplify FB teardown and remove redundant computation wrappers,bdfda145-Simplify MoonEP FB entry state and restore eager imports,2b815076-Localize Dense identity and consolidate joint feature registration,751a1531-Reuse native call sessions and admitted forward state,7839abb7-Reuse generation keys within manifest advancement,5cd99a23-Align MoonEP FB wgrad with standard AddV2,5ec25c13-Simplify MoonEP FB setup and reuse synchronous bindings,4db66ff9-Move MoonEP FB Buffer lifecycle into session,33b06933-Restore shared VPP behavior and localize MoonEP adapters,0bd9bbc7-Merge refactor/moonep-runtime-coordination into integrate/pr4146-fb-overlap,d4a859b5-refactor(moonep): localize norm guards and restore shared FB behavior,966d8932-refactor(fb): restore upstream norm recompute flags,7fa76a6f-refactor(moonep): restrict FB recompute to fixed layer policies,e9d7fa89-refactor(fb): preserve the original warmup increment placement,ac42ccb3-refactor(moonep): make joint FB feature validation explicit,3ff4a832-test(moonep): verify FB replay input consumption behavior,ca6af27d-fix(moonep): guard optional Bridge and trim FB host overhead,7f2cb0e0-refactor(moonep): unify FB module and execution naming,de1d94be-fix(moe): avoid duplicate MoonEP FB lifecycle wrapping,5df06299-fix(moe): detach MoonEP FB native math operands,c44239ee-fix(moonep): manage FB native compute segments and paired receipts,aa8265e8-Merge runtime coordination updates into MoonEP FB overlap,58372983-refactor(moonep): simplify FB resource manifest,b5ef65a1-feat(moonep): support custom pipeline layouts in FB overlap,6ba6c534-fix(moonep): shorten FB activation lifetimes,cde55a58-perf(moonep): defer FB release at last consumer,fb3420d6-Merge MoonEP runtime coordination into FB overlap,76615ce1-Merge MoonEP FB last-consumer release fixes,41c0e01c-perf(moonep): enable last-consumer FB release by default,daa065ba-refactor(moonep): drop FB debug controls and trim tests,504522b0-Merge MoonEP target license headers into FB overlap,a7643071-docs(moonep): add license headers to FB overlap files,2998acd0-test(moonep): preserve FB schedule context in overlap UT
2 days ago Force-pushed 37 commits:5487f145-Integrate FB Overlap with PR4146 v10 MoonEP adapter,bcf9f987-Batch MoonEP release waits at the Q0 tail,19336f45-Simplify MoonEP FB lifecycle and admission,ce046074-Guard FB rollback and remove validation residue,f3674ea5-Simplify FB teardown and remove redundant computation wrappers,bdfda145-Simplify MoonEP FB entry state and restore eager imports,2b815076-Localize Dense identity and consolidate joint feature registration,751a1531-Reuse native call sessions and admitted forward state,7839abb7-Reuse generation keys within manifest advancement,5cd99a23-Align MoonEP FB wgrad with standard AddV2,5ec25c13-Simplify MoonEP FB setup and reuse synchronous bindings,4db66ff9-Move MoonEP FB Buffer lifecycle into session,33b06933-Restore shared VPP behavior and localize MoonEP adapters,0bd9bbc7-Merge refactor/moonep-runtime-coordination into integrate/pr4146-fb-overlap,d4a859b5-refactor(moonep): localize norm guards and restore shared FB behavior,966d8932-refactor(fb): restore upstream norm recompute flags,7fa76a6f-refactor(moonep): restrict FB recompute to fixed layer policies,e9d7fa89-refactor(fb): preserve the original warmup increment placement,ac42ccb3-refactor(moonep): make joint FB feature validation explicit,3ff4a832-test(moonep): verify FB replay input consumption behavior,ca6af27d-fix(moonep): guard optional Bridge and trim FB host overhead,7f2cb0e0-refactor(moonep): unify FB module and execution naming,de1d94be-fix(moe): avoid duplicate MoonEP FB lifecycle wrapping,5df06299-fix(moe): detach MoonEP FB native math operands,c44239ee-fix(moonep): manage FB native compute segments and paired receipts,aa8265e8-Merge runtime coordination updates into MoonEP FB overlap,58372983-refactor(moonep): simplify FB resource manifest,b5ef65a1-feat(moonep): support custom pipeline layouts in FB overlap,6ba6c534-fix(moonep): shorten FB activation lifetimes,cde55a58-perf(moonep): defer FB release at last consumer,fb3420d6-Merge MoonEP runtime coordination into FB overlap,76615ce1-Merge MoonEP FB last-consumer release fixes,41c0e01c-perf(moonep): enable last-consumer FB release by default,daa065ba-refactor(moonep): drop FB debug controls and trim tests,504522b0-Merge MoonEP target license headers into FB overlap,a7643071-docs(moonep): add license headers to FB overlap files,2998acd0-test(moonep): preserve FB schedule context in overlap UT
2 days ago Pushed commit
What this PR does / why we need it?
为 MoonEP 接入 MindSpeed Forward/Backward overlap 调度,使专家通信、前后向计算和权重梯度计算能够按照配对执行计划重叠,减少通信等待。
主要改动:
moonep_fb_overlap模块,实现执行计划编译、前向、反向及前后向配对执行,并接入已有 FB 调度框架。Does this PR introduce any user-facing change?
是。在满足 MoonEP 配置要求的训练命令中,通过已有参数启用联合模式,无需新增 overlap 参数:
activation zero-copy 仍通过已有
--moonep-activation-zero-copy参数显式开启。当前主要配置要求:
uniform仅允许recompute_num_layers=1,block按配置选择重算层数;不支持按 microbatch 选择部分重计算。完整限制以联合 Feature 和 MoonEP 参数校验为准,不支持的组合在参数校验或初始化阶段拒绝。
原有 FB 使用说明位于
docs/zh/features/megatron_moe/megatron-moe-fb-overlap.md;本 PR 未新增专门的 MoonEP FB 用户文档。How was this patch tested?
本地检查和八卡 UT
2709a27c对目标分支2b975fc4的完整差异通过本地 pre-commit。YAML 和 JSON 无适用文件。tests_extend/unit_tests/features/moe/test_moonep_1f1b_overlap.py的 9 个 CPU 用例通过。Ascend 950 单机八卡的moe、mixed、uniform和updates四个用例全部通过。测试对比同步和 FB 两臂的前向输出、输入梯度、本地优化器分片梯度及更新后的参数,逐位检查使用rtol=0, atol=0。也检查 FB 配对次数、梯度分片覆盖及步尾 bank 释放。updates验证连续 3 次优化器更新。单机八卡 1000 步整网对照
2026 年 12 月 1 日完成混合传输长跑。两臂各完成 1000 次优化器更新、64,000 个样本。同步臂用 MoonEP
72674969,FB 臂用基于7201422e的精简版冻结源码,两臂均用 MoonEP providerb4127baa。FB 快照含当时的本地精简改动,补丁 SHA-256 前缀为1d78b0140d3b。1234和数据索引,分布式 AdamW,1000 步学习率配方mixedbarrier,FB 臂用aiv以
abs(sync - FB) / max(abs(sync), abs(FB))为 loss 相对差,1000/1000 步 ≤1%。中位差 0.1229%,P90 0.2809%,最大差 0.4260%(第 435 步)。两臂均无 NaN、无跳步。Grad norm 全部有限,最大绝对差 1.323(第 221 步)。步时包含窗口内的 GC 和慢步。Allocated 和 reserved 为 PyTorch NPU allocator 的八卡最大值,整卡 HBM 为
npu-smi采样的八卡最大值。原生 MoE FB overlap 的 50 步确定性精度对齐
对比 Ascend 主仓
core_r0.18.0的3c72f231与 PR 分支基于7201422e的冻结快照。两臂的原生 token 恢复均采用主仓6fea23f2的scatter_add_累加语义。两臂均使用原生alltoall和--moe-fb-overlap,开启--deterministic-mode和--npu-deterministic。同配方采用单机八卡、C4、两层 MoE、H6144 / S4096、E48 / Top8、EP8、MBS1 / GBS64,关闭 FlashAttention。