[Bugfix][KV Offloading] Handle queued request aborts without allocated KV blocks - #49146
Merged
chaunceyjiang merged 2 commits intoJul 21, 2026
Merged
Conversation
chaunceyjiang
requested review from
ApostaC,
NickLucche,
ivanium,
orozery and
xuechendi
as code owners
July 20, 2026 03:48
Collaborator
Author
|
/cc @orozery PTAL. |
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
orozery
reviewed
Jul 20, 2026
orozery
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @chaunceyjiang !
Could you rebase and address my comment?
I can also push, just let me know.
| @@ -327,6 +327,21 @@ def storable_chunks( | |||
| num_chunks = max(0, num_chunks - 1) | |||
| return num_chunks | |||
|
|
|||
| def storable_allocated_chunks( | |||
Collaborator
There was a problem hiding this comment.
Can we please merge the logic here into the existing storable_chunks function?
…d KV blocks Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
…d KV blocks Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
chaunceyjiang
force-pushed
the
kv_offload_abort_req
branch
from
July 20, 2026 14:58
1d24e2e to
95aabf6
Compare
orozery
approved these changes
Jul 20, 2026
orozery
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @chaunceyjiang !
Alex-ai-future
added a commit
to Alex-ai-future/vllm
that referenced
this pull request
Jul 21, 2026
…equest_finished Root-cause fix for issue vllm-project#49118, complementary to PR vllm-project#49146's clamp. Changes: 1. preempt path: sync clear offload_keys with block_ids - Maintains invariant: len(offload_keys) * blocks_per_chunk <= len(block_ids) - Prevents offload_keys residue after preempt 2. request_finished: check block_ids before calling update_offload_keys - Only populate offload_keys if request was actually scheduled - Prevents offload_keys without corresponding block_ids for queued aborts 3. test: update test_abort_queued_request_does_not_build_store_job - Assert offload_keys is empty for never-scheduled request - Reflects the source fix in request_finished Why this matters: - preempt sync clear: defensive fix for invariant consistency - request_finished check: source fix for queued abort (no longer need clamp) - mid-prefill abort: still benefits from PR vllm-project#49146's clamp (prefix cache reuse) Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Alex <jihuihuang@example.com> Signed-off-by: Alex <jihui.huang@daocloud.io> Signed-off-by: Alex <alex.tech.lab@outlook.com> Signed-off-by: Alex <jihui.huang@daocloud.io>
ArjunPakhan
pushed a commit
to ArjunPakhan/vllm
that referenced
this pull request
Jul 21, 2026
…d KV blocks (vllm-project#49146) Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com>
This was referenced Jul 21, 2026
1 task
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.
Fix #49118
Purpose
Handle queued request aborts without allocated KV blocks
Test Plan
Test Result
before:
after:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.