Conversation
Preempted seqs keep their decoded token_ids (preempt() only deallocates KV blocks) so seq.num_tokens > seq.num_prompt_tokens on re-admit. Computing num_new_tokens from num_prompt_tokens caused chunk=0 when a fully-cached prefix exhausted num_prompt_tokens, triggering the "chunk must be positive" assert under high concurrency benchmarks.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes chunked-prefill scheduling so preempted sequences (whose KV blocks have been freed but whose decoded token_ids are retained) re-forward all of their tokens — not just the original prompt tokens — when they are re-admitted from the waiting queue. Also removes the DeepSeek-V4 carve-out that auto-disabled chunked prefill, indicating chunked prefill is now considered safe for V4.
Changes:
- In
scheduler.py, basenum_new_tokensonseq.num_tokensinstead ofseq.num_prompt_tokensso previously-decoded tokens of a preempted seq are recomputed. - Remove the
enable_chunked_prefill = Falseauto-override and accompanying warning for DeepSeek-V4 inconfig.py. - Drop the corresponding "DeepSeek-V4 auto-disables this" note from the
--enable-chunked-prefillCLI help inarg_utils.py.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| atom/model_engine/scheduler.py | Use num_tokens (prompt + decoded) when sizing the new prefill chunk for waiting seqs, so preempted/requeued seqs recompute KV for all retained tokens. |
| atom/config.py | Remove DeepSeek-V4 auto-disable of chunked prefill and its warning. |
| atom/model_engine/arg_utils.py | Remove now-stale DeepSeek-V4 note from the chunked-prefill CLI help. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Technical Details
Test Plan
Test Result
Submission Checklist