[Bugfix][EPD] Preserve explicit multimodal UUIDs with caches disabled (#56432)

Signed-off-by: Tianyu Guo <guoty@inferact.ai>
This commit is contained in:
Tianyu Guo
2026-09-13 10:08:30 +00:00
committed by GitHub
parent d2d649e674
commit fa1b3b1922
2 changed files with 38 additions and 26 deletions
@@ -176,9 +176,32 @@ def test_multi_modal_uuids_accepts_empty(
assert processed_mm_uuids == mm_uuids
def test_multi_modal_uuids_ignored_when_caching_disabled():
# When both processor cache is 0 and prefix caching disabled, the
# processor builds overrides from request id instead of using user UUIDs.
@pytest.mark.parametrize(
"mm_uuids, expected",
[
(
{"image": ["hash_cherry", "hash_stop"], "video": ["hash_video"]},
{"image": ["hash_cherry", "hash_stop"], "video": ["hash_video"]},
),
(
{"image": [None, "hash_stop"], "video": None},
{"image": ["req-42-image-0", "hash_stop"], "video": ["req-42-video-0"]},
),
(
{"image": ["", None]},
{"image": ["", "req-42-image-1"], "video": ["req-42-video-0"]},
),
(
{},
{
"image": ["req-42-image-0", "req-42-image-1"],
"video": ["req-42-video-0"],
},
),
],
)
def test_multi_modal_uuids_preserved_when_caching_disabled(mm_uuids, expected):
"""Only missing UUIDs get request-local IDs when both caches are disabled."""
renderer = _build_renderer(mm_cache_gb=0.0, enable_prefix_caching=False)
request_id = "req-42"
@@ -186,7 +209,6 @@ def test_multi_modal_uuids_ignored_when_caching_disabled():
"image": [cherry_pil_image, stop_pil_image],
"video": baby_reading_np_ndarrays,
}
mm_uuids = {"image": ["hash_cherry", "hash_stop"], "video": ["hash_video"]}
mm_processor = renderer.get_mm_processor()
mm_data_items = mm_processor.info.parse_mm_data(mm_data)
@@ -196,16 +218,4 @@ def test_multi_modal_uuids_ignored_when_caching_disabled():
mm_data, mm_data_items, mm_uuid_items, request_id
)
# Expect request-id-based overrides are passed through
assert set(mm_uuids.keys()) == {"image", "video"}
assert len(mm_uuids["image"]) == 2
assert len(mm_uuids["video"]) == 1
assert processed_mm_uuids["image"][0].startswith(
f"{request_id}-image-"
) and processed_mm_uuids["image"][0].endswith("-0")
assert processed_mm_uuids["image"][1].startswith(
f"{request_id}-image-"
) and processed_mm_uuids["image"][1].endswith("-1")
assert processed_mm_uuids["video"][0].startswith(
f"{request_id}-video-"
) and processed_mm_uuids["video"][0].endswith("-0")
assert processed_mm_uuids == expected