fix: FSDP runnable for Qwen3-30b-a3b - #1010
Merged
Merged
Conversation
yueming-yuan
marked this pull request as ready for review
December 3, 2025 04:02
zhuzilin
approved these changes
Dec 3, 2025
Fengzdadi
pushed a commit
to Fengzdadi/slime
that referenced
this pull request
Dec 19, 2025
Co-authored-by: Yueming Yuan <yy28@illinoi.edu>
Yangruipis
pushed a commit
to redai-studio/slime
that referenced
this pull request
Feb 28, 2026
Co-authored-by: Yueming Yuan <yy28@illinoi.edu>
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.
Patch the huggingface model and hack the NCCL hanging issue for FSDP compatibility on MoE models with separate expert parameters (e.g. Qwen 30b a3b).
In the previous implementation, the training will hang at the reduced scatter in the backward of FSDP. The reason is that only partial experts are activated per rank, so only some of them can be involved in the computational graph, which makes the communication ranks not match in NCCL. So they may enter a deadlock.
Theoretically, FSDP does not allow partially activated parameters when
use_orig_params=False... (use_orig_params=Truewill no longer flatter the tensors - which is intuitively slow. So doing this hack.)(Note: This bug does not apply to MoE models with a single, combined experts tensor - e.g. GPT-OSS)