@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / c934caee88
Fork 0

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 13, 04:30 UTC

[Fix] improve aspect ratio in dummy image generation and add common VLM tests for PaddleOCR-VL (#28711)

Signed-off-by: dongbo910220 <1275604947@qq.com>

dongbo910220 committed Nov 15, 2025 at 00:07 UTC c934caee88f65258aac00d71d9ae0ecc4a4e1cd7
2 files changed +19 -2
tests/models/multimodal/generation/test_common.py
+18
@@ -12,6 +12,7 @@ import pytest
12 from packaging.version import Version
13 from transformers import (
14 AutoModel,
15 + AutoModelForCausalLM,
16 AutoModelForImageTextToText,
17 AutoModelForTextToWaveform,
18 )
@@ -691,6 +692,23 @@ VLM_TEST_SETTINGS = {
692 patch_hf_runner=model_utils.ovis2_5_patch_hf_runner,
693 hf_model_kwargs={"revision": "refs/pr/5"},
694 ),
695 + "paddleocr_vl": VLMTestInfo(
696 + models=["PaddlePaddle/PaddleOCR-VL"],
697 + test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),
698 + prompt_formatter=lambda img_prompt: f"USER: {img_prompt}\nASSISTANT:",
699 + img_idx_to_prompt=lambda idx: (
700 + "<|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>"
701 + ),
702 + multi_image_prompt=(
703 + "Image-1: <|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>\n"
704 + "Image-2: <|IMAGE_START|><|IMAGE_PLACEHOLDER|><|IMAGE_END|>\n"
705 + "Describe these two images separately."
706 + ),
707 + max_model_len=8192,
708 + max_num_seqs=2,
709 + auto_cls=AutoModelForCausalLM,
710 + image_size_factors=[(), (0.25,)],
711 + ),
712 "phi3v": VLMTestInfo(
713 models=["microsoft/Phi-3.5-vision-instruct"],
714 test_type=(VLMTestType.IMAGE, VLMTestType.MULTI_IMAGE),
vllm/model_executor/models/paddleocr_vl.py
+1 -2
@@ -232,8 +232,7 @@ class PaddleOCRVLProcessingInfo(BaseProcessingInfo):
232 # Find factors of max_num_tokens close to its square root
233 # to create a dummy image with a reasonable aspect ratio.
234 h_patches = int(math.sqrt(max_num_tokens))
235 - while max_num_tokens % h_patches != 0:
236 - h_patches -= 1
235 + max_num_tokens -= max_num_tokens % h_patches
236 w_patches = max_num_tokens // h_patches
237 return ImageSize(height=h_patches * factor, width=w_patches * factor)
238