Skip to content

Commit 82f6008

Browse files
authored
fix act_quant_kernel (deepseek-ai#968)
Signed-off-by: youkaichao <youkaichao@gmail.com>
1 parent b15f0db commit 82f6008

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

inference/kernel.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ def act_quant_kernel(x_ptr, y_ptr, s_ptr, BLOCK_SIZE: tl.constexpr, scale_fmt: t
2323
pid = tl.program_id(axis=0)
2424
offs = pid * BLOCK_SIZE + tl.arange(0, BLOCK_SIZE)
2525
x = tl.load(x_ptr + offs).to(tl.float32)
26-
amax = tl.max(tl.abs(x))
27-
amax = tl.min(amax, 1e-4)
26+
amax = tl.max(tl.abs(x), 1e-4)
2827
s = amax / 448.
2928
if scale_fmt == "ue8m0":
3029
exp = tl.math.ceil(tl.math.log2(s))

0 commit comments

Comments
 (0)