@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / fbd8595c5c
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

[Bugfix] Fix basic models tests hanging due to mm processor creation (#22571)

Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>

Isotr0py committed Aug 10, 2025 at 02:42 UTC fbd8595c5c6f969dfa6cf33e5a371d93d55025fb
1 file changed +23 -5
vllm/multimodal/registry.py
+23 -5
@@ -138,8 +138,8 @@ class MultiModalRegistry:
138 if not model_config.is_multimodal_model:
139 return False
140
141 - processor = self.create_processor(model_config, disable_cache=False)
142 - supported_modalities = processor.info.get_supported_mm_limits()
141 + info = self._create_processing_info(model_config, tokenizer=None)
142 + supported_modalities = info.get_supported_mm_limits()
143
144 mm_config = model_config.get_multimodal_config()
145
@@ -278,6 +278,26 @@ class MultiModalRegistry:
278 model_cls, _ = get_model_architecture(model_config)
279 return model_cls
280
281 + def _create_processing_ctx(
282 + self,
283 + model_config: "ModelConfig",
284 + tokenizer: Optional[AnyTokenizer] = None,
285 + ) -> InputProcessingContext:
286 + if tokenizer is None and not model_config.skip_tokenizer_init:
287 + tokenizer = cached_tokenizer_from_config(model_config)
288 + return InputProcessingContext(model_config, tokenizer)
289 +
290 + def _create_processing_info(
291 + self,
292 + model_config: "ModelConfig",
293 + *,
294 + tokenizer: Optional[AnyTokenizer] = None,
295 + ) -> BaseProcessingInfo:
296 + model_cls = self._get_model_cls(model_config)
297 + factories = self._processor_factories[model_cls]
298 + ctx = self._create_processing_ctx(model_config, tokenizer)
299 + return factories.info(ctx)
300 +
301 def create_processor(
302 self,
303 model_config: "ModelConfig",
@@ -291,15 +311,13 @@ class MultiModalRegistry:
311 if not model_config.is_multimodal_model:
312 raise ValueError(f"{model_config.model} is not a multimodal model")
313
294 - if tokenizer is None and not model_config.skip_tokenizer_init:
295 - tokenizer = cached_tokenizer_from_config(model_config)
314 if disable_cache is None:
315 disable_cache = not model_config.enable_mm_processor_cache
316
317 model_cls = self._get_model_cls(model_config)
318 factories = self._processor_factories[model_cls]
319
302 - ctx = InputProcessingContext(model_config, tokenizer)
320 + ctx = self._create_processing_ctx(model_config, tokenizer)
321 cache = None if disable_cache else self._get_processor_cache(
322 model_config)
323