[XPU] Add online fp8 quantization test (#44513)
Signed-off-by: Yan Ma <yan.ma@intel.com>
Yan Ma committed
Jul 28, 2026 at 10:34 UTC
73af7a362ac18725814cd161a802e9c428123850
5 files changed
+28
-7
.buildkite/intel_jobs/test-intel.yaml
+3
-2
@@ -145,7 +145,8 @@ steps:
145
- >-
146
bash .buildkite/scripts/hardware_ci/run-intel-test.sh
147
'cd tests &&
148
- pytest -v -s quantization/test_auto_round.py'
148
+ pytest -v -s quantization/test_auto_round.py &&
149
+ pytest -v -s quantization/test_online.py'
150
- label: "XPU compressed tensors FP8 test"
151
depends_on:
152
- image-build-xpu
@@ -168,4 +169,4 @@ steps:
169
- >-
170
bash .buildkite/scripts/hardware_ci/run-intel-test.sh
171
'cd tests &&
171
- pytest -v -s quantization/test_compressed_tensors.py::test_compressed_tensors_fp8'
\ No newline at end of file
172
+ pytest -v -s quantization/test_compressed_tensors.py::test_compressed_tensors_fp8'
tests/models/multimodal/processing/test_common.py
+1
@@ -88,6 +88,7 @@ _XPU_EXCLUDED_MODEL_IDS = {
88
"baidu/Unlimited-OCR",
89
"mistralai/Mistral-Large-3-675B-Instruct-2512-NVFP4",
90
"Qwen/Qwen2.5-Omni-7B-AWQ",
91
+ "thinkingmachines/Inkling-NVFP4",
92
}
93
94
tests/quantization/test_online.py
+4
-1
@@ -89,6 +89,9 @@ def test_online_quantization(
89
if use_rocm_aiter:
90
monkeypatch.setenv("VLLM_ROCM_USE_AITER", "1")
91
92
+ if current_platform.is_xpu() and quant_scheme == "fp8_per_block":
93
+ pytest.skip("Skip test for online fp8_per_block on XPU platform.")
94
+
95
# `LLM.apply_model` requires pickling a function.
96
monkeypatch.setenv("VLLM_ALLOW_INSECURE_SERIALIZATION", "1")
97
@@ -121,7 +124,7 @@ def test_online_quantization(
124
if moe is not None:
125
assert isinstance(moe._quant_method, expected_moe_cls)
126
124
- if current_platform.is_cuda():
127
+ if current_platform.is_cuda() or current_platform.is_xpu():
128
assert o_proj.weight.dtype == torch.float8_e4m3fn
129
elif current_platform.is_rocm():
130
assert o_proj.weight.dtype == current_platform.fp8_dtype()
tests/quantization/utils.py
+4
-4
@@ -10,15 +10,15 @@ from vllm.platforms import current_platform
10
11
12
def is_quant_method_supported(quant_method: str) -> bool:
13
- # Currently, all quantization methods require Nvidia or AMD GPUs
14
- if not (current_platform.is_cuda() or current_platform.is_rocm()):
13
+ # Currently, quantization tests only run GPUs
14
+ if current_platform.is_cpu():
15
return False
16
-
16
try:
17
current_platform.verify_quantization(quant_method)
18
except ValueError:
19
return False
21
-
20
+ if current_platform.is_xpu():
21
+ return True
22
capability = current_platform.get_device_capability()
23
assert capability is not None
24
vllm/platforms/xpu.py
+16
@@ -110,6 +110,22 @@ class XPUPlatform(Platform):
110
ray_device_key: str = "GPU"
111
dist_backend: str = "xccl" # xccl only
112
device_control_env_var: str = "ZE_AFFINITY_MASK"
113
+ supported_quantization: list[str] = [
114
+ "awq",
115
+ "gptq",
116
+ "auto_awq",
117
+ "auto_gptq",
118
+ "inc",
119
+ "fp8",
120
+ "mxfp4",
121
+ "mxfp8",
122
+ "fp8_per_tensor",
123
+ "fp8_per_block",
124
+ "online",
125
+ "gpt_oss_mxfp4",
126
+ "modelopt",
127
+ "compressed-tensors",
128
+ ]
129
130
@classmethod
131
def import_kernels(cls) -> None: