Repository navigation
[Auto-Parallel] FSDP support for MoE - #78074
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #78074 +/- ##
==========================================
Coverage ? 90.38%
==========================================
Files ? 2
Lines ? 104
Branches ? 0
==========================================
Hits ? 94
Misses ? 10
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
liym27
reviewed
Mar 20, 2026
| hook_idx = None | ||
| for i, t in enumerate(tensors): | ||
| if not t.stop_gradient: | ||
| hook_idx = i |
Contributor
There was a problem hiding this comment.
这里只对第一个 stop_gradient=False 的 Tensor 挂载了 Hook。是否可能出现 一恶搞Layer返回多个需要梯度的 Tensor、导致反向传播触发通信的逻辑不完整?
Contributor
Author
There was a problem hiding this comment.
已做修改,完善反向hook接收dict输入的情况
| grad.placements, | ||
| ) | ||
| param.main_grad._local_value().copy_(grad._local_value()) | ||
| param.main_grad._local_value().add_(grad._local_value()) |
Contributor
Author
There was a problem hiding this comment.
此处修改欠缺考虑,已修改,保持“先通信后转换精度”
liym27
approved these changes
Mar 25, 2026
| name = param.name | ||
| is_expert = getattr(param, "is_moe_param", False) | ||
| if is_expert: | ||
| continue |
Contributor
Author
There was a problem hiding this comment.
目前EP组内FSDP不额外做切分,故先不创建这里的buffer,后续完善EP组内切分。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Auto Parallel
PR Types
New features
Description
自动并行FSDP支持EP并行。
为支持MoE,从
顺序的层级通信改为fsdp_unit_layers的层级通信。TODO:目前仅支持EP组内FSDP不做额外切分,后续完善。
是否引起精度变化
否