[XPU] remove q/k/v force contiguous for flash_attn (#40356)
Signed-off-by: Yan Ma <yan.ma@intel.com> Co-authored-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
+1
-6
@@ -387,14 +387,9 @@ class xpu_ops:
|
|||||||
assert len(window_size) == 2
|
assert len(window_size) == 2
|
||||||
real_window_size = (window_size[0], window_size[1]) # noqa: F841
|
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(
|
return flash_attn_varlen_func(
|
||||||
out=out,
|
out=out,
|
||||||
q=q.contiguous(),
|
q=q,
|
||||||
k=k,
|
k=k,
|
||||||
v=v,
|
v=v,
|
||||||
cu_seqlens_q=cu_seqlens_q,
|
cu_seqlens_q=cu_seqlens_q,
|
||||||
|
|||||||
Reference in New Issue
Block a user