@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 4aed0ca6a2
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 15, 14:45 UTC

[bugfix] Avoid the time consumption caused by creating dummy videos. (#16371)

Jintao committed Apr 10, 2025 at 12:30 UTC 4aed0ca6a2de8c56838fe850f8d8f8559074744a
1 file changed +6
vllm/multimodal/profiling.py
+6
@@ -78,6 +78,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
78 length: int,
79 num_audios: int,
80 ) -> list[npt.NDArray]:
81 + if num_audios == 0:
82 + return []
83 audio = np.zeros((length, ))
84 return [audio] * num_audios
85
@@ -88,6 +90,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
90 height: int,
91 num_images: int,
92 ) -> list[Image.Image]:
93 + if num_images == 0:
94 + return []
95 image = Image.new("RGB", (width, height), color=255)
96 return [image] * num_images
97
@@ -99,6 +103,8 @@ class BaseDummyInputsBuilder(ABC, Generic[_I]):
103 num_frames: int,
104 num_videos: int,
105 ) -> list[npt.NDArray]:
106 + if num_videos == 0:
107 + return []
108 video = np.full((num_frames, width, height, 3), 255)
109 return [video] * num_videos
110