@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 1391378861
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 8, 01:15 UTC

[Bugfix] Fix edge case in UUID data parsing (#34884)

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

Cyrus Leung committed Feb 19, 2026 at 18:24 UTC 139137886129abe1abcdb75f0b39c81709314be3
2 files changed +14 -4
tests/renderers/test_process_multi_modal_uuids.py
+13 -3
@@ -42,6 +42,16 @@ def test_multi_modal_uuids_length_mismatch_raises():
42
43 mm_data = {"image": [cherry_pil_image, stop_pil_image]}
44
45 + # Mismatch: 2 items but only 0 uuids provided
46 + mm_uuids = {"image": []} # type: ignore[var-annotated]
47 +
48 + mm_processor = renderer.get_mm_processor()
49 + mm_data_items = mm_processor.info.parse_mm_data(mm_data)
50 + mm_uuid_items = parse_mm_uuids(mm_uuids)
51 +
52 + with pytest.raises(ValueError, match="must have same length as"):
53 + renderer._process_mm_uuids(mm_data, mm_data_items, mm_uuid_items, "req-1a")
54 +
55 # Mismatch: 2 items but only 1 uuid provided
56 mm_uuids = {"image": ["hash_cherry"]}
57
@@ -50,7 +60,7 @@ def test_multi_modal_uuids_length_mismatch_raises():
60 mm_uuid_items = parse_mm_uuids(mm_uuids)
61
62 with pytest.raises(ValueError, match="must have same length as"):
53 - renderer._process_mm_uuids(mm_data, mm_data_items, mm_uuid_items, "req-1")
63 + renderer._process_mm_uuids(mm_data, mm_data_items, mm_uuid_items, "req-1b")
64
65
66 def test_multi_modal_uuids_missing_modality_raises():
@@ -125,8 +135,8 @@ def test_multi_modal_uuids_accepts_empty(
135
136 # While None means cached multi-modal input requiring UUIDs
137 # an empty list means no multi-modal input
128 - mm_data = {"image": [], "video": []} # type: ignore[var-annotated]
129 - mm_uuids = {"image": [], "video": None} # type: ignore[var-annotated]
138 + mm_data = {"image": [], "video": [], "audio": None} # type: ignore[var-annotated]
139 + mm_uuids = {"image": [], "video": None, "audio": []} # type: ignore[var-annotated]
140
141 mm_processor = renderer.get_mm_processor()
142 mm_data_items = mm_processor.info.parse_mm_data(mm_data)
vllm/renderers/base.py
+1 -1
@@ -482,7 +482,7 @@ class BaseRenderer(ABC, Generic[_T]):
482 )
483
484 elif uuid_items is not None:
485 - if len(uuid_items) > 0 and len(data_items) != len(uuid_items):
485 + if len(data_items) != len(uuid_items):
486 raise ValueError(
487 f"If given, multi_modal_uuids[{modality!r}] must have "
488 f"same length as multi_modal_data[{modality!r}], but "