[Performance Optimization] Support Muon sharding optimizer comm overlap#79428
[Performance Optimization] Support Muon sharding optimizer comm overlap#79428Hz188 wants to merge 1 commit into
Conversation
risemeup1111
left a comment
There was a problem hiding this comment.
发现两处需要先处理的兼容性问题,详情已放在行级评论里:主要是 Muon 的新 backward-hook overlap 路径缺少与 pipeline parallel 的互斥保护,以及 AMP GradScaler 仍按 _comm_buffers 等待 overlap 通信,当前 Muon 没有暴露这个集合。CI 目前仍有检查在运行中,建议修复后补充 Muon + comm_overlap 覆盖,尤其包含 GradScaler 场景。
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 47/48 通过
2 失败详情🔴 Coverage test — PR问题:Python Diff Coverage 未达标(置信度: 高)失败用例: Python Diff Coverage 门禁
关键日志:
PR 只修改了 新增路径包括 PP+ 修复建议:
关联变更: |
risemeup1111
left a comment
There was a problem hiding this comment.
复查了新提交:pipeline parallel 与 sharding comm_overlap 的互斥保护已经补上,这个问题看起来已解决。_comm_buffers 也已补充,但 AMP GradScaler 场景在 comm_group_call_opt=True 时仍可能跳过 2D Muon 梯度 reduce,我已在原有 scaler 线程里补充了新的证据和建议。
当前 CI 仍在运行中,尚未形成最终结果。
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (65.75%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #79428 +/- ##
==========================================
Coverage ? 65.75%
==========================================
Files ? 1
Lines ? 73
Branches ? 0
==========================================
Hits ? 48
Misses ? 25
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 44/48 通过
2 失败详情🔴 PR-CI-SOT / Build and Test — 环境问题(置信度: 高)分析器: 通用分析(fallback)
关键日志:
修复建议:
关联变更: 未发现与 PR 修改文件直接关联。 🔴 Windows-GPU / Build and test — 环境问题(置信度: 高)分析器: 通用分析(fallback)
关键日志:
修复建议:
关联变更: 未发现与 PR 修改文件直接关联。 🔴 Coverage test — PR问题(置信度: 高)分析器: 通用分析(fallback)
关键日志:
修复建议:
关联变更: 🔴 Slice / Slice test — 不稳定问题(置信度: 中)分析器: 通用分析(fallback)
关键日志:
修复建议:
关联变更: 未发现与 PR 修改文件直接关联。 |
risemeup1111
left a comment
There was a problem hiding this comment.
复查当前提交后,pipeline parallel 与 sharding comm_overlap 的互斥保护仍然有效,之前的 PP 相关 P1 已解决。
AMP GradScaler 相关 P1 还没有完全修复:当前提交新增的 sync-only/group-call 2D 通信仍依赖 reduce_gradients(),但 scaler 分支会跳过该路径。详情已补充在原有行级线程中,这个问题仍需要新的修复 commit。
当前 CI 还有检查未完成,且审批相关检查仍处于失败状态。
risemeup1111
left a comment
There was a problem hiding this comment.
复查新提交后,之前的 AMP GradScaler 相关 P1 仍未由代码修复,原行级线程继续作为该问题的讨论位置。
这次新增的测试文件里还发现一个会导致用例无法运行的新 P1,详情已放在行级评论中。当前仍需要修复 commit 后再复查;CI 也还有检查未完成。
risemeup1111
left a comment
There was a problem hiding this comment.
复查当前提交后,新增测试 helper 相关 P1 在代码上已经修复。
AMP GradScaler 相关 P1 仍未修复:scaler 路径仍只等待 _comm_buffers,而 sync-only buffers 和 use_group_call_opt=True 的 2D reduce 仍依赖 reduce_gradients()。我已在原行级线程补充当前 head 的证据;该问题仍需要新的修复 commit。
当前 CI 还有检查在运行中。
f5ef787 to
c02fde3
Compare
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-07-16 20:44:28
📋 Review 摘要
PR 概述:为 Muon sharding optimizer 增加 stage1 comm overlap,并让 shared no-hook color buffer 走同步 reduce 路径。
变更范围:python/paddle/distributed/fleet/meta_optimizers/muon_sharding_optimizer.py、新增单测。
影响面 Tag:Distributed Strategy Performance Optimization Communication Library
问题
| 级别 | 文件 | 概述 |
|---|---|---|
| 🔴 Bug | python/paddle/distributed/fleet/meta_optimizers/muon_sharding_optimizer.py:379 |
AMP loss scaling 会跳过 no-hook shared buffer 的通信 |
历史 Findings 修复情况
| Finding | 问题 | 状态 |
|---|---|---|
| F1 | use_group_call_opt 下 2D comm buffer 仍不在 _comm_buffers 中 |
|
| F2 | 新增测试文件仍保留 if __name__ == "__main__" 入口 |
📝 PR 规范检查
标题缺少 Paddle PR 模板要求的 [Tag];描述结构和精度变化字段符合规范。
标题建议(可直接复制):
[Performance Optimization] Support Muon sharding optimizer comm overlap
总体评价
当前 no-hook shared buffer 的普通 reduce_gradients() 路径有同步 reduce,但 AMP scaler 的 overlap 分支会绕过该路径,因此存在梯度通信丢失风险;建议先修复再合入。
15d6fbb to
3450bb0
Compare
|
/re-run all-failed |
add non_overlap buffer for share weight to avoid hook bug add test
risemeup1111
left a comment
There was a problem hiding this comment.
复查当前提交,之前的 pipeline parallel 互斥保护和测试 helper 问题在代码上已解决。
GradScaler 相关 P1 仍没有修复;本次测试改动只改为检查 _overlap_comm_buffers,还没有覆盖 fleet.distributed_scaler() 的实际路径。具体处理要求已放在行级评论里,请修复后再 push 新 commit 复查。
|
/re-run all-failed |
|
覆盖率统计问题 |
|
/re-run all-failed |


PR Category
Performance Optimization
PR Types
New features
Description
开发muon支持stage1 overlap的功能
是否引起精度变化
否