Skip to content

Conversation

@ywang96
Copy link
Member

@ywang96 ywang96 commented Sep 29, 2025

Purpose

#25788 Fixed the issue for Qwen3-VL - while we don't know if xformers is going to work with other head sizes, it's not officially supported yet according to facebookresearch/xformers#1317 (comment). Therefore it's probably safer for us to force ViT backend to SDPA for all models on blackwell for now.

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: Roger Wang <hey@rogerw.io>
@ywang96 ywang96 requested a review from sighingnow as a code owner September 29, 2025 04:01
@mergify mergify bot added the qwen Related to Qwen models label Sep 29, 2025
Copy link
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 refactors the ViT attention backend fallback for Blackwell GPUs by moving the logic from a model-specific file (qwen3_vl.py) to the general CUDA platform file (cuda.py). While this is a good architectural improvement, the new implementation in cuda.py has a logical flaw that prevents the fallback from working as intended. I've provided a critical comment with a suggested fix to correct the device capability check order.

@ywang96 ywang96 added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 29, 2025
@ywang96 ywang96 enabled auto-merge (squash) September 29, 2025 04:08
Signed-off-by: Roger Wang <hey@rogerw.io>
@DarkLight1337
Copy link
Member

Perhaps we should link a tracking issue in the code?

@ywang96
Copy link
Member Author

ywang96 commented Sep 29, 2025

Perhaps we should link a tracking issue in the code?

Good point!

Signed-off-by: Roger Wang <hey@rogerw.io>
self.attn_backend = get_vit_attn_backend(
head_size=head_dim, dtype=torch.get_default_dtype())
use_upstream_fa = False
if self.attn_backend != _Backend.FLASH_ATTN and \
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: Does FA has the similar problem in Blackwell? Because this logic may still select upstream FA is available.

Copy link
Member Author

@ywang96 ywang96 Sep 29, 2025

Choose a reason for hiding this comment

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

upstream FA seems okay on blackwell (our user reported that installing upstream FA also fixes the issue, therefore I didn't delete the code here)

@ywang96 ywang96 merged commit 65ecb4f into vllm-project:main Sep 29, 2025
48 checks passed
@DarkLight1337 DarkLight1337 added this to the v0.11.0 Cherry Picks milestone Sep 29, 2025
simon-mo pushed a commit that referenced this pull request Oct 1, 2025
Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: simon-mo <simon.mo@hey.com>
pdasigi pushed a commit to pdasigi/vllm that referenced this pull request Oct 2, 2025
yewentao256 pushed a commit that referenced this pull request Oct 3, 2025
Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: yewentao256 <zhyanwentao@126.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
…t#25851)

Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
…t#25851)

Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: simon-mo <simon.mo@hey.com>
shyeh25 pushed a commit to shyeh25/vllm that referenced this pull request Oct 14, 2025
Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: simon-mo <simon.mo@hey.com>
lywa1998 pushed a commit to lywa1998/vllm that referenced this pull request Oct 20, 2025
alhridoy pushed a commit to alhridoy/vllm that referenced this pull request Oct 24, 2025
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
…t#25851)

Signed-off-by: Roger Wang <hey@rogerw.io>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

qwen Related to Qwen models 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.

4 participants