Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V1] Simplify prefix caching logic by removing num_evictable_computed_blocks #11310

Merged
merged 4 commits into from
Dec 19, 2024

Conversation

heheda12345
Copy link
Collaborator

@heheda12345 heheda12345 commented Dec 18, 2024

The evictable_computed_blocks are removed from self.free_block_queue during self._touch(computed_blocks), so we do not need to treat them specially in allocate_slots.

The num_evictable_computed_blocks is always zero (I've checked here 667af1b) because self._touch also increases the reference count by one.

The below command has no diff in 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

Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
Signed-off-by: Chen Zhang <zhangch99@outlook.com>
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.

🚀

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.

Ah good catch. I guess it was useful but became useless after some iterations of refactoring...

@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 19, 2024
@comaniac comaniac enabled auto-merge (squash) December 19, 2024 02:27
@comaniac comaniac merged commit c6b0a7d into vllm-project:main Dec 19, 2024
62 of 63 checks passed
BKitor pushed a commit to BKitor/vllm that referenced this pull request Dec 30, 2024
joennlae pushed a commit to 44ai-labs/vllm that referenced this pull request Jan 19, 2025
joennlae pushed a commit to 44ai-labs/vllm that referenced this pull request Jan 19, 2025
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