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

A high-throughput and memory-efficient inference and serving engine for LLMs

[Bugfix][MiniCPM-o] Fix cuda/cpu device mismatch in Resampler2_5 pos_embed (#43844)

Signed-off-by: Parth Ashwin Jain <parthash@amd.com> Co-authored-by: Parth Ashwin Jain <parthash@amd.com> Co-authored-by: Cyrus Leung <tlleungac@connect.ust.hk> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>

Parth Ashwin Jain committed Jun 9, 2026 at 11:58 UTC e6fc848d4ff2d00759516b0c7a47ba640d44e4b2
1 file changed +3 -1
vllm/model_executor/models/minicpmv.py
+3 -1
@@ -217,7 +217,9 @@ class Resampler2_5(BaseResampler):
217 for i in range(bs):
218 tgt_h, tgt_w = tgt_sizes[i].tolist()
219 pos_embed.append(
220 - self.pos_embed[:tgt_h, :tgt_w, :].reshape((tgt_h * tgt_w, -1)).to(dtype)
220 + self.pos_embed[:tgt_h, :tgt_w, :]
221 + .reshape((tgt_h * tgt_w, -1))
222 + .to(device=device, dtype=dtype)
223 ) # patches * D
224 key_padding_mask[i, patch_len[i] :] = True
225 pos_embed = torch.nn.utils.rnn.pad_sequence(