[ROCm] gaurd on_gfx1250 call with rocm platform (#52625)

Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
This commit is contained in:
Kunshang Ji
2026-08-18 08:05:48 +08:00
committed by GitHub
parent 58aa1e3d26
commit 0e8989b416
@@ -881,9 +881,13 @@ def w8a8_triton_block_scaled_mm(
torch.Tensor: The result of matmul.
"""
from vllm.platforms.rocm import on_gfx1250
_on_gfx1250 = False
if current_platform.is_rocm():
from vllm.platforms.rocm import on_gfx1250
if on_gfx1250():
_on_gfx1250 = on_gfx1250()
if _on_gfx1250:
# Torch upcast reference: dequantize A,B to fp32 and matmul in fp32.
# Avoids the gfx1250 native-fp8 block GEMM NaN bug. Correct but slow.
_bn, _bk = block_size[0], block_size[1]