Multiple Hybrid KV Cache Coordinator#30263
Closed
roikoren755 wants to merge 4 commits intovllm-project:mainfrom
Closed
Multiple Hybrid KV Cache Coordinator#30263roikoren755 wants to merge 4 commits intovllm-project:mainfrom
roikoren755 wants to merge 4 commits intovllm-project:mainfrom
Conversation
Signed-off-by: Roi Koren <roik@nvidia.com>
2817c9e to
030eeae
Compare
|
Hi @roikoren755, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
Signed-off-by: Roi Koren <roik@nvidia.com>
|
Hi @roikoren755, the pre-commit checks have failed. Please run: uv pip install pre-commit
pre-commit install
pre-commit run --all-filesThen, commit the changes and push to your branch. For future commits, Tip Is
|
Collaborator
|
Per offline discussion, we will continue on this PR when more details are available. |
5 tasks
Member
|
Closing as superseded by #31707 |
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
The current
HybridKVCacheConnectorlimits the KV cache specs to exactly two types, with one being full attention and the second non-full attention (sliding window, mamba, ...).Some of the models released by NVIDIA have more than 2 types (with at least one full attention), like vGQA (different number of KV heads per layer)
Currently, we must disable prefix caching when running these models in vLLM. This PR enables automatic prefix caching for such models, by updating the
HybridKVCacheCoordinator, such that it accepts at least one full attention KV cache spec, plus at least one other spec - which could be full attention as well, but must have a different spec - and similarly to how it is today, finds the shortest cache hit and returns it, but this time with multiple "other" KV cache specs. We also don't force an order between the different KV cache specs (all full attention together up front, for example).Test Plan
Current tests pass. Add new tests and parametrize existing ones, to accept more than 2 different KV cache specs.
Test Result
All tests pass
Performance:
Running the server on an H100 GPU with vllm serve nvidia/NVIDIA-Nemotron-Nano-9B-v2 --trust-remote-code, I got the following results.
GSM8K was ran with lm_eval --model local-completions --tasks gsm8k --model_args "model=nvidia/NVIDIA-Nemotron-Nano-9B-v2,base_url=http://127.0.0.1:8000/v1/completions,num_concurrent=4,max_retries=3,tokenized_requests=False" --cache_requests true --batch_size 256.
E2E with vllm bench serve --backend vllm --model nvidia/NVIDIA-Nemotron-Nano-9B-v2 --endpoint /v1/completions --dataset-name random --num-prompts 10.
Branch:
GSM8K:
E2E:
Main:
GSM8K:
E2E:
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.