-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
[Bugfix][Multimodal] Bind client-provided UUIDs to item content size in cache keys #55549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AbroadConfirm
wants to merge
1
commit into
vllm-project:main
Choose a base branch
from
AbroadConfirm:fix/mm-uuid-content-binding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+116
−8
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,8 +99,27 @@ def get_mm_hashes( | |
| ) | ||
| ) | ||
| else: | ||
| # If there are no extra kwargs, use the client-provided UUID. | ||
| hashes.append(uuid_item) | ||
| # Bind the client-provided UUID to the item's content | ||
| # size so that reusing a UUID for a different payload | ||
| # cannot serve stale cached features: that yields silent | ||
| # wrong output when the processed lengths happen to | ||
| # match, and a fatal engine failure when they do not | ||
| # (#55547). Falls back to trusting the UUID as-is when | ||
| # no size discriminator is available. | ||
| content_size = data_items.get_item_content_size(i) | ||
| if content_size is not None: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix makes sense. But since the client is responsible for generating correct UUIDs, I prefer loudly rejecting the request by raising a validation error rather than silently changing the UUID |
||
| hashes.append( | ||
| hasher.hash_kwargs( | ||
| hash_algorithm, | ||
| model_id=model_id, | ||
| modality=modality, | ||
| mm_uuid=uuid_item, | ||
| mm_content_size=content_size, | ||
| ) | ||
| ) | ||
| else: | ||
| # If there are no extra kwargs, use the client-provided UUID. | ||
| hashes.append(uuid_item) | ||
|
|
||
| mm_hashes[modality] = hashes | ||
|
|
||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Bind UUIDs to content size when hash factors exist.
When
has_hash_factorsis true, execution takes the branch before Line 109. That branch hashes the UUID and configuration but omitsmm_content_size. Two differently sized items with the same UUID and identical options then get the same cache key. This can reuse stale features and preserve the merge failure this change must prevent.For every non-
NoneUUID, includemm_content_sizewhen it is available, together withhash_factors. Keep the raw UUID fallback only when no discriminator and no hash factors exist. Add a regression test with identical non-empty options and different item sizes.🤖 Prompt for AI Agents