Repository navigation
[Refactor] Move eleven more MoE models to LayerCommunicator.ffn_exit - #40871
Merged
Merged
Conversation
ch-wan
marked this pull request as ready for review
September 23, 2026 07:28
This was referenced Sep 23, 2026
Collaborator
Author
|
/tag-and-rerun-ci |
This was referenced Sep 23, 2026
Merged
ch-wan
force-pushed
the
cheng/refactor/communicator-ffn-exit-models
branch
from
September 23, 2026 09:32
4675328 to
8324a3b
Compare
ch-wan
force-pushed
the
cheng/refactor/communicator-boundary-decision
branch
2 times, most recently
from
September 23, 2026 21:42
43cbac2 to
c710398
Compare
ch-wan
requested review from
BBuf,
Edwardf0t1,
Fridge003,
HaiShaw,
Ying1123,
fzyzcjy,
hanming-lu,
hebiao064,
hnyls2002,
ispobock,
merrymercy,
yizhang2077 and
yuan-luo
as code owners
September 23, 2026 21:42
Base automatically changed from
cheng/refactor/communicator-boundary-decision
to
main
September 23, 2026 21:43
Bailing (MoE, MoE-linear, V3), GLM4-MoE-Lite, GPT-OSS, Laguna, MiMo-V2, MiniMax-M2, Qwen3-Next, Sarvam-MoE and SDAR-MoE now wrap their FFN call in `LayerCommunicator.ffn_exit` and finish with `ffn_exit.finish`, instead of calling the two decision methods, publishing the flags and marking or postprocessing the output themselves. Sarvam-MoE's dense layers keep their manual all-reduce between the FFN and the exit; it reads the decision from `ffn_exit`. Qwen3-Next used to ask for reduce-scatter before fusion; both decisions are side-effect-free reads, so `ffn_exit`'s order does not change either result. No behavior change.
ch-wan
force-pushed
the
cheng/refactor/communicator-ffn-exit-models
branch
from
September 23, 2026 21:43
8324a3b to
d7de194
Compare
This was referenced Sep 24, 2026
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.
This PR is part of a stack (oldest at bottom):
Motivation
Follow-up to #40870: eleven more MoE decoder layers repeat the same FFN-exit sequence that
LayerCommunicator.ffn_exitnow owns.Modifications
Bailing (MoE, MoE-linear, V3), GLM4-MoE-Lite, GPT-OSS, Laguna, MiMo-V2, MiniMax-M2, Qwen3-Next, Sarvam-MoE and SDAR-MoE wrap their FFN call in
ffn_exitand finish withffn_exit.finish, instead of calling the two decision methods, publishing the flags and marking or postprocessing the output themselves. The now-unusedget_forwardimports and the comments that described the removed calls are dropped.ffn_exit.should_use_reduce_scatterdoes not read the token count, soffn_exit's order changes neither result nor the fusion check's short-circuit order under torch.compile.No behavior change.
Accuracy Tests
Parent vs this PR on H200, four greedy prompts submitted one at a time, 32 new tokens, bit-exact comparison of text / token ids / every logprob / top-5, with a per-rank decision log:
SGLANG_ENABLE_JIT_DEEPGEMM=0)A CPU dispatch comparison runs the real decoder forward of all 12 decoder classes with stubbed submodules, communicator methods and collectives over fuse × reduce-scatter (60 cases): identical except Qwen3-Next's decision call order, and identical after swapping those two calls.
unit/layers+unit/models: every existing case keeps its status.Speed Tests and Profiling
Same per-layer eager overhead as #40870 (about +0.4 µs); CUDA graph replay does not run this code.
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base): 🚫 Run #35924184275
Latest PR Test (Extra): 🚫 Run #35924183829
Latest PR Test (AMD ROCm 10): 🚫 Run #35924184474