[XPU] Add online fp8 quantization test (#44513)

Signed-off-by: Yan Ma <yan.ma@intel.com>
This commit is contained in:
Yan Ma
2026-07-28 10:34:33 +08:00
committed by GitHub
parent e68bfc2828
commit 73af7a362a
5 changed files with 28 additions and 7 deletions
+4 -1
View File
@@ -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()
+4 -4
View File
@@ -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