[Core] Reuse empty block lists whenever possible in KVCacheBlocks to mitigate GC costs#24964
Merged
njhill merged 12 commits intovllm-project:mainfrom Oct 14, 2025
Merged
[Core] Reuse empty block lists whenever possible in KVCacheBlocks to mitigate GC costs#24964njhill merged 12 commits intovllm-project:mainfrom
njhill merged 12 commits intovllm-project:mainfrom
Conversation
200514f to
aa2e98d
Compare
Collaborator
Author
|
Resolve #24321 |
3967910 to
01c383f
Compare
Collaborator
Author
|
Discussed with @heheda12345 offline. The main discussion point is to come up with solutions to minimize the code signature changes and avoid if else:
Change the PR to draft before addressing the concern. |
98c812b to
ab0ecb6
Compare
heheda12345
reviewed
Sep 30, 2025
Collaborator
heheda12345
left a comment
There was a problem hiding this comment.
Nice catch. Can't imagine it can be implemented in such a clean way.
njhill
reviewed
Oct 1, 2025
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Collaborator
|
@Jialin can you rebase the PR? |
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
houseroad
reviewed
Oct 14, 2025
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
5 tasks
bbartels
pushed a commit
to bbartels/vllm
that referenced
this pull request
Oct 16, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com> Signed-off-by: bbartels <benjamin@bartels.dev>
lywa1998
pushed a commit
to lywa1998/vllm
that referenced
this pull request
Oct 20, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
alhridoy
pushed a commit
to alhridoy/vllm
that referenced
this pull request
Oct 24, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
0xrushi
pushed a commit
to 0xrushi/vllm
that referenced
this pull request
Oct 26, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
0xrushi
pushed a commit
to 0xrushi/vllm
that referenced
this pull request
Oct 26, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com> Signed-off-by: 0xrushi <6279035+0xrushi@users.noreply.github.com>
rtourgeman
pushed a commit
to rtourgeman/vllm
that referenced
this pull request
Nov 10, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
devpatelio
pushed a commit
to SumanthRH/vllm
that referenced
this pull request
Nov 29, 2025
…mitigate GC costs (vllm-project#24964) Signed-off-by: Jialin Ouyang <Jialin.Ouyang@gmail.com>
5 tasks
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.
Purpose
Majority of the the Generation 0 collect objects are related to KVCacheBlocks, and we found most of them are actually referring to empty blocks.

In this PR, we mainly made 2 changes
Test Plan & Test Result
Model: facebook/opt-125m
Prefill-Heavy workload: Input 2000, Output 48
Decode-Heavy workload: Input 48, Output 2000
We could see, GC costs are significantly smaller with the PR (especially for decode-heavy workload). It could roughly convert to 3-4% throughput improvements.

Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.