Skip to content

[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
neuralmagic:lwilkinson/ci-fix-mha
Jan 26, 2026
Merged

[CI] Fix MHA attention test failure (AttributeError when model_config is None in ViT attention backend)#33033
vllm-bot merged 1 commit intovllm-project:mainfrom
neuralmagic:lwilkinson/ci-fix-mha

Conversation

@LucasWilkinson
Copy link
Copy Markdown
Collaborator

@LucasWilkinson LucasWilkinson commented Jan 25, 2026

Fixes AttributeError: 'NoneType' object has no attribute 'multimodal_config' in get_vit_attn_backend() and is_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() and is_vit_use_data_parallel() in vllm/model_executor/models/vision.py that access vllm_config.model_config.multimodal_config. However, the code only catches AssertionError from get_current_vllm_config(), but doesn't handle the case where model_config itself is None.

When tests use the default_vllm_config fixture, get_current_vllm_config() returns a VllmConfig where model_config is None. Accessing .multimodal_config on None raises AttributeError, which isn't caught.

Fix

Added a null check for model_config before accessing multimodal_config:

Test

python -m pytest tests/kernels/attention/test_mha_attn.py::test_mha_attn_varlen_forward[cuda-dtype2-64-1-16-var_seq_len0] -v

Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
@LucasWilkinson LucasWilkinson changed the title [CI] Fix MHA attention test failure [CI] Fix MHA attention test failure (AttributeError when model_config is None in ViT attention backend) Jan 25, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 robertgshaw2-redhat enabled auto-merge (squash) January 25, 2026 16:06
@github-actions github-actions Bot added the ready ONLY add when PR is ready to merge/full CI is needed label Jan 25, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_config before accessing multimodal_config in get_vit_attn_backend() and is_vit_use_data_parallel() functions
  • Prevents AttributeError: 'NoneType' object has no attribute 'multimodal_config' when tests use VllmConfig() without a model_config

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@vllm-bot vllm-bot merged commit 566cdb6 into vllm-project:main Jan 26, 2026
67 of 68 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready ONLY add when PR is ready to merge/full CI is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI Failure]: MultiModal Tests

5 participants