[ROCm] Fix fp8 quantization accuracy issue. (#10558)

This commit is contained in:
sogalin
2025-09-18 08:44:59 +08:00
committed by GitHub
parent 1ba137e98f
commit c32fb7a24d

View File

@@ -732,7 +732,7 @@ def apply_fp8_linear(
# final solution should be: 1. add support to per-tensor activation scaling.
# 2. solve the torch.compile error from weight_scale.numel() == 1 and x_scale.numel() > 1 (below line#308)
if _is_hip and weight_scale.numel() == 1:
qinput, x_scale = ops.scaled_fp8_quant(
qinput, x_scale = scaled_fp8_quant(
input_2d,
input_scale,
use_per_token_if_dynamic=use_per_token_if_dynamic,