fix(pp): generate MTP draft tree after prefill - #28
Open
lmyybh wants to merge 4 commits into
Open
Conversation
Under PP + DP attention, an idle rank (no local requests) on a global prefill step must follow the prefill path, not the verify path. Routing it through verify emits speculative_num_steps extra draft-decode collectives that desync the MoE cross-DP all-gather and hang. Gate the prefill branch on is_extend OR (pp_enabled and idle and is_extend_in_batch), mirroring the scheduler's is_extend_in_batch lockstep. _draft_extend_for_prefill already short-circuits idle batches, so the target+single-draft_extend collective sequence stays identical across DP ranks.
need_topk gated only on spec_algo would still take the topk stash path when the payload carries no topk_p (topk_p is None), crashing at payload.topk_p[0]. Add the payload.topk_p is not None guard, matching the existing payload.hidden_states check for need_hidden_states.
Author
liuqi-1
force-pushed
the
sglang-communiy-main-pp-mtp
branch
from
August 15, 2026 10:00
4fdd3d8 to
f4df794
Compare
liuqi-1
requested review from
hanming-lu,
hzh0425 and
xiezhq-hermann
as code owners
August 15, 2026 10:00
Collaborator
|
@lmyybh I tested your code using GLM5.2 (PP2+TP8). An error about "pool memory leak" occurs. The test cli is: I have updated my branch onto the main. Could you fix your code, and rebase your code onto my branch? |
liuqi-1
force-pushed
the
sglang-communiy-main-pp-mtp
branch
from
August 17, 2026 03:50
f4df794 to
a747ca5
Compare
liuqi-1
force-pushed
the
sglang-communiy-main-pp-mtp
branch
2 times, most recently
from
August 18, 2026 06:07
a741584 to
12abd13
Compare
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
draft()and builds a real treeSpeed Tests and Profiling
sglang command
benchmark command
python -m sglang.benchmark.serving \ --backend sglang-oai-chat \ --port 8000 \ --model GLM-5.2-FP8 \ --dataset-name sharegpt \ --dataset-path ShareGPT_V3_unfiltered_cleaned_split.json \ --request-rate inf \ --max-concurrency 16 \ --num-prompts 100 \ --warmup-requests 10 \ --flush-cacheChecklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ciCI States
Latest PR Test (Base):⚠️ Run #30509714031⚠️ Run #30509713874
Latest PR Test (Extra):