Repository navigation
Conversation
Allow preemption with synchronous eager boundary-KV speculation. Suspension happens between collected submissions, so the KV snapshot holds every plane, in-flight pipeline KV above the committed frontier included, and the pipeline snapshot holds each retained token's depth, hidden state and candidate. Async rounds and CUDA Graphs stay rejected (RFC InferMatrixLab#176 3B). Tests check, at resumption, the KV of every written position and the restored pipeline; tokens against the dense oracle; and the pipeline schedule against an uninterrupted run. Two mutation tests show the checks fail when the pipeline or the KV above the frontier is lost. Signed-off-by: 0z5a <dezhen.lu@student.uni-tuebingen.de>
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.
Summary
RFC #176 3C, synchronous part: preemption for Dory self-speculation with synchronous eager rounds, in block and token-pipeline mode. Async rounds and CUDA Graphs stay rejected together with preemption; they belong to 3B (#197).
This does not depend on 2E (#202). Speculation already stores every plane at every depth, so the generic KV snapshot covers it. Preemption for non-speculative grouped Dory is still 2E's.
Required human contributor answers
1. What outcome are you trying to achieve?
Dory self-speculation that can run with
enable_preemption=True, the 3C item of RFC #176 that I claimed in #176 (comment).2. What is the highest-leverage variable for that outcome?
Whether a suspended request resumes in exactly the state it left: committed KV, the KV that in-flight pipeline tokens wrote above the committed frontier, and the pipeline itself.
3. How will this work move that variable rather than create busywork?
It reuses the existing preemption manager and the runner's
snapshot_pipeline/restore_pipeline; the code change is the engine gate. The work is in the tests, which check the restored KV and schedule directly instead of only the output tokens (a lost pipeline is silently recomputed and keeps tokens correct).4. Who is the customer or user, and what do they actually need?
People serving Dory with priority scheduling or under KV pressure who want speculation on, and the 3B owner, whose async path can reuse these checks.
PR necessity and bugfix evidence
A PR is needed:
mainrejects preemption for every boundary-KV speculative configuration at construction. This is a feature, not a bugfix.What changes
stage_engine.py: the boundary-KV speculation gate rejects only async scheduling and CUDA Graphs.docs/dory.md: preemption moves from "rejected" to a paragraph under synchronous self-speculation.Test Plan
tests/test_dory_speculative_preemption.py, 52 CPU and 12 CUDA cases:vllm-rlt Version / Commit:
42b869donmaince200f0.Test Result
tests/test_dory_speculative_preemption.py,tests/test_dory_speculative.pyandtests/test_speculative.pytogether: 244 passed, 1 skipped, 12 failed. All 12 failures areflash_attn_4cases intests/test_speculative.py; the optional package is not installed there.ruff checkandruff format --checkpass on the changed files.Merge order
#197 edits the same gate block and the self-speculation part of
docs/dory.md. Whichever lands second needs a small rebase.