From 82f6008c8c6a69459d0d949cef75b8fc70096460 Mon Sep 17 00:00:00 2001 From: youkaichao Date: Wed, 27 Aug 2025 16:23:30 +0800 Subject: [PATCH] fix act_quant_kernel (#968) Signed-off-by: youkaichao --- inference/kernel.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inference/kernel.py b/inference/kernel.py index e12ad48..57832ad 100644 --- a/inference/kernel.py +++ b/inference/kernel.py @@ -23,8 +23,7 @@ def act_quant_kernel(x_ptr, y_ptr, s_ptr, BLOCK_SIZE: tl.constexpr, scale_fmt: t pid = tl.program_id(axis=0) offs = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE) x = tl.load(x_ptr + offs).to(tl.float32) - amax = tl.max(tl.abs(x)) - amax = tl.min(amax, 1e-4) + amax = tl.max(tl.abs(x), 1e-4) s = amax / 448. if scale_fmt == "ue8m0": exp = tl.math.ceil(tl.math.log2(s))