From 9c18e90f6c94b90ecdaa99b2230389ba40e0fc69 Mon Sep 17 00:00:00 2001 From: Lucas Wilkinson Date: Fri, 10 Jul 2026 23:22:39 -0400 Subject: [PATCH] [BugFix] Fix packed HND KV cache reshape for FlashAttention (#47314) Signed-off-by: Lucas Wilkinson Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- vllm/v1/worker/gpu/attn_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vllm/v1/worker/gpu/attn_utils.py b/vllm/v1/worker/gpu/attn_utils.py index 227c51bb47..4f9e5e99a9 100644 --- a/vllm/v1/worker/gpu/attn_utils.py +++ b/vllm/v1/worker/gpu/attn_utils.py @@ -218,7 +218,7 @@ def _reshape_attention_kv_cache( kv_cache = ( kv_raw_tensor.view(-1, block_stride)[:, offset : offset + page_bytes] .view(dtype) - .view(kv_cache_shape) + .view(permuted_kv_cache_shape) ) elif kv_cache_spec.page_size_padded is not None: # Use a strided view to skip the padding between physical pages.