[ROCm] gaurd on_gfx1250 call with rocm platform (#52625)
Signed-off-by: Kunshang Ji <kunshang.ji@intel.com>
Kunshang Ji committed
Aug 18, 2026 at 08:05 UTC
0e8989b41648e99176a53480e42c447f8bf95620
1 file changed
+6
-2
vllm/model_executor/layers/quantization/utils/fp8_utils.py
+6
-2
@@ -881,9 +881,13 @@ def w8a8_triton_block_scaled_mm(
881
torch.Tensor: The result of matmul.
882
"""
883
884
- from vllm.platforms.rocm import on_gfx1250
884
+ _on_gfx1250 = False
885
+ if current_platform.is_rocm():
886
+ from vllm.platforms.rocm import on_gfx1250
887
886
- if on_gfx1250():
888
+ _on_gfx1250 = on_gfx1250()
889
+
890
+ if _on_gfx1250:
891
# Torch upcast reference: dequantize A,B to fp32 and matmul in fp32.
892
# Avoids the gfx1250 native-fp8 block GEMM NaN bug. Correct but slow.
893
_bn, _bk = block_size[0], block_size[1]