@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / edba15045a
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 7, 07:45 UTC

[Bugfix] Guard mm_token_type_ids kwarg in get_mrope_input_positions (#35711)

Signed-off-by: Andreas Karatzas <akaratza@amd.com>

Andreas Karatzas committed Mar 3, 2026 at 22:12 UTC edba15045a7419922e7a2e21e5a684682b5b8e05
1 file changed +13 -1
vllm/model_executor/models/transformers/multimodal.py
+13 -1
@@ -474,7 +474,19 @@ class MultiModalMixin(SupportsMultiModal, SupportsMRoPE):
474 # can't accept arbitrary args, even if its value is `None`
475 kwargs = {}
476 if mm_token_type_ids:
477 - kwargs["mm_token_type_ids"] = torch.cat(mm_token_type_ids)
477 + if not hasattr(self, "_get_rope_index_accepts_mm_token_type_ids"):
478 + import inspect
479 +
480 + sig = inspect.signature(self.model.get_rope_index)
481 + params = sig.parameters
482 + self._get_rope_index_accepts_mm_token_type_ids = (
483 + "mm_token_type_ids" in params
484 + or any(
485 + p.kind == inspect.Parameter.VAR_KEYWORD for p in params.values()
486 + )
487 + )
488 + if self._get_rope_index_accepts_mm_token_type_ids:
489 + kwargs["mm_token_type_ids"] = torch.cat(mm_token_type_ids)
490
491 mrope_positions, mrope_position_delta = self.model.get_rope_index(
492 input_ids=torch.tensor(input_tokens).unsqueeze(0),