fix(muon): avoid EP/FSDP AGRS OOM - #2069
Open
jayhenry wants to merge 2 commits into
Open
Conversation
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.
Summary
MuonConfig.remainder_strategy="pad_all2all"as a temporary workaround for remainder batches when all-to-all is available.xtuner_muon_oom.md.Root cause
For GLM-5.2 with 512 ranks and EP8, the expert FSDP group has 64 ranks. The 76 same-shaped
fused_w2parameters form a remainder batch of 12. Before this fix, AGRS used the full DTensor dimension(256 * 6144)instead of the EP-local dimension(256 * 6144) / 8, producing a 72 GiB buffer and a second 72 GiBflattencopy.Validation
PYTHONPATH=. python -m pytest tests/optim/test_muon.py -q— 12 passed..dev_scripts/repro_muon_agrs_ep_oom.pycompleted successfully under the local GPU lock.The two commits are intentionally separate: the first is the temporary configuration workaround, and the second is the permanent dimension fix.