From 73af7a362ac18725814cd161a802e9c428123850 Mon Sep 17 00:00:00 2001 From: Yan Ma Date: Tue, 28 Jul 2026 10:34:33 +0800 Subject: [PATCH] [XPU] Add online fp8 quantization test (#44513) Signed-off-by: Yan Ma --- .buildkite/intel_jobs/test-intel.yaml | 5 +++-- .../models/multimodal/processing/test_common.py | 1 + tests/quantization/test_online.py | 5 ++++- tests/quantization/utils.py | 8 ++++---- vllm/platforms/xpu.py | 16 ++++++++++++++++ 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/.buildkite/intel_jobs/test-intel.yaml b/.buildkite/intel_jobs/test-intel.yaml index 5c717c9201..3fadb07f39 100644 --- a/.buildkite/intel_jobs/test-intel.yaml +++ b/.buildkite/intel_jobs/test-intel.yaml @@ -145,7 +145,8 @@ steps: - >- bash .buildkite/scripts/hardware_ci/run-intel-test.sh 'cd tests && - pytest -v -s quantization/test_auto_round.py' + pytest -v -s quantization/test_auto_round.py && + pytest -v -s quantization/test_online.py' - label: "XPU compressed tensors FP8 test" depends_on: - image-build-xpu @@ -168,4 +169,4 @@ steps: - >- bash .buildkite/scripts/hardware_ci/run-intel-test.sh 'cd tests && - pytest -v -s quantization/test_compressed_tensors.py::test_compressed_tensors_fp8' \ No newline at end of file + pytest -v -s quantization/test_compressed_tensors.py::test_compressed_tensors_fp8' diff --git a/tests/models/multimodal/processing/test_common.py b/tests/models/multimodal/processing/test_common.py index 9b586be479..e9cb4ab23c 100644 --- a/tests/models/multimodal/processing/test_common.py +++ b/tests/models/multimodal/processing/test_common.py @@ -88,6 +88,7 @@ _XPU_EXCLUDED_MODEL_IDS = { "baidu/Unlimited-OCR", "mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4", "Qwen/Qwen2.5-Omni-7B-AWQ", + "thinkingmachines/Inkling-NVFP4", } diff --git a/tests/quantization/test_online.py b/tests/quantization/test_online.py index 3c21441ed6..d977cff96d 100644 --- a/tests/quantization/test_online.py +++ b/tests/quantization/test_online.py @@ -89,6 +89,9 @@ def test_online_quantization( if use_rocm_aiter: monkeypatch.setenv("VLLM_ROCM_USE_AITER", "1") + if current_platform.is_xpu() and quant_scheme == "fp8_per_block": + pytest.skip("Skip test for online fp8_per_block on XPU platform.") + # `LLM.apply_model` requires pickling a function. monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1") @@ -121,7 +124,7 @@ def test_online_quantization( if moe is not None: assert isinstance(moe._quant_method, expected_moe_cls) - if current_platform.is_cuda(): + if current_platform.is_cuda() or current_platform.is_xpu(): assert o_proj.weight.dtype == torch.float8_e4m3fn elif current_platform.is_rocm(): assert o_proj.weight.dtype == current_platform.fp8_dtype() diff --git a/tests/quantization/utils.py b/tests/quantization/utils.py index 8ab9c310dc..5e34199f94 100644 --- a/tests/quantization/utils.py +++ b/tests/quantization/utils.py @@ -10,15 +10,15 @@ from vllm.platforms import current_platform def is_quant_method_supported(quant_method: str) -> bool: - # Currently, all quantization methods require Nvidia or AMD GPUs - if not (current_platform.is_cuda() or current_platform.is_rocm()): + # Currently, quantization tests only run GPUs + if current_platform.is_cpu(): return False - try: current_platform.verify_quantization(quant_method) except ValueError: return False - + if current_platform.is_xpu(): + return True capability = current_platform.get_device_capability() assert capability is not None diff --git a/vllm/platforms/xpu.py b/vllm/platforms/xpu.py index e9d1a905a4..b9fb8487b7 100644 --- a/vllm/platforms/xpu.py +++ b/vllm/platforms/xpu.py @@ -110,6 +110,22 @@ class XPUPlatform(Platform): ray_device_key: str = "GPU" dist_backend: str = "xccl" # xccl only device_control_env_var: str = "ZE_AFFINITY_MASK" + supported_quantization: list[str] = [ + "awq", + "gptq", + "auto_awq", + "auto_gptq", + "inc", + "fp8", + "mxfp4", + "mxfp8", + "fp8_per_tensor", + "fp8_per_block", + "online", + "gpt_oss_mxfp4", + "modelopt", + "compressed-tensors", + ] @classmethod def import_kernels(cls) -> None: