[CI] Fix MHA attention test failure (AttributeError when model_config is None in ViT attention backend)#33033
Merged
vllm-bot merged 1 commit intovllm-project:mainfrom Jan 26, 2026
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request effectively addresses an AttributeError that occurred when model_config was None within get_vit_attn_backend() and is_vit_use_data_parallel() functions. The implemented null checks for model_config before accessing multimodal_config correctly resolve the issue, preventing potential crashes and improving the robustness of the system.
robertgshaw2-redhat
approved these changes
Jan 25, 2026
3 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an AttributeError that occurs when model_config is None in ViT attention backend functions, particularly affecting tests that use the default_vllm_config fixture.
Changes:
- Added null checks for
model_configbefore accessingmultimodal_configinget_vit_attn_backend()andis_vit_use_data_parallel()functions - Prevents
AttributeError: 'NoneType' object has no attribute 'multimodal_config'when tests useVllmConfig()without amodel_config
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Isotr0py
approved these changes
Jan 26, 2026
apd10
pushed a commit
to apd10/vllm
that referenced
this pull request
Jan 31, 2026
… is None in ViT attention backend) (vllm-project#33033) Signed-off-by: Lucas Wilkinson <lwilkins@redhat.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.
Fixes
AttributeError: 'NoneType' object has no attribute 'multimodal_config'inget_vit_attn_backend()andis_vit_use_data_parallel()functions.Breaking Commit:
9ad7f89f5- [Models]: Make Multimodal config implicit in ViT implementation (#31972)FIX #33028
Root Cause
The breaking commit introduced new functions
get_vit_attn_backend()andis_vit_use_data_parallel()invllm/model_executor/models/vision.pythat accessvllm_config.model_config.multimodal_config. However, the code only catchesAssertionErrorfromget_current_vllm_config(), but doesn't handle the case wheremodel_configitself isNone.When tests use the
default_vllm_configfixture,get_current_vllm_config()returns aVllmConfigwheremodel_configisNone. Accessing.multimodal_configonNoneraisesAttributeError, which isn't caught.Fix
Added a null check for
model_configbefore accessingmultimodal_config:Test