[ROCm][CI] Skip Quark mxfp4 tests unless Quark version is compatible with Torch version (#46431)
Signed-off-by: Micah Williamson <micah.williamson@amd.com>
This commit is contained in:
@@ -9,16 +9,30 @@ pytest -s -v tests/evals/gsm8k/test_gsm8k_correctness.py \
|
||||
--config-list-file=configs/models-small.txt
|
||||
"""
|
||||
|
||||
import importlib.metadata
|
||||
import shlex
|
||||
from importlib.util import find_spec
|
||||
|
||||
import pytest
|
||||
import torch
|
||||
import yaml
|
||||
from packaging import version
|
||||
|
||||
from tests.utils import RemoteOpenAIServer
|
||||
from vllm.platforms import current_platform
|
||||
|
||||
from .gsm8k_eval import evaluate_gsm8k
|
||||
|
||||
# MXFP4 via quark requires amd-quark >= 0.12 on torch >= 2.11.
|
||||
# Earlier torch releases work with older quark versions. See
|
||||
# https://github.com/amd/Quark/issues/34
|
||||
# TODO: Remove once amd-quark>=0.12.0
|
||||
QUARK_MXFP4_TORCH_COMPATIBLE = find_spec("quark") is not None and (
|
||||
version.parse(importlib.metadata.version("amd-quark")) >= version.parse("0.12.0")
|
||||
if version.parse(torch.__version__.split("+")[0]) >= version.parse("2.11")
|
||||
else True
|
||||
)
|
||||
|
||||
|
||||
def run_gsm8k_eval(eval_config: dict, server_url: str) -> dict:
|
||||
"""Run GSM8K evaluation using our isolated script."""
|
||||
@@ -88,16 +102,19 @@ def test_gsm8k_correctness(config_filename):
|
||||
"Skipping DeepSeek-V3.2 and DeepSeek-R1 on ROCm platforms "
|
||||
"due to agent pool disk space issues and pod evictions."
|
||||
)
|
||||
if current_platform.is_rocm() and (
|
||||
"Qwen3.5-35B-A3B-MXFP4-AITER-TP2" in config_filename.name
|
||||
):
|
||||
if current_platform.is_rocm() and ("Qwen3.5-35B-A3B-MXFP4" in config_filename.name):
|
||||
from vllm.platforms.rocm import on_gfx950
|
||||
|
||||
if not on_gfx950():
|
||||
if not on_gfx950() and "AITER-TP2" in config_filename.name:
|
||||
pytest.skip(
|
||||
"Skipping Qwen3.5-35B-A3B-MXFP4-AITER-TP2 on non-GFX950 platforms. "
|
||||
"The quantization scheme is not supported on non-GFX950 platforms."
|
||||
)
|
||||
if not QUARK_MXFP4_TORCH_COMPATIBLE:
|
||||
pytest.skip(
|
||||
"Skipping Qwen3.5-35B-A3B-MXFP4: amd-quark >= 0.12 is required "
|
||||
"on torch >= 2.11."
|
||||
)
|
||||
# Parse server arguments from config (use shlex to handle quoted strings)
|
||||
server_args_str = eval_config.get("server_args", "")
|
||||
server_args = shlex.split(server_args_str) if server_args_str else []
|
||||
|
||||
@@ -13,9 +13,15 @@ from vllm._aiter_ops import is_aiter_found
|
||||
from vllm.platforms import current_platform
|
||||
from vllm.utils.flashinfer import has_flashinfer
|
||||
|
||||
QUARK_MXFP4_AVAILABLE = find_spec("quark") is not None and version.parse(
|
||||
importlib.metadata.version("amd-quark")
|
||||
) >= version.parse("0.8.99")
|
||||
# MXFP4 via quark requires amd-quark >= 0.12 on torch >= 2.11.
|
||||
# Earlier torch releases work with older quark versions. See
|
||||
# https://github.com/amd/Quark/issues/34
|
||||
# TODO: Remove once amd-quark>=0.12.0
|
||||
QUARK_MXFP4_TORCH_COMPATIBLE = find_spec("quark") is not None and (
|
||||
version.parse(importlib.metadata.version("amd-quark")) >= version.parse("0.12.0")
|
||||
if version.parse(torch.__version__.split("+")[0]) >= version.parse("2.11")
|
||||
else True
|
||||
)
|
||||
|
||||
TRTLLM_GEN_MXFP4_AVAILABLE = (
|
||||
current_platform.is_cuda() and current_platform.is_device_capability_family(100)
|
||||
@@ -87,7 +93,10 @@ def enable_pickle(monkeypatch):
|
||||
ModelCase("fxmarty/Llama-3.1-70B-Instruct-2-layers-mxfp6", tp=4),
|
||||
],
|
||||
)
|
||||
@pytest.mark.skipif(not QUARK_MXFP4_AVAILABLE, reason="amd-quark>=0.9 is not available")
|
||||
@pytest.mark.skipif(
|
||||
not QUARK_MXFP4_TORCH_COMPATIBLE,
|
||||
reason="MXFP4 via quark requires amd-quark >= 0.12 on torch >= 2.11.",
|
||||
)
|
||||
def test_mxfp4_loading_and_execution_moe(vllm_runner, model_case: ModelCase):
|
||||
if torch.accelerator.device_count() < model_case.tp:
|
||||
pytest.skip(
|
||||
|
||||
Reference in New Issue
Block a user