Repository navigation
perf(fsdp): accumulate final fused reduce-scatter gradients before root cleanup - #372
Closed
zhangming700 wants to merge 2 commits into
Closed
zhangming700 wants to merge 2 commits into
zhangming700 wants to merge 2 commits into
Conversation
Author
|
/check-pr |
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.
Apply final fused reduce-scatter views directly to existing device shard gradients during backward. Keep delayed finalization for first gradients, offload, FP32 main gradients and source-layout reductions. Includes a regression test for exactly-once accumulation and view lifetime.
Supersedes #370 on the master base. Prior full Qwen3-30B-A3B eight-device measurements on experiment base c9e7fca showed peak allocated memory dropping from 26.33 to 19.68 GiB for accumulation 2 and 4, with bitwise-matching loss and grad norm.
Master validation (
39bd984): use the resolved per-parameterapply_grad_on_fp32_main_gradfield. All 240 fully_shard unit tests passed (6 warnings). On the two changed files, the repository Pylint hook reports the same six diagnostics as master; Lizard reports the same existingcopy_outCCN 17 warning. The eight-device performance numbers above are from the earlier experiment base.