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 5, 07:15 UTC
[Bugfix] add SupportsMultiModal to Exaone4_5_MTP (#39526)
Signed-off-by: leeyongjun <jqueen.astro@gmail.com>
Lee Yongjun committed
Apr 11, 2026 at 14:57 UTC
da72daced2a82032839714e56084478fda562b25
1 file changed
+36
-1
vllm/model_executor/models/exaone4_5_mtp.py
+36
-1
@@ -23,8 +23,14 @@ from vllm.model_executor.models.exaone_moe_mtp import (
23
ExaoneMoeMultiTokenPredictor,
24
)
25
26
+from .interfaces import (
27
+ MultiModalEmbeddings,
28
+ SupportsMultiModal,
29
+ _require_is_multimodal,
30
+)
31
from .utils import (
32
AutoWeightsLoader,
33
+ _merge_multimodal_embeddings,
34
maybe_prefix,
35
)
36
@@ -85,9 +91,12 @@ class Exaone4_5MultiTokenPredictor(ExaoneMoeMultiTokenPredictor):
91
config.hidden_size, eps=config.rms_norm_eps
92
)
93
94
+ def embed_input_ids(self, input_ids: torch.Tensor) -> torch.Tensor:
95
+ return self.embed_tokens(input_ids)
96
+
97
98
@support_torch_compile
90
-class Exaone4_5_MTP(ExaoneMoeMTP):
99
+class Exaone4_5_MTP(ExaoneMoeMTP, SupportsMultiModal):
100
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
101
config = vllm_config.model_config.hf_config
102
self.vllm_config = vllm_config
@@ -111,6 +120,32 @@ class Exaone4_5_MTP(ExaoneMoeMTP):
120
self.unpadded_vocab_size, config.vocab_size
121
)
122
123
+ def embed_input_ids(
124
+ self,
125
+ input_ids: torch.Tensor,
126
+ multimodal_embeddings: MultiModalEmbeddings | None = None,
127
+ *,
128
+ is_multimodal: torch.Tensor | None = None,
129
+ ) -> torch.Tensor:
130
+ inputs_embeds = self._embed_text_input_ids(
131
+ input_ids,
132
+ self.model.embed_input_ids,
133
+ is_multimodal=is_multimodal,
134
+ )
135
+
136
+ if multimodal_embeddings is None or len(multimodal_embeddings) == 0:
137
+ return inputs_embeds
138
+
139
+ is_multimodal = _require_is_multimodal(is_multimodal)
140
+
141
+ inputs_embeds = _merge_multimodal_embeddings(
142
+ inputs_embeds=inputs_embeds,
143
+ multimodal_embeddings=multimodal_embeddings,
144
+ is_multimodal=is_multimodal,
145
+ )
146
+
147
+ return inputs_embeds
148
+
149
def load_weights(self, weights: Iterable[tuple[str, torch.Tensor]]) -> set[str]:
150
shared_weight_names = ["embed_tokens", "lm_head"]
151