test_throughput_cli.py 778 Bytes
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
import subprocess

5
import os
6
7
import pytest

8
9
10
from ..utils import  models_path_prefix

MODEL_NAME = os.path.join(models_path_prefix, "meta-llama/Llama-3.2-1B-Instruct")
11
12
13
14
15


@pytest.mark.benchmark
def test_bench_throughput():
    command = [
16
17
18
19
20
21
22
23
24
25
26
27
        "vllm",
        "bench",
        "throughput",
        "--model",
        MODEL_NAME,
        "--input-len",
        "32",
        "--output-len",
        "1",
        "--enforce-eager",
        "--load-format",
        "dummy",
28
29
30
31
32
    ]
    result = subprocess.run(command, capture_output=True, text=True)
    print(result.stdout)
    print(result.stderr)

33
    assert result.returncode == 0, f"Benchmark failed: {result.stderr}"