test_latency_cli.py 620 Bytes
Newer Older
1
2
3
4
# SPDX-License-Identifier: Apache-2.0
import subprocess

import pytest
5
6
import os
from ..utils import models_path_prefix
7

8
MODEL_NAME = os.path.join(models_path_prefix, "meta-llama/Llama-3.2-1B-Instruct")
9
10
11
12
13
14
15
16
17
18
19
20


@pytest.mark.benchmark
def test_bench_latency():
    command = [
        "vllm", "bench", "latency", "--model", MODEL_NAME, "--input-len", "32",
        "--output-len", "1", "--enforce-eager", "--load-format", "dummy"
    ]
    result = subprocess.run(command, capture_output=True, text=True)
    print(result.stdout)
    print(result.stderr)

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