Skip to content

Conversation

rickyyx
Copy link
Contributor

@rickyyx rickyyx commented Nov 21, 2024

This PR refactors the KVCacheManager such that:

  1. It will be easier to pass in more metadata for hashing (e.g. lora id, mm_hash and etc)
  2. Remove the needed of tracking token ids inside a block (which was used for hash calculation, but no longer needed since hash is assigned to a block).

Benchmarking

Running the below on main and the PR shows no diff on performance.

VLLM_USE_V1=1 python3 benchmarks/benchmark_prefix_caching.py \
--model meta-llama/Meta-Llama-3-8B-Instruct  \
--num-prompts 50 \
--input-length-range 500:500  \
--prefix-len 250     --seed 0 --output-len 500

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@rickyyx rickyyx marked this pull request as draft November 21, 2024 01:21
@rickyyx rickyyx marked this pull request as ready for review November 21, 2024 23:22
@rickyyx rickyyx changed the title [WIP][v1] Refactor KVCacheManager for more hash input than token ids [v1] Refactor KVCacheManager for more hash input than token ids Nov 21, 2024
@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 22, 2024
@comaniac comaniac force-pushed the pr-v1-prefix-hash-cal branch from c2bfbd5 to 2986dab Compare November 22, 2024 18:07
Copy link
Collaborator

@comaniac comaniac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Great job!

@comaniac comaniac enabled auto-merge (squash) November 22, 2024 18:37
rickyyx and others added 8 commits November 22, 2024 20:26
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
@comaniac comaniac force-pushed the pr-v1-prefix-hash-cal branch from 2986dab to dcae02e Compare November 22, 2024 20:26
@comaniac comaniac merged commit 97814fb into vllm-project:main Nov 22, 2024
47 checks passed
sleepwalker2017 pushed a commit to sleepwalker2017/vllm that referenced this pull request Dec 13, 2024
…-project#10507)

Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
Co-authored-by: Cody Yu <hao.yu.cody@gmail.com>
anko-intel pushed a commit to HabanaAI/vllm-fork that referenced this pull request Feb 12, 2025
…-project#10507)

Signed-off-by: rickyx <rickyx@anyscale.com>
Signed-off-by: Cody Yu <hao.yu.cody@gmail.com>
Co-authored-by: Cody Yu <hao.yu.cody@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants