Skip to content

[ROCm][perf] Shuffle KV cache to use paged_attention_common#1

Closed
samutamm wants to merge 5 commits intomainfrom
pa_common_shuffle_kv_cache
Closed

[ROCm][perf] Shuffle KV cache to use paged_attention_common#1
samutamm wants to merge 5 commits intomainfrom
pa_common_shuffle_kv_cache

Conversation

@samutamm
Copy link
Owner

@samutamm samutamm commented Jan 22, 2026

Purpose

For Qwen/Qwen3-235B-A22B-Instruct-2507-FP8 model, currently VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT=1 performs worse on small concurrencies, compared to VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT=0. This PR fixes the issue using paged_attention_common from aiter (see ROCm/aiter#1821).

Test Plan

For input and output lengths of 1k and 8k and concurrencies from 8, 18, 32, 64, 128, compare current main branch with and without VLLM_ROCM_SHUFFLE_KV_CACHE_LAYOUT (_vllm_main_shuffle1 and _vllm_main_shuffle0, respectively) to changes of this PR (_pr_shuffle1).

Also verified on MI355.
Also verified for Qwen/Qwen3-235B-A22B-Instruct-2507.

Test Result

Qwen_Qwen3-235B-A22B-Instruct-2507-FP8_combined

For input length 8k and output length 1k (green lines), the changes of this PR (_pr_shuffle1, the solid line) outperform main branch, with or without shuffle kv cache.
For input length 1k and output length 8k (orange lines), the changes of this PR (_pr_shuffle1, the solid line) outperform main branch, with or without shuffle kv cache.
For input length 1k and output length 1k (blue lines), the changes of this PR (_pr_shuffle1, the solid line) are very close to main branch. This might require further adjustment in aiter paged_attention_common.


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

@github-actions
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 ask your reviewers to trigger select CI tests on top of fastcheck CI.

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.

If you have any questions, please reach out to us on Slack at https://slack.vllm.ai.

🚀

@samutamm samutamm force-pushed the pa_common_shuffle_kv_cache branch 2 times, most recently from e31d268 to ea196ed Compare January 23, 2026 06:35
Signed-off-by: Samu Tamminen <stammine@amd.com>
Signed-off-by: Samu Tamminen <stammine@amd.com>
Signed-off-by: Samu Tamminen <stammine@amd.com>
Signed-off-by: Samu Tamminen <stammine@amd.com>
@samutamm samutamm force-pushed the pa_common_shuffle_kv_cache branch from ea196ed to 6cf3af5 Compare January 23, 2026 06:42
Signed-off-by: Samu Tamminen <stammine@amd.com>
@samutamm samutamm closed this Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant