[CI/Build] Add is_quant_method_supported to control quantization test configurations (#5253)

This commit is contained in:
Michael Goin
2024-06-12 09:58:02 -07:00
committed by GitHub
parent 8f89d72090
commit 3dd6853bc8
8 changed files with 30 additions and 68 deletions
+2 -11
View File
@@ -13,20 +13,11 @@ Run `pytest tests/models/test_marlin.py`.
from dataclasses import dataclass
import pytest
import torch
from vllm.model_executor.layers.quantization import QUANTIZATION_METHODS
from tests.quantization.utils import is_quant_method_supported
from .utils import check_logprobs_close
marlin_not_supported = True
if torch.cuda.is_available():
capability = torch.cuda.get_device_capability()
capability = capability[0] * 10 + capability[1]
marlin_not_supported = (
capability < QUANTIZATION_METHODS["marlin"].get_min_capability())
@dataclass
class ModelPair:
@@ -45,7 +36,7 @@ model_pairs = [
@pytest.mark.flaky(reruns=2)
@pytest.mark.skipif(marlin_not_supported,
@pytest.mark.skipif(not is_quant_method_supported("marlin"),
reason="Marlin is not supported on this GPU type.")
@pytest.mark.parametrize("model_pair", model_pairs)
@pytest.mark.parametrize("dtype", ["half"])