Skip to content

Conversation

QiliangCui
Copy link
Contributor

@QiliangCui QiliangCui commented May 17, 2025

The change calculates the block size from max-model-len and tries to use as the largest block size below 256. While in some configuration, smaller block size may give better performance.

This change is to re-enable the argument block-size and fallback to to PallasAttentionBackend.get_page_size when block-size is not explicit set.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

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 either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the tpu Related to Google TPUs label May 17, 2025
@QiliangCui QiliangCui marked this pull request as draft May 17, 2025 01:20
@QiliangCui QiliangCui force-pushed the dev1 branch 5 times, most recently from d07426c to 5f529ae Compare May 18, 2025 03:23
@QiliangCui QiliangCui marked this pull request as ready for review May 18, 2025 16:16
vllm_config) # type: ignore[assignment]

# For v1, the default block size is calculated from vllm_config.
cache_config.block_size = (
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we add warning when the block_size set by user is not optimal? cc @bythew3i

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If we know what value is optimal for the user, I think we should add.

The reason I want to put back the block-size parameter is that I found the value from PallasAttentionBackend.get_page_size is not a good value for me when my max-model-len is large.

In my benchmark testing, my max-model-len is 4096 which results a 256 from get_page_size. But block_size=16 gives me better result.

@QiliangCui QiliangCui closed this May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tpu Related to Google TPUs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants