[Performance] support muon comm opt with ep >8#79448
Conversation
risemeup1111
left a comment
There was a problem hiding this comment.
发现了两个会影响 comm_group_call_opt 正确性的阻塞问题,具体证据和建议已放在行级评论中。请优先修复通信组构造相关问题后再继续评估。
| assert ( | ||
| ep_degree >= 8 and moe_sharding_degree > 1 and tp_degree == 1 | ||
| ), ( | ||
| "comm_group_call_opt should be enabled when ep_degree is larger then 8 and moe_sharding_degree is larger then 1" | ||
| ) |
There was a problem hiding this comment.
问题: 这里放宽成 ep_degree >= 8 后,ep_degree=12 这类不是 8 的倍数的配置也会通过,但下面新建 trainer_same_card_comms 时使用 range(expert_parallel_degree // 8),并且通信时用 card_idx = rank % 8。这些 rank 中超过 floor(ep/8)*8 的 EP rank 不会被加入任何 same-card group,后续 _coalescing_manager(trainer_same_card_group, ...) 会在非成员 group 上执行,容易直接报错或卡住。
影响: comm_group_call_opt 声明支持 ep > 8,但当前实际只支持每 8 卡一个 trainer 的整数倍 EP。
处理要求:请针对该评论修复并提交新的 commit。
建议把校验收紧到 8 的倍数,并同步更新错误信息:
| assert ( | |
| ep_degree >= 8 and moe_sharding_degree > 1 and tp_degree == 1 | |
| ), ( | |
| "comm_group_call_opt should be enabled when ep_degree is larger then 8 and moe_sharding_degree is larger then 1" | |
| ) | |
| assert ( | |
| ep_degree >= 8 | |
| and ep_degree % 8 == 0 | |
| and moe_sharding_degree > 1 | |
| and tp_degree == 1 | |
| ), ( | |
| "comm_group_call_opt should be enabled when ep_degree is at " | |
| "least 8 and divisible by 8, moe_sharding_degree is larger " | |
| "than 1, and tensor_parallel_degree is 1" | |
| ) |
CI报告基于以下代码生成(30分钟更新一次): 1 Required任务 : 47/48 通过
2 失败详情🔴 Coverage test — PR问题(置信度: 高)失败用例: 覆盖率门禁
关键日志:
PR 本次只修改 修复建议:
关联变更: |
Codecov Report❌ Patch coverage is
❌ Your patch status has failed because the patch coverage (6.66%) 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 #79448 +/- ##
==========================================
Coverage ? 6.66%
==========================================
Files ? 1
Lines ? 75
Branches ? 0
==========================================
Hits ? 5
Misses ? 70
Partials ? 0 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
/re-run all-failed |
4cbed80 to
586caf9
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查新提交。此前关于非 8 倍数 EP 的校验问题已修复;通信组仍按手写 rank 公式构造,和可配置的 MoE topology 顺序不兼容,当前仍是阻塞点。我已在原行级线程补充了当前 head 的复查证据。
CI 目前还有检查在运行中,后续仍需以最终 CI 结果为准。
586caf9 to
2b1cc44
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查这轮提交。前两轮的阻塞点这次都已落地修复,当前没有新的阻塞问题。这轮未新增 inline 评论,细节仍在前面的 inline review comments 里。
|
/re-run all-failed |
2b1cc44 to
fc408d3
Compare
|
/re-run all-failed |
1 similar comment
|
/re-run all-failed |
|
你的PR提交成功,感谢你对开源项目的贡献! |
fc408d3 to
83dc876
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查最新提交。此前两个 P1 阻塞点仍保持已修复状态;这轮新增的本地卡数推导把未启用 comm_group_call_opt 的默认路径也绑定到了 CUDA/launcher 环境,已在行级评论中给出修复建议。请修复后再更新。
CI 当前仍有多项检查在运行,且 review-bot approval 相关检查尚未通过,后续以最终 CI 结果为准。
| self._gpus_per_node = get_gpus_per_node() | ||
| if self.use_group_call_opt: | ||
| assert ep_degree == 8 and moe_sharding_degree != 1, ( | ||
| "comm_group_call_opt should be enabled when ep_degree is 8 and moe_sharding_degree is not 1" | ||
| assert ( |
There was a problem hiding this comment.
问题: get_gpus_per_node() 现在在 self.use_group_call_opt 判断前执行。comm_group_call_opt 默认是 false,且当前文件里 _gpus_per_node 只在该开关为 true 的分支使用;但 get_gpus_per_node() 在 PADDLE_LOCAL_SIZE 缺失且 CUDA 设备数为 0 时会触发 assert。这样即使用户没有启用该优化,CPU/XPU 或自定义 launcher 场景也会在构造 MuonShardingOptimizer 时失败。
影响: 这把一个可选通信优化变成了初始化期的 CUDA/launcher 环境依赖,属于默认配置下的兼容性回归。
处理要求:请针对该评论修复并提交新的 commit。
建议把本地卡数的解析延迟到开启 comm_group_call_opt 后:
| self._gpus_per_node = get_gpus_per_node() | |
| if self.use_group_call_opt: | |
| assert ep_degree == 8 and moe_sharding_degree != 1, ( | |
| "comm_group_call_opt should be enabled when ep_degree is 8 and moe_sharding_degree is not 1" | |
| assert ( | |
| self._gpus_per_node = None | |
| if self.use_group_call_opt: | |
| self._gpus_per_node = get_gpus_per_node() | |
| assert ( |
83dc876 to
50f1173
Compare
risemeup1111
left a comment
There was a problem hiding this comment.
已复查最新提交,上轮 Nyanpasu 提出的 P1 兼容性问题已通过后续 commit 修复;此前两个 P1 阻塞点也仍保持已修复状态。当前未发现新的阻塞问题。
CI 仍有 clone/coverage clone 等检查在运行,且 review-bot approval 检查当前未通过,最终以 CI 和仓库必需检查结果为准。
|
/re-run all-failed |
PaddlePaddle-bot
left a comment
There was a problem hiding this comment.
🤖 Paddle-CI-Agent | pr_review |
2026-07-15 16:44:55
📋 Review 摘要
PR 概述:支持 MuonShardingOptimizer 的 comm_group_call_opt 按每节点 GPU 数拆分 ep>8 的机内/跨机同卡通信。
变更范围:python/paddle/distributed/fleet/meta_optimizers/muon_sharding_optimizer.py
影响面 Tag:[Distributed Strategy] [Communication Library] [Performance Optimization]
问题
未发现阻塞性问题。PR 规范问题在下面章节报,不要在这里重复。
历史 Findings 修复情况
| Finding | 问题 | 状态 |
|---|---|---|
| F1 | get_gpus_per_node() 曾在判断 self.use_group_call_opt 前无条件调用 |
✅ 已修复 |
| F2 | gpus_per_node == 1 曾仍可创建单 rank trainer group 并进入通信路径 |
✅ 已修复 |
📝 PR 规范检查
符合规范。
总体评价
本轮按分布式通信路径审查了新增 GPU-per-node 推导、trainer/same-card 进程组构造,以及 reduce/broadcast 分段逻辑;未发现需要拦截合入的问题。
|
/re-run all-failed |
sneaxiy
left a comment
There was a problem hiding this comment.
LGTM for coverage due to lack of 8 GPUs.
|
/re-run all-failed |
PR Category
Performance Optimization
PR Types
Performance
Description
support muon comm opt with ep >8
是否引起精度变化
否