| 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 | MODEL_NAME = "meta-llama/Llama-3.2-1B-Instruct" |
| 8 | |
| 9 | |
| 10 | @pytest.mark.benchmark |
| 11 | def test_bench_latency(): |
| 12 | command = [ |
| 13 | "vllm", |
| 14 | "bench", |
| 15 | "latency", |
| 16 | "--model", |
| 17 | MODEL_NAME, |
| 18 | "--input-len", |
| 19 | "32", |
| 20 | "--output-len", |
| 21 | "1", |
| 22 | "--enforce-eager", |
| 23 | "--load-format", |
| 24 | "dummy", |
| 25 | ] |
| 26 | result = subprocess.run(command, capture_output=True, text=True) |
| 27 | print(result.stdout) |
| 28 | print(result.stderr) |
| 29 | |
| 30 | assert result.returncode == 0, f"Benchmark failed: {result.stderr}" |