[Bugfix]: resolve torch.compile cache conflict between mm_encoder_tp_modes#32842
Merged
DarkLight1337 merged 1 commit intovllm-project:mainfrom Jan 24, 2026
Merged
Conversation
Member
Signed-off-by: Hongjian Zhang <zhanghongjian@xiaohongshu.com> Signed-off-by: Xingran Wang <wangxingran123456@outlook.com> Co-authored-by: Xingran Wang <wangxingran123456@outlook.com>
auto-merge was automatically disabled
January 24, 2026 12:52
Head branch was pushed to by a user without write access
f059fee to
4ff69ba
Compare
Isotr0py
approved these changes
Jan 24, 2026
ms1design
pushed a commit
to ms1design/vllm
that referenced
this pull request
Jan 24, 2026
…modes (vllm-project#32842) Signed-off-by: Hongjian Zhang <zhanghongjian@xiaohongshu.com> Signed-off-by: Xingran Wang <wangxingran123456@outlook.com> Co-authored-by: Xingran Wang <wangxingran123456@outlook.com> Signed-off-by: Mieszko Syty <mieszko@ms1design.pl>
cwazai
pushed a commit
to cwazai/vllm
that referenced
this pull request
Jan 25, 2026
…modes (vllm-project#32842) Signed-off-by: Hongjian Zhang <zhanghongjian@xiaohongshu.com> Signed-off-by: Xingran Wang <wangxingran123456@outlook.com> Co-authored-by: Xingran Wang <wangxingran123456@outlook.com> Signed-off-by: 陈建华 <1647430658@qq.com>
ItzDEXX
pushed a commit
to ItzDEXX/vllm
that referenced
this pull request
Feb 19, 2026
…modes (vllm-project#32842) Signed-off-by: Hongjian Zhang <zhanghongjian@xiaohongshu.com> Signed-off-by: Xingran Wang <wangxingran123456@outlook.com> Co-authored-by: Xingran Wang <wangxingran123456@outlook.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
PR #23207 introduced torch compile support for the ViT part of Qwen2.5-VL. This PR addresses an issue where enabling
torch.compilefor the vision encoder (--compilation-config '{"compile_mm_encoder": true}') caused crashes when switching between--mm-encoder-tp-mode "weights"and--mm-encoder-tp-mode "data".The Problem:
vLLM uses
VllmConfig.compute_hash()to identify unique configurations for caching compiled graphs. However,mm_encoder_tp_modewas missing from this hash calculation. As a result, running the model withweightsmode generated a cache thatdatamode would try to reuse (or vice versa). Since these modes result in different tensor shapes/strides for the ViT, this caused anAssertionErrorin the generated Inductor kernels.The Solution:
vllm/config/multimodal.py: Addedmm_encoder_tp_modeto the factors used inMultiModalConfig.compute_hash().vllm/config/vllm.py: ModifiedVllmConfig.compute_hash()to explicitly include themultimodal_confighash if and only ifcompile_mm_encoderis enabled. This ensures correct cache isolation without affecting the hash for non-compiled runs.Related Error Log
Test Plan
Test Result
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.