A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
Fix tensor device and dtype placement in Qwen2VL model (#26219)
Signed-off-by: Cyrus Leung <cyrus.tl.leung@gmail.com> Co-authored-by: Yuanfeng Li <yuanfengli@meta.com> Co-authored-by: Cyrus Leung <cyrus.tl.leung@gmail.com>
yuafng committed
Oct 4, 2025 at 06:41 UTC
86ee94912896d1ea251d42e7cf7350f9a32b32ca
1 file changed
+1
-1
vllm/model_executor/models/qwen2_vl.py
+1
-1
@@ -720,7 +720,7 @@ class Qwen2VisionTransformer(nn.Module):
720
rotary_pos_emb = self.rot_pos_emb(grid_thw)
721
722
# compute cu_seqlens
723
- grid_thw_ = torch.tensor(grid_thw)
723
+ grid_thw_ = torch.tensor(grid_thw, device=x.device, dtype=torch.long)
724
cu_seqlens = torch.repeat_interleave(grid_thw_[:, 1] * grid_thw_[:, 2],
725
grid_thw_[:, 0]).cumsum(
726
dim=0, dtype=torch.int32)