A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 14, 05:30 UTC
[Multimodal] Improve max video embedding length estimation in V1 (#24312)
Signed-off-by: Roger Wang <hey@rogerw.me> Co-authored-by: Roger Wang <hey@rogerw.me>
Roger Wang committed
Sep 6, 2025 at 02:33 UTC
eddaafc1c77b0690194cbd1b73747d572793838c
2 files changed
+2
-8
vllm/model_executor/models/llava_onevision.py
+1
-4
@@ -216,12 +216,9 @@ class LlavaOnevisionProcessingInfo(LlavaNextProcessingInfo):
216
seq_len: int,
217
mm_counts: Mapping[str, int],
218
) -> int:
219
- max_images = mm_counts.get("image", 0)
219
max_videos = mm_counts.get("video", 0)
220
222
- max_image_tokens = self.get_max_image_tokens() * max_images
223
- max_total_frames = self._get_max_video_frames(seq_len -
224
- max_image_tokens)
221
+ max_total_frames = self._get_max_video_frames(seq_len)
222
max_frames_per_video = min(max_total_frames // max(max_videos, 1),
223
_MAX_FRAMES_PER_VIDEO)
224
vllm/model_executor/models/qwen2_vl.py
+1
-4
@@ -915,12 +915,9 @@ class Qwen2VLProcessingInfo(BaseProcessingInfo):
915
seq_len: int,
916
mm_counts: Mapping[str, int],
917
) -> int:
918
- max_images = mm_counts.get("image", 0)
918
max_videos = mm_counts.get("video", 0)
919
921
- max_image_tokens = self.get_max_image_tokens() * max_images
922
- max_total_frames = self._get_max_video_frames(seq_len -
923
- max_image_tokens)
920
+ max_total_frames = self._get_max_video_frames(seq_len)
921
max_frames_per_video = min(max_total_frames // max(max_videos, 1),
922
_MAX_FRAMES_PER_VIDEO)
923