Skip to content

[Bugfix] Enable dynamic_dims for different embeds shape - #31223

Merged
DarkLight1337 merged 1 commit into
vllm-project:mainfrom
DarkLight1337:fix-dynamic-dims
Dec 24, 2025
Merged

DarkLight1337 merged 1 commit into
vllm-project:mainfrom
DarkLight1337:fix-dynamic-dims

Conversation

@DarkLight1337

@DarkLight1337 DarkLight1337 commented Dec 23, 2025 •

Copy link
Copy Markdown
Member

Purpose

Without setting dynamic_dims, setting list[torch.Tensor] doesn't actually enable tensors with different shape.

FIX #31219

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: DarkLight1337 <tlleungac@connect.ust.hk>
@DarkLight1337 DarkLight1337 added ready ONLY add when PR is ready to merge/full CI is needed multi-modality Related to multi-modality (#4194) labels Dec 23, 2025
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.

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

Copy link
Copy Markdown
Contributor

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 introduces a bugfix to enable dynamic dimension shapes for embeddings in several multimodal models, including AudioFlamingo3, MiniCPMV, and Qwen2Audio. The changes correctly utilize the dynamic_dims parameter within TensorShape annotations. This allows for variable-length feature sequences (e.g., number of audio features or image slices) across different items in a batch, which is crucial for robustly handling diverse multimodal inputs. The modifications are consistent, targeted, and correctly implemented according to the TensorSchema API. The pull request effectively addresses the issue of rigid shape validation for multimodal embeddings.

@DarkLight1337
DarkLight1337 merged commit dd42457 into vllm-project:main Dec 24, 2025
55 of 57 checks passed
@DarkLight1337
DarkLight1337 deleted the fix-dynamic-dims branch December 24, 2025 02:15
yiliu30 pushed a commit to yiliu30/vllm-fork that referenced this pull request Dec 30, 2025
…ct#31223)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
mystous pushed a commit to mystous/vllm_hybrid that referenced this pull request May 10, 2026
…ct#31223)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
my-other-github-account pushed a commit to my-other-github-account/vllm that referenced this pull request May 15, 2026
…ct#31223)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
0826joyce pushed a commit to 0826joyce/vllm-serving-optimization that referenced this pull request May 19, 2026
…ct#31223)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
he-yufeng added a commit to he-yufeng/vllm that referenced this pull request May 21, 2026
Gemma3nAudioInputs declares input_features_padded and
input_features_mask with fixed sequence-length dimensions. When two
concurrent requests carry audio clips of different durations,
TensorSchema.validate() sees mismatched shapes and kills EngineCore
with a ValueError.

Mark the sequence-length dimension as dynamic so the validator allows
variable-length audio inputs in the same batch, matching the pattern
used by MiniCPM-o, Qwen2Audio, and AudioFlamingo3 (PR vllm-project#31223).

Fixes vllm-project#38297

Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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]: Concurrent requests with audio_embeds of different lengths crash EngineCore: "audio_embeds contains inconsistent shapes"

2 participants