From bd3b252e0af0e7bfbcc1f329a672a7ee47a36721 Mon Sep 17 00:00:00 2001 From: Ma Mingfei Date: Mon, 29 Jun 2026 09:38:30 +0800 Subject: [PATCH] [CPU] use faster exp in silu_and_mul (#29382) --- sgl-kernel/csrc/cpu/activation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sgl-kernel/csrc/cpu/activation.cpp b/sgl-kernel/csrc/cpu/activation.cpp index e1011bc49..da0951498 100644 --- a/sgl-kernel/csrc/cpu/activation.cpp +++ b/sgl-kernel/csrc/cpu/activation.cpp @@ -121,7 +121,7 @@ at::Tensor silu_and_mul_cpu(at::Tensor& input) { num_tokens, d, [](float x) { return x / (1.f + std::exp(-x)); }, - [](Vec x) { return x / (Vec(1.f) + x.neg().exp()); }); + [](Vec x) { return x / (Vec(1.f) + x.neg().exp_u20()); }); }); return out; }