Repository navigation
Fix PD retraction checkpoint boundaries with overlap decoding - #39743
Open
chromecast56 wants to merge 2 commits into
Open
chromecast56 wants to merge 2 commits into
chromecast56 wants to merge 2 commits into
Conversation
chromecast56
force-pushed
the
codex/pd-retraction-overlap-boundary
branch
from
September 22, 2026 21:23
dcfabfd to
746cf63
Compare
This was referenced Sep 22, 2026
chromecast56
marked this pull request as ready for review
September 22, 2026 21:37
chromecast56
requested review from
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
September 22, 2026 21:37
This was referenced Sep 22, 2026
chromecast56
force-pushed
the
codex/pd-retraction-overlap-boundary
branch
from
September 23, 2026 21:57
746cf63 to
b447143
Compare
This was referenced Oct 4, 2026
This branch has not been deployed
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.
Related PD/DCP/DFlash PRs: #40794, #39731, #39749, #40164. Each is independent and they can merge in any order.
Motivation
With overlap scheduling, PD decode can retract a request while the previous step's result is still pending. CPU offload then records
output_idsat step N-1 while the GPU state it copies may already be at step N.For pure-attention models without speculative decoding this was already correct: result processing discards the in-flight token of a retracted request, the offload covers only
[:seqlen - 1], and the resumed decode step recomputes the last position. Two kinds of state break it:output_ids. Resumed requests skip tokens or end early.Upstream repro: a hybrid model such as Qwen3-Next under PD decode with overlap scheduling and
SGLANG_TEST_RETRACTforcing retraction.Modifications
pause_generationalready drains the same way.Related: #39749
Tests
test_pd_retraction_overlap_boundary.py(3 CPU tests, 8 subtests) drives the realScheduler.update_running_batch: the pending block is settled before the offload snapshot, settlement filters completed requests and rechecks capacity, and non-retracting, non-PD, and non-overlap steps keep their pending result. Five subtests fail without the fix.GPU check, Kimi K3 PD 1P1D on 8xB300 per role (prefill TP8, decode TP8), DFLASH full draft (block size 8), NIXL, GSM8K 5-shot, prefill DCP8 → decode DCP8 with forced decode retraction (
SGLANG_TEST_RETRACT=1, interval 30, about 2,950 retractions) on the same 200 questions: main 98.5% accuracy / average accept length 5.02; a build with all five PD/DCP/DFlash PRs (#39743, #40794, #39731, #39749, #40164) 98.5% / 5.29. No accuracy regression under retraction.CI States
Latest PR Test (Base): ❌ Run #35925575648
Latest PR Test (Extra): ❌ Run #35925575053
Latest PR Test (AMD ROCm 10): ❌ Run #35925575451