diff --git a/tests/e2e/vLLM/test_vllm.py b/tests/e2e/vLLM/test_vllm.py index f352a6772..988793849 100644 --- a/tests/e2e/vLLM/test_vllm.py +++ b/tests/e2e/vLLM/test_vllm.py @@ -1,9 +1,10 @@ import shutil import unittest +from typing import Callable import pytest from datasets import load_dataset -from parameterized import parameterized_class +from parameterized import parameterized, parameterized_class from transformers import AutoTokenizer from llmcompressor.modifiers.quantization import QuantizationModifier @@ -32,10 +33,22 @@ CONFIGS = [WNA16, FP8, INT8, ACTORDER, WNA16_2of4] +def gen_test_name(testcase_func: Callable, param_num: int, param: dict) -> str: + return "_".join( + [ + testcase_func.__name__, + parameterized.to_safe_name( + param.get("testconfig_path", "").split("configs/")[-1] + ), + param.get("cadence", "").lower(), + ] + ) + + @requires_gpu @requires_torch @pytest.mark.skipif(not vllm_installed, reason="vLLM is not installed, skipping test") -@parameterized_class(parse_params(CONFIGS)) +@parameterized_class(parse_params(CONFIGS), class_name_func=gen_test_name) class TestvLLM(unittest.TestCase): """ The following test quantizes a model using a preset scheme or recipe, diff --git a/tests/testing_utils.py b/tests/testing_utils.py index 1f3a15326..faed0da6d 100644 --- a/tests/testing_utils.py +++ b/tests/testing_utils.py @@ -81,10 +81,13 @@ def _parse_configs_dir(current_config_dir): ), f"Config_directory {current_config_dir} is not a directory" for file in os.listdir(current_config_dir): - config = _load_yaml(os.path.join(current_config_dir, file)) + config_path = os.path.join(current_config_dir, file) + config = _load_yaml(config_path) if not config: continue + config["testconfig_path"] = config_path + cadence = os.environ.get("CADENCE", "commit") expected_cadence = config.get("cadence")