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

[Hardware][TPU]Enable ragged paged attention kernel and resolve recompilation issue #14310

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

yaochengji
Copy link
Collaborator

@yaochengji yaochengji commented Mar 5, 2025

  • enable ragged paged attention kernel
  • resolve recompilation issue
  • change the layout of kv cache from (num_kv_heads, num_blocks, block_size, head_size) to (num_blocks, block_size, num_kv_heads, head_size)

Copy link

github-actions bot commented Mar 5, 2025

👋 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 v1 label Mar 5, 2025
Copy link

mergify bot commented Mar 5, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @yaochengji.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Mar 5, 2025
@yaochengji yaochengji force-pushed the chengji/ragged_attn_v2_new branch from d8595c5 to f366aa1 Compare March 5, 2025 21:33
@yaochengji yaochengji force-pushed the chengji/ragged_attn_v2_new branch from f366aa1 to 8d83065 Compare March 5, 2025 21:33
@mergify mergify bot removed the needs-rebase label Mar 5, 2025
@yaochengji
Copy link
Collaborator Author

This PR depends on pytorch/xla#8797, I will update the torch/xla nightly version tomorrow

@yaochengji yaochengji requested a review from vanbasten23 March 5, 2025 21:37
@@ -168,8 +164,9 @@ def forward(
attn_metadata.num_seqs,
num_kv_pages_per_block=NUM_KV_PAGES_PER_BLOCK,
num_queries_per_block=NUM_QUERIES_PER_BLOCK,
use_kernel=use_kernel,
)
vmem_limit_bytes=32 * 1024 * 1024,
Copy link
Member

Choose a reason for hiding this comment

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

Should this shift depending on device?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, @vanbasten23 is tuning the kernel parameter, will update it later.

@yaochengji yaochengji marked this pull request as draft March 5, 2025 21:40
Signed-off-by: Chengji Yao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants