refactor(runner): unify eager-forward DP/MLP-sync padding into one helper - #28383
Merged
Merged
Conversation
ch-wan
requested review from
Fridge003,
Ying1123,
hnyls2002,
ispobock and
merrymercy
as code owners
June 16, 2026 03:48
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
3 tasks
ch-wan
force-pushed
the
cheng/refactor/forward-unify-pp
branch
from
June 16, 2026 07:03
4484062 to
ec70a37
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 16, 2026 07:03
75a5354 to
c30b541
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-pp
branch
from
June 16, 2026 20:47
ec70a37 to
d0e17e1
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 16, 2026 20:47
c30b541 to
8e80bfe
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-pp
branch
from
June 16, 2026 20:49
d0e17e1 to
0d96f67
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 16, 2026 20:49
8e80bfe to
553893b
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-pp
branch
from
June 16, 2026 20:59
0d96f67 to
5a2ed97
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 16, 2026 20:59
553893b to
b104183
Compare
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 16, 2026 21:24
b104183 to
d59fbb6
Compare
…lper _forward_raw had an inline block between the cuda-graph replay early-return and the eager forward dispatch: prepare_mlp_sync_batch / prepare_attn_tp_scatter_input padding, the attn-tp num_token_non_padded normalization, and the hisparse- coordinator refresh. Extract it verbatim into _prepare_eager_forward_batch(forward_batch) so this eager-only preprocessing lives in one entry the runner's load_batch can later own. Behavior-identical: same ordering, same conditions, runs only on the non-graph path (the graph path pads inside the runner). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ch-wan
force-pushed
the
cheng/refactor/forward-unify-dp
branch
from
June 18, 2026 10:23
d59fbb6 to
db9191d
Compare
This was referenced Jun 18, 2026
yuyu5333
added a commit
to yuyu5333/sglang-bytedance
that referenced
this pull request
Aug 5, 2026
_forward_raw calls self._prepare_eager_forward_batch (added by upstream sgl-project#28383), but the method definition was never merged onto this branch, so the eager forward path crashed with AttributeError. Restore the helper exactly as upstream defines it (DP/MLP-sync padding, attn-tp num_token_non_padded normalization, hisparse refresh).
Chronostasys
pushed a commit
to MindLab-Research/sglang
that referenced
this pull request
Aug 24, 2026
jakki-amd
pushed a commit
to jakki-amd/sglang
that referenced
this pull request
Sep 9, 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.
Motivation
_forward_rawhad an inline eager-only preprocessing block between the cuda-graph replay early-return and the eager forward dispatch: MLP-sync / attn-tp-scatter padding, the attn-tpnum_token_non_paddednormalization, and the hisparse-coordinator refresh.Modifications
_prepare_eager_forward_batch(forward_batch).Pure helper extraction.
Accuracy Tests
N/A — behavior-preserving refactor (no change to model outputs).
Speed Tests and Profiling
N/A — no inference-speed impact.
Checklist
test/registered/attention/unittests/dense).🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #27753031814
Latest PR Test (Extra): ❌ Run #27753031591