"tests/entrypoints/pooling/classify/test_offline.py" did not exist on "a8b0361c9229c2584eea0a035e650e55e2d52f4e"
test_rtn.py 979 Bytes
Newer Older
1
# SPDX-License-Identifier: Apache-2.0
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
4
5
6
7
8
9
10
# Copyright © 2025, Oracle and/or its affiliates.
"""Tests RTN quantization startup and generation, 
doesn't test correctness
"""
import pytest

from tests.quantization.utils import is_quant_method_supported

11
12
13
14
MODELS = [
    "microsoft/Phi-3-mini-4k-instruct",  # dense model
    "ai21labs/Jamba-tiny-dev",  # MoE model
]
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32


@pytest.mark.skipif(not is_quant_method_supported("rtn"),
                    reason="RTN is not supported on this GPU type.")
@pytest.mark.parametrize("model", MODELS)
@pytest.mark.parametrize("dtype", ["bfloat16"])
@pytest.mark.parametrize("max_tokens", [10])
def test_model_rtn_startup(
    hf_runner,
    vllm_runner,
    example_prompts,
    model: str,
    dtype: str,
    max_tokens: int,
) -> None:

    with vllm_runner(model, dtype=dtype, quantization="rtn") as vllm_model:
        vllm_model.generate_greedy(example_prompts, max_tokens)