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 10, 09:00 UTC
[Misc] Make `scipy` as optional audio/benchmark dependency (#32096)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
Isotr0py committed
Jan 11, 2026 at 16:18 UTC
cee7436a26fef900402213f1e0190ea3331048bf
3 files changed
+10
-7
requirements/common.txt
-1
@@ -42,7 +42,6 @@ depyf==0.20.0 # required for profiling and debugging with compilation config
42
cloudpickle # allows pickling lambda functions in model_executor/models/registry.py
43
watchfiles # required for http server to monitor the updates of TLS files
44
python-json-logger # Used by logging as per examples/others/logging_configuration.md
45
-scipy # Required for phi-4-multimodal-instruct
45
ninja # Required for xgrammar, rocm, tpu, xpu
46
pybase64 # fast base64 implementation
47
cbor2 # Required for cross-language serialization of hashable objects
setup.py
+2
-1
@@ -978,12 +978,13 @@ setup(
978
ext_modules=ext_modules,
979
install_requires=get_requirements(),
980
extras_require={
981
- "bench": ["pandas", "matplotlib", "seaborn", "datasets"],
981
+ "bench": ["pandas", "matplotlib", "seaborn", "datasets", "scipy"],
982
"tensorizer": ["tensorizer==2.10.1"],
983
"fastsafetensors": ["fastsafetensors >= 0.1.10"],
984
"runai": ["runai-model-streamer[s3,gcs] >= 0.15.3"],
985
"audio": [
986
"librosa",
987
+ "scipy",
988
"soundfile",
989
"mistral_common[audio]",
990
], # Required for audio processing
vllm/multimodal/audio.py
+8
-5
@@ -27,6 +27,12 @@ try:
27
except ImportError:
28
soundfile = PlaceholderModule("soundfile") # type: ignore[assignment]
29
30
+
31
+try:
32
+ import scipy.signal as scipy_signal
33
+except ImportError:
34
+ scipy_signal = PlaceholderModule("scipy").placeholder_attr("signal") # type: ignore[assignment]
35
+
36
# ============================================================
37
38
@@ -173,13 +179,10 @@ def resample_audio_scipy(
179
orig_sr: float,
180
target_sr: float,
181
):
176
- # lazy import scipy.signal, otherwise it will crash doc build.
177
- import scipy.signal
178
-
182
if orig_sr > target_sr:
180
- return scipy.signal.resample_poly(audio, 1, orig_sr // target_sr)
183
+ return scipy_signal.resample_poly(audio, 1, orig_sr // target_sr)
184
elif orig_sr < target_sr:
182
- return scipy.signal.resample_poly(audio, target_sr // orig_sr, 1)
185
+ return scipy_signal.resample_poly(audio, target_sr // orig_sr, 1)
186
return audio
187
188