[NPU] Convert cu_window_seqlens to CPU for npu_flush_attention_unpad operator (#20328)

This commit is contained in:
fy
2026-03-12 09:08:43 +08:00
committed by GitHub
parent 67f02681c9
commit 677e446e51

View File

@@ -463,6 +463,7 @@ class Qwen2_5_VisionTransformer(nn.Module, RotaryPosMixin):
# cu_seqlens must be on cpu because of npu_flash_attention_unpad operator restriction
if is_npu():
cu_seqlens = cu_seqlens.to("cpu")
cu_window_seqlens = cu_window_seqlens.to("cpu")
# transformers
x = x.unsqueeze(1)
for layer_num, blk in enumerate(self.blocks):