[XPU] Add online fp8 quantization test (#44513)
Signed-off-by: Yan Ma <yan.ma@intel.com>
This commit is contained in:
@@ -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'
|
||||
pytest -v -s quantization/test_compressed_tensors.py::test_compressed_tensors_fp8'
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user