[Bugfix][Multimodal] Scope cache hash kwargs by modality - #54918
Merged
DarkLight1337 merged 1 commit intoSep 2, 2026
Merged
Conversation
waizuichougou
requested review from
DarkLight1337,
NickLucche,
shen-shanshan,
tjtanaa and
ywang96
as code owners
September 2, 2026 07:55
Signed-off-by: waizuichougou <2082431897@qq.com>
waizuichougou
force-pushed
the
fix/multimodal-cache-kwargs-by-modality
branch
from
September 2, 2026 08:00
3c6b743 to
1d9443a
Compare
DarkLight1337
enabled auto-merge (squash)
September 2, 2026 08:07
Member
|
/ci run |
|
✅ Triggered Buildkite CI #86823 for commit |
Contributor
Author
|
/ci retry |
|
✅ Queued 1 failed job(s) for retry in Buildkite CI #86823. |
mylibrar
pushed a commit
to tanyuqian/vllm
that referenced
this pull request
Sep 3, 2026
…t#54918) Signed-off-by: waizuichougou <2082431897@qq.com>
sheralskumar
pushed a commit
to sheralskumar/vllm
that referenced
this pull request
Sep 8, 2026
…t#54918) Signed-off-by: waizuichougou <2082431897@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Fix unnecessary multimodal processor cache misses caused by unrelated
modality options being included in every media item's cache hash.
The production trigger chain is:
get_mm_hashes()currently builds one global hash-factor dictionary containingall
media_io_kwargsand all HF processor kwargs, then applies it to everymodality. Consequently, a video-only option changes an image hash. For
example, an image-only request can inherit:
--media-io-kwargs '{"video":{"num_frames":16}}'With multimodal processor caching enabled, repeating that request needlessly
reprocesses the image. The same issue occurs in mixed image/video requests:
changing
num_framesorvideos_kwargsinvalidates the image cache entry.This is a real online performance and latency bug; it does not independently
change model output.
This change scopes hash factors for ordinary modalities:
imageuses only imagemedia_io_kwargsandimages_kwargs;videouses only videomedia_io_kwargsandvideos_kwargs;audiouses only audiomedia_io_kwargsandaudio_kwargs;vision_chunkremains conservative because one list can contain both imagesand videos and
ProcessorInputsdoes not currently carry each item's originalmodality. It may still have extra cache misses, but this change does not create
incorrect cache reuse.
Test Plan
Run the focused multimodal processing and renderer hash tests:
Run lint, formatting, and whitespace checks:
The regression tests compare identical media with changed modality-specific
options. They verify that changing video options preserves the image hash,
changing image options preserves the video hash, and video-only options are
ignored for an image-only request.
Test Result
The focused tests demonstrate the expected behavior at the hash boundary used
by the production cache. No media decoding or model inference semantics are
changed.
AI-assisted contribution
This contribution was developed with AI assistance.
Essential Elements of an Effective PR Description Checklist
hash fix.