[Perf] Use value-only reduction for native per-token FP8 quantization (#59800)

Signed-off-by: jackLei0901 <841747318@qq.com>
Co-authored-by: Misha Goin <mgoin64@gmail.com>
This commit is contained in:
jackLei
2026-10-02 18:37:17 +00:00
committed by GitHub
co-authored by Misha Goin
parent 8882b83b34
commit 10f6ab01a9
@@ -201,7 +201,7 @@ class QuantFP8(CustomOp):
if scale is None:
if self.group_shape == GroupShape.PER_TOKEN:
x_max, _ = x.abs().max(dim=-1)
x_max = x.abs().amax(dim=-1)
x_max = x_max.unsqueeze(-1).to(torch.float32)
if scale_ub is not None:
x_max = x_max.clamp(max=scale_ub)