Add user_vision_size in VLM's get_specializations for chunked embedding in vLLM v1#996
Draft
quic-xiyushi wants to merge 1 commit into
Draft
Add user_vision_size in VLM's get_specializations for chunked embedding in vLLM v1#996quic-xiyushi wants to merge 1 commit into
quic-xiyushi wants to merge 1 commit into
Conversation
… in vLLM v1 Signed-off-by: quic-xiyushi <xiyushi@qti.qualcomm.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.
Background
vLLM v1 introduces chunked prefill with encoder cache, where the model runner processes requests in scheduled token windows. For each window:
Overlap detection determines which multimodal embeddings are required
Only the relevant sub-tensors are gathered and used
From a QEfficient perspective, this is analogous to:
Additionally, v1 eliminates the strict prefill/decode distinction, allowing:
However, if we reuse the full vision embedding for every prefill chunk, which is what currently QEfficient supports, this:
Proposal
This PR proposes adding user_vision_size to get_specializations for VLM models, with the following scope:
✅ Apply to all current VLM models
❌ Exclude mllama due to it's cross attention
❌ Exclude molmo (not yet supported in vLLM on QAIC, not sure about how the team is going to support it)
For models onboarded by QEfficient in the future, it should also follow the same way to enable user_vision_size.
Benefits
This change enables:
✅ In vLLM v1, align vision embedding size with prefill sequence length and enable efficient chunked prefill for multimodal inputs
✅ Better alignment with vLLM v1 scheduling model
✅ Reduced overhead from repeated large buffer updates
✅ Easier support for multi-resolution input and multiple images per request
Release Plan
🚫 Not intended for 1.21 release
✅ Target release: 1.22
This draft PR is currently based on the 1.21.6 branch because multi-resolution and multi-frame support for Qwen2.5-VL / Qwen3-VL is only available in that branch, and these features are prerequisites for this change
Next Steps
Once multi-resolution and multi-frame support are available in the QEfficient main branch, this PR will be rebased and migrated to the main branch.