Leverage TE wgrad accumulation fusion in MFSDP v2 - #7101
Open
PACTHEMAN123 wants to merge 2 commits into
Open
Conversation
svcnvidia-nemo-ci
marked this pull request as draft
September 7, 2026 06:14
Contributor
|
This PR has been automatically converted to draft because all PRs must start as drafts. When you are ready for review, click Ready for Review to begin the review process. This will:
See the contribution guide for more details. |
Signed-off-by: PACTHEMAN123 <3028079152@qq.com>
Signed-off-by: PACTHEMAN123 <3028079152@qq.com>
PACTHEMAN123
force-pushed
the
issue-6942-te-wgrad-mfsdp-v2
branch
from
September 7, 2026 06:48
5360c58 to
3efedca
Compare
PACTHEMAN123
marked this pull request as ready for review
September 7, 2026 12:09
wujingyue
requested changes
Sep 7, 2026
wujingyue
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the PR!
For the first PR, don't touch mcore_fsdp_adapter or things outside megatron_fsdp.
Add unit tests.
Simplify -- quite some slops at this moment.
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.
What does this PR do?
Leverage Transformer Engine wgrad accumulation fusion in MFSDP v2 so supported TE/MCore linear layers write weight gradients directly into MFSDP v2 reduce-scatter input buffers.
The implementation follows the MFSDP runtime schedule described in
megatron/core/distributed/fsdp/src/docs/runtime_schedule.md.Issue tracking
Linked issue: Fixes #6942
Contribution process
Pre-checks
The test implementations used for validation are intentionally kept outside this production-only PR. The validation results are reported below.
Implementation
MFSDP v2 fused wgrad accumulation rejects unsupported combinations:
overlap_moe_expert_parallel_commoverlap_dispatch_backward_with_experts_wgraduse_transformer_engine_op_fuserThe delayed expert-wgrad overlap combination is intentionally rejected because MFSDP v2 does not currently implement the delayed
post_wgrad_grad_acc_hookcallback required byMoELayer.backward_dw().Validation
Benchmark
Configuration:
The first-step language-model loss was
12.58627for both paths. Both runs completed all 15 iterations without OOM or NCCL errors, and all eight GPUs were released after completion.Limitations
MFSDP v2 continues to use the static backward-order prefetch design described in
runtime_schedule.md.Delayed expert wgrad overlap and CPU offloading remain unsupported when fused wgrad accumulation is enabled.