Repository navigation
Don't mask the DP-gathered MoE buffer with the local token count - #40643
Closed
alisonshao wants to merge 1 commit into
Closed
alisonshao wants to merge 1 commit into
alisonshao wants to merge 1 commit into
Conversation
alisonshao
requested review from
Fridge003,
ch-wan,
fzyzcjy,
ispobock and
merrymercy
as code owners
September 21, 2026 22:49
#39574 started passing forward_batch.num_token_non_padded into the non-a2a MoE path. That value is the current DP rank's own token count, but with DP attention the MoE runs over the DP-gathered buffer spanning every DP rank, so the mask truncates it and each rank sums a differently truncated partial output. Only pass the count when attn_dp_size == 1.
alisonshao
force-pushed
the
fix/eplb-dp-attention-token-mask
branch
from
September 21, 2026 23:04
a6bdd60 to
8ebde03
Compare
Collaborator
Author
|
/rerun-test test_eplb_no_a2a.py |
Contributor
|
Results for 🚀 |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as duplicate.
This was referenced Sep 21, 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.
Problem
TestEPLBNoA2ADPAttention::test_gsm8khas failed every nightly since 09-17, scoring 0.14–0.26 against its 0.55 threshold. The non-DP siblingTestEPLBNoA2Apasses at 0.64 in the same job.failure example: https://github.com/sgl-project/sglang/actions/runs/35610345178/job/106367717006
Cause
Bisected to #39574, which started passing
forward_batch.num_token_non_paddedinto the non-a2a MoE path. That field is documented inforward_batch_info.pyasscalar, LOCAL (derived)— the count for the current DP rank. With DP attention the MoE runs over the DP-gathered buffer spanning every DP rank, so masking it with the local count cuts off the other ranks' tokens. On--moe-a2a-backend noneevery rank sums its partial output, so the truncation compounds instead of cancelling.Fix
Only pass the count when
attn_dp_size == 1. That restores the pre-#39574 behaviour on the DP-attention path and leaves the padded-row fix untouched everywhere else, including the non-DP EP case the test above covers.Verification
2-GPU A/B on the same commit, only this patch differing, using the test's server args.
lmsys/sglang-ci-dsv3-testisn't reachable outside CI, so this used publicdeepseek-ai/DeepSeek-V2-Lite; its absolute gsm8k is lower but the collapse reproduces:Bisect endpoints matched CI on the same setup —
832ec39cc0(last passing nightly) 0.335,7ccbf5fd04(first failing) 0.04 — and the first bad commit was #39574's0dabef3d30, whose parentfb91baedabscores 0.335.cc @hnyls2002
CI States
Latest PR Test (Base): ❌ Run #35665798680
Latest PR Test (Extra): ❌ Run #35665798603
Latest PR Test (AMD ROCm 10): ❌ Run #35665798780