From 1351d9cd1b88c3aad1ad56987613421a22eeb58d Mon Sep 17 00:00:00 2001 From: Qianfeng Zhang Date: Wed, 16 Apr 2025 06:54:06 +0000 Subject: [PATCH] Use exp2() to calculate exp() for better performance --- .../ck_tile/18_hstu_attention/hstu_attention_fwd_pipeline.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/ck_tile/18_hstu_attention/hstu_attention_fwd_pipeline.hpp b/example/ck_tile/18_hstu_attention/hstu_attention_fwd_pipeline.hpp index 4942b67606..cb4d79b7a2 100644 --- a/example/ck_tile/18_hstu_attention/hstu_attention_fwd_pipeline.hpp +++ b/example/ck_tile/18_hstu_attention/hstu_attention_fwd_pipeline.hpp @@ -251,7 +251,7 @@ struct HstuAttentionFwdPipelineQRKSVS const auto f_silu = [](CompDataType& x) { const auto one = ck_tile::type_convert(1.0f); - return x = x / (one + exp(-x)); + return x = x / (one + exp2(-log2e_v * x)); }; using OaccBlockTileType = decltype(gemm_1.MakeCBlockTile());