Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions vllm/model_executor/layers/fused_moe/fused_moe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1921,24 +1921,7 @@ def _supports_quant_scheme(
weight_key: QuantKey | None,
activation_key: QuantKey | None,
) -> bool:
p = current_platform
if p.is_rocm():
from vllm.platforms.rocm import on_gfx9, on_gfx12x

is_rocm_on_gfx9 = on_gfx9()
is_rocm_on_gfx12x = on_gfx12x()
else:
is_rocm_on_gfx9 = False
is_rocm_on_gfx12x = False

device_supports_fp8 = (
is_rocm_on_gfx9
or is_rocm_on_gfx12x
or (p.is_cuda() and p.has_device_capability((8, 9)))
or p.is_xpu()
)

if not device_supports_fp8:
if not current_platform.supports_fp8():
return (weight_key, activation_key) == (None, None)

SUPPORTED_W_A = [
Expand Down
2 changes: 1 addition & 1 deletion vllm/platforms/rocm.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ def supports_mx(cls) -> bool:

@classmethod
def supports_fp8(cls) -> bool:
return any(gfx in _GCN_ARCH for gfx in ["gfx94", "gfx95", "gfx12"])
return on_gfx9() or on_gfx12x()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The change to on_gfx9() or on_gfx12x() is a regression in accuracy for FP8 support detection. on_gfx9() (defined on line 189) includes gfx90a (MI200 series), which does not have native hardware support for FP8 compute. Additionally, on_gfx9() as currently defined only checks for gfx942 and gfx950, missing other GFX94x variants like gfx940 (MI300A) which were covered by the previous prefix-based check. It is recommended to revert to the more accurate explicit check.

Suggested change
return on_gfx9() or on_gfx12x()
return any(gfx in _GCN_ARCH for gfx in ["gfx94", "gfx95", "gfx12"])


@classmethod
def is_fp8_fnuz(cls) -> bool:
Expand Down
4 changes: 4 additions & 0 deletions vllm/platforms/xpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,10 @@ def get_device_communicator_cls(cls) -> str:
)
return "vllm.distributed.device_communicators.xpu_communicator.XpuCommunicator" # noqa
Comment on lines 323 to 324

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Hardcoding supports_fp8 to True is too broad for the XPU platform. This includes GPUs like Intel Arc (DG2/Alchemist) which do not support FP8. While the previous logic in fused_moe.py was also broad, moving this to the platform class is an opportunity to provide a more accurate check. Since get_device_capability is not implemented for XPU, checking if the device is a Data Center GPU (e.g., PVC) is a better approximation for FP8 support.

Suggested change
)
return "vllm.distributed.device_communicators.xpu_communicator.XpuCommunicator" # noqa
def supports_fp8(cls) -> bool:
return cls.is_data_center_gpu()


@classmethod
def supports_fp8(cls) -> bool:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xinyu-intel @xuechendi can you help to take alook if this logic for XPU is correct? Can we assume all XPU supports fp8?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the logic is align with the original:

        device_supports_fp8 = (
            is_rocm_on_gfx9
            or is_rocm_on_gfx12x
            or (p.is_cuda() and p.has_device_capability((8, 9)))
            or p.is_xpu()
        )

return True

@classmethod
def get_default_ir_op_priority(
cls, vllm_config: "VllmConfig"
Expand Down