@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 5c2acb270a
Fork 0

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

[Models][QwenVL] Remove unnecessary `.contiguous()` calls (#27106)

Signed-off-by: Lukas Geiger <lukas.geiger94@gmail.com>

Lukas Geiger committed Oct 18, 2025 at 16:05 UTC 5c2acb270aad36e35750f617f6219bf95a4924c4
2 files changed +2 -2
vllm/model_executor/models/qwen2_5_vl.py
+1 -1
@@ -396,7 +396,7 @@ class Qwen2_5_VisionAttention(nn.Module):
396 q, k, v = self.split_qkv(x)
397 batch_size = q.shape[1]
398
399 - q, k, v = (rearrange(x, "s b ... -> b s ...").contiguous() for x in (q, k, v))
399 + q, k, v = (rearrange(x, "s b ... -> b s ...") for x in (q, k, v))
400 if rotary_pos_emb is not None:
401 # [2 * b, s, heads, head_dim]
402 qk_concat = torch.cat([q, k], dim=0)
vllm/model_executor/models/qwen2_vl.py
+1 -1
@@ -423,7 +423,7 @@ class Qwen2VisionAttention(nn.Module):
423 q, k, v = self.split_qkv(x)
424 batch_size = q.shape[1]
425
426 - q, k, v = (rearrange(x, "s b ... -> b s ...").contiguous() for x in (q, k, v))
426 + q, k, v = (rearrange(x, "s b ... -> b s ...") for x in (q, k, v))
427 if rotary_pos_emb is not None:
428 # [2 * b, s, heads, head_dim]
429 qk_concat = torch.cat([q, k], dim=0)