[XPU] remove q/k/v force contiguous for flash_attn (#40356)

Signed-off-by: Yan Ma <[email protected]>
Co-authored-by: Kunshang Ji <[email protected]>
This commit is contained in:
Yan Ma
2026-05-09 01:19:05 +00:00
committed by GitHub
co-authored by Kunshang Ji
parent e3b65a5ba0
commit be0dcc29dc
+1 -6
View File
@@ -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,