Skip to content

[Bugfix] Fix check_interleaved_audio_video false positive for batched non-interleaved requests#35487

Merged
vllm-bot merged 3 commits intovllm-project:mainfrom
linyueqian:fix/qwen_omni_interleaved_density_check
Feb 27, 2026
Merged

[Bugfix] Fix check_interleaved_audio_video false positive for batched non-interleaved requests#35487
vllm-bot merged 3 commits intovllm-project:mainfrom
linyueqian:fix/qwen_omni_interleaved_density_check

Conversation

@linyueqian
Copy link
Copy Markdown
Contributor

Fixes #35394.

Problem

check_interleaved_audio_video used a simple range-overlap check to detect the use_audio_in_video=True case. This produces a false positive when multiple non-interleaved requests are batched together: audio tokens from request N fall between video tokens of request N and request N+1, making global position ranges overlap even though each individual request is non-interleaved.

The false positive caused embed_input_ids to route to merge_interleaved_embeddings, which then crashed with a shape mismatch because mm_embeds were assembled for the non-interleaved path.

Fix

Add a density check: for true use_audio_in_video interleaving, every position in the combined V/A span is a video or audio token (no gaps). Batched non-interleaved requests have text/image tokens at batch boundaries that create gaps.

Both Qwen2.5-Omni and Qwen3-Omni are covered since qwen3_omni_moe_thinker.py imports check_interleaved_audio_video from qwen2_5_omni_thinker.py.

Test

Added test_batched_non_interleaved_no_false_positive to the existing test file, which batches 5 identical non-interleaved mixed-modality requests and asserts the function correctly returns False.

…rleaved requests

Signed-off-by: linyueqian <linyueqian@outlook.com>
@mergify mergify Bot added multi-modality Related to multi-modality (#4194) qwen Related to Qwen models bug Something isn't working labels Feb 27, 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 addresses a bug in check_interleaved_audio_video that caused false positives for batched non-interleaved requests, which could lead to a crash. The fix correctly introduces a density check to ensure that a truly interleaved sequence has no gaps in its combined audio/video token span. The addition of a regression test validates this behavior. The overall change is correct and effective. I have included one suggestion to optimize the new density check for improved efficiency and clarity.

Comment thread vllm/model_executor/models/qwen2_5_omni_thinker.py Outdated
Copy link
Copy Markdown
Member

@ywang96 ywang96 left a comment

Choose a reason for hiding this comment

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

Thanks for fixing!

@ywang96 ywang96 added the ready ONLY add when PR is ready to merge/full CI is needed label Feb 27, 2026
@ywang96 ywang96 enabled auto-merge (squash) February 27, 2026 08:47
@vllm-bot vllm-bot merged commit e824937 into vllm-project:main Feb 27, 2026
50 of 53 checks passed
EanWang211123 pushed a commit to EanWang211123/vllm that referenced this pull request Mar 2, 2026
… non-interleaved requests (vllm-project#35487)

Signed-off-by: linyueqian <linyueqian@outlook.com>
Co-authored-by: Roger Wang <hey@rogerw.io>
Signed-off-by: EanWang211123 <wangyiheng@sangfor.com.cn>
Copilot AI pushed a commit to machov/vllm that referenced this pull request Mar 10, 2026
… non-interleaved requests (vllm-project#35487)

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

Labels

bug Something isn't working multi-modality Related to multi-modality (#4194) 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.

[Bug]: Qwen3-Omni Fails Under Mixed-Modality Requests at Concurrency 5

3 participants