"docs/vscode:/vscode.git/clone" did not exist on "1b0a15553420e5459d9a8512a3f1bd7d4117db08"
test_cpu_wna16.py 866 Bytes
Newer Older
Li, Jiang's avatar
Li, Jiang committed
1
2
3
4
5
6
7
8
9
10
11
12
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
import pytest

from vllm.platforms import current_platform

if not current_platform.is_cpu():
    pytest.skip("skipping CPU-only tests", allow_module_level=True)

MODELS = [
    "TheBloke/TinyLlama-1.1B-Chat-v1.0-AWQ",
    "TheBloke/TinyLlama-1.1B-Chat-v1.0-GPTQ",  # with g_idx
13
    "Qwen/Qwen1.5-0.5B-Chat-GPTQ-Int4",  # without g_idx
14
    "RedHatAI/Qwen3-1.7B-quantized.w4a16",  # with zp
15
    "OPEA/Qwen2.5-0.5B-Instruct-int4-sym-inc",
Li, Jiang's avatar
Li, Jiang committed
16
17
18
19
20
21
]
DTYPE = ["bfloat16"]


@pytest.mark.parametrize("model", MODELS)
@pytest.mark.parametrize("dtype", DTYPE)
22
def test_cpu_quant(vllm_runner, model, dtype):
Li, Jiang's avatar
Li, Jiang committed
23
24
25
26
    with vllm_runner(model, dtype=dtype) as llm:
        output = llm.generate_greedy(["The capital of France is"], max_tokens=32)
    assert output
    print(output)