From be0dcc29dcfa83659e6857dd73cb527b5986a7f9 Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Sat, 9 May 2026 09:19:05 +0800 Subject: [PATCH] [XPU] remove q/k/v force contiguous for flash_attn (#40356) Signed-off-by: Yan Ma Co-authored-by: Kunshang Ji --- vllm/_xpu_ops.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vllm/_xpu_ops.py b/vllm/_xpu_ops.py index 09f700d0de7..6a2e5e841ce 100644 --- a/vllm/_xpu_ops.py +++ b/vllm/_xpu_ops.py @@ -387,14 +387,9 @@ class xpu_ops: assert len(window_size) == 2 real_window_size = (window_size[0], window_size[1]) # noqa: F841 - # In encode attention, k and v maybe not contiguous and current - # kernel can't handle it - if block_table is None: - k = k.contiguous() - v = v.contiguous() return flash_attn_varlen_func( out=out, - q=q.contiguous(), + q=q, k=k, v=v, cu_seqlens_q=cu_seqlens_q,