From 677e446e51ca77ffbfbb2d8c0f7d42b0be411940 Mon Sep 17 00:00:00 2001 From: fy Date: Thu, 12 Mar 2026 09:08:43 +0800 Subject: [PATCH] [NPU] Convert cu_window_seqlens to CPU for npu_flush_attention_unpad operator (#20328) --- python/sglang/srt/models/qwen2_5_vl.py | 1 + 1 file changed, 1 insertion(+) diff --git a/python/sglang/srt/models/qwen2_5_vl.py b/python/sglang/srt/models/qwen2_5_vl.py index 8b6b2b17d..58c4ea4d8 100644 --- a/python/sglang/srt/models/qwen2_5_vl.py +++ b/python/sglang/srt/models/qwen2_5_vl.py @@ -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):