From 7a68bd37b7a364c40cc69d4478fa3d45ee309d99 Mon Sep 17 00:00:00 2001 From: Taichang Zhou Date: Wed, 18 Mar 2026 23:23:41 +0800 Subject: [PATCH] Refactor cu_seqlens handling in Qwen3Omni_VisionTransformer to align with upstream vLLM changes. The sequence length helper now retains cu_seqlens in numpy format and converts it for attention execution, improving compatibility and performance. --- .../models/qwen3_omni/qwen3_omni_moe_thinker.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py b/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py index 9c116b162..6416f2e24 100644 --- a/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py +++ b/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py @@ -156,13 +156,8 @@ class Qwen3Omni_VisionTransformer(_Qwen3Omni_VisionTransformer): dtype=torch.int32, device=self.device, ) - cu_seqlens = MMEncoderAttention.maybe_recompute_cu_seqlens( - self.attn_backend, - cu_seqlens, - self.hidden_size, - self.tp_size, - self.device, - ) + # Align with upstream vLLM qwen3_omni path: keep cu_seqlens in numpy for + # sequence length helpers and convert once for attention execution. cu_seqlens = torch.from_numpy(cu_seqlens).to(self.device, non_blocking=True) hidden_states = hidden_states.unsqueeze(1)