From dd424571c8edaf7c68fe4ff400da8ef9f26a1e48 Mon Sep 17 00:00:00 2001 From: Cyrus Leung Date: Wed, 24 Dec 2025 10:15:47 +0800 Subject: [PATCH] [Bugfix] Enable `dynamic_dims` for different embeds shape (#31223) Signed-off-by: DarkLight1337 --- vllm/model_executor/models/audioflamingo3.py | 2 +- vllm/model_executor/models/minicpmv.py | 2 +- vllm/model_executor/models/qwen2_audio.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/vllm/model_executor/models/audioflamingo3.py b/vllm/model_executor/models/audioflamingo3.py index 0ca5f2c4e0a75..3609cc26a4c6b 100644 --- a/vllm/model_executor/models/audioflamingo3.py +++ b/vllm/model_executor/models/audioflamingo3.py @@ -111,7 +111,7 @@ class AudioFlamingo3EmbeddingInputs(TensorSchema): audio_embeds: Annotated[ list[torch.Tensor], - TensorShape("bn", "naf", "hs"), + TensorShape("bn", "naf", "hs", dynamic_dims={"naf"}), ] diff --git a/vllm/model_executor/models/minicpmv.py b/vllm/model_executor/models/minicpmv.py index c45bdf95e7487..930ff737bcdac 100644 --- a/vllm/model_executor/models/minicpmv.py +++ b/vllm/model_executor/models/minicpmv.py @@ -139,7 +139,7 @@ class MiniCPMVImageEmbeddingInputs(TensorSchema): type: Literal["image_embeds"] image_embeds: Annotated[ torch.Tensor | list[torch.Tensor], - TensorShape("bn", "ns", "hs"), + TensorShape("bn", "ns", "hs", dynamic_dims={"ns"}), ] diff --git a/vllm/model_executor/models/qwen2_audio.py b/vllm/model_executor/models/qwen2_audio.py index f84ddfa84f6ab..c97e6873e0d17 100644 --- a/vllm/model_executor/models/qwen2_audio.py +++ b/vllm/model_executor/models/qwen2_audio.py @@ -101,7 +101,7 @@ class Qwen2AudioEmbeddingInputs(TensorSchema): audio_embeds: Annotated[ list[torch.Tensor], - TensorShape("bn", "naf", "hs"), + TensorShape("bn", "naf", "hs", dynamic_dims={"naf"}), ]