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
resolve pydantic error in startup benchmark (#31348)
Signed-off-by: Andy Xie <andy.xning@gmail.com>
Ning Xie committed
Jan 10, 2026 at 10:41 UTC
abd9224280784b5496f24138b3f84cadefc47c5d
2 files changed
+21
-7
tests/benchmarks/test_bench_startup.py
new
+19
@@ -0,0 +1,19 @@
1
+# SPDX-License-Identifier: Apache-2.0
2
+# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
+import subprocess
4
+
5
+import pytest
6
+
7
+
8
+@pytest.mark.benchmark
9
+def test_bench_startup():
10
+ command = [
11
+ "vllm",
12
+ "bench",
13
+ "startup",
14
+ ]
15
+ result = subprocess.run(command, capture_output=True, text=True)
16
+ print(result.stdout)
17
+ print(result.stderr)
18
+
19
+ assert result.returncode == 0, f"Benchmark failed: {result.stderr}"
vllm/benchmarks/startup.py
+2
-7
@@ -55,7 +55,7 @@ def cold_startup():
55
os.environ.pop("VLLM_CACHE_ROOT", None)
56
57
58
-def run_startup_in_subprocess(engine_args_dict, result_queue):
58
+def run_startup_in_subprocess(engine_args, result_queue):
59
"""
60
Run LLM startup in a subprocess and return timing metrics via a queue.
61
This ensures complete isolation between iterations.
@@ -63,9 +63,6 @@ def run_startup_in_subprocess(engine_args_dict, result_queue):
63
try:
64
# Import inside the subprocess to avoid issues with forking
65
from vllm import LLM
66
- from vllm.engine.arg_utils import EngineArgs
67
-
68
- engine_args = EngineArgs(**engine_args_dict)
66
67
# Measure total startup time
68
start_time = time.perf_counter()
@@ -200,15 +197,13 @@ def main(args: argparse.Namespace):
197
Create LLM instance in a subprocess and measure startup time.
198
Returns timing metrics, using subprocess for complete isolation.
199
"""
203
- # Convert engine_args to dictionary for pickling
204
- engine_args_dict = dataclasses.asdict(engine_args)
200
201
# Create a queue for inter-process communication
202
result_queue = multiprocessing.Queue()
203
process = multiprocessing.Process(
204
target=run_startup_in_subprocess,
205
args=(
211
- engine_args_dict,
206
+ engine_args,
207
result_queue,
208
),
209
)