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

[UX] Improve error message for MM input too long (#39409)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>

Cyrus Leung committed Apr 9, 2026 at 21:20 UTC 54d244f28f57b5ca2e6afdb91786b5c798adb42f
1 file changed +3 -3
vllm/v1/engine/input_processor.py
+3 -3
@@ -405,11 +405,11 @@ class InputProcessor:
405 decoder_mm_positions = prompt_input["mm_placeholders"]
406 for modality, mm_positions in decoder_mm_positions.items():
407 for mm_position in mm_positions:
408 - embed_length = mm_position.get_num_embeds()
409 - if embed_length > self.mm_encoder_cache_size:
408 + num_embeds = mm_position.get_num_embeds()
409 + if num_embeds > self.mm_encoder_cache_size:
410 raise ValueError(
411 f"The {prompt_type} prompt contains a(n) {modality} item "
412 - f"with length {embed_length}, which exceeds the "
412 + f"with {num_embeds} embedding tokens, which exceeds the "
413 f"pre-allocated encoder cache size "
414 f"{self.mm_encoder_cache_size}. Please reduce the input "
415 f"size or increase the encoder cache size "