test_experts_int8.py 954 Bytes
Newer Older
1
2
3
4
5
# flake8: noqa
"""Tests experts_int8 quantization startup and generation, 
doesn't test correctness
"""
import pytest
6
import os
7
8

from tests.quantization.utils import is_quant_method_supported
9
from ..utils import models_path_prefix
zhuwenwen's avatar
zhuwenwen committed
10
from vllm.utils import is_hip
11

12
MODELS = [os.path.join(models_path_prefix, "ai21labs/Jamba-tiny-random")]
13
14


zhuwenwen's avatar
zhuwenwen committed
15
@pytest.mark.skipif(not is_quant_method_supported("experts_int8") or is_hip(),
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
                    reason="ExpertsInt8 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_experts_int8_startup(
    hf_runner,
    vllm_runner,
    example_prompts,
    model: str,
    dtype: str,
    max_tokens: int,
) -> None:

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