Use exp2() to calculate exp() for better performance

This commit is contained in:
Qianfeng Zhang
2025-04-16 06:54:06 +00:00
parent 226a254723
commit 1351d9cd1b

View File

@@ -251,7 +251,7 @@ struct HstuAttentionFwdPipelineQRKSVS
const auto f_silu = [](CompDataType& x) {
const auto one = ck_tile::type_convert<CompDataType>(1.0f);
return x = x / (one + exp(-x));
return x = x / (one + exp2(-log2e_v<CompDataType> * x));
};
using OaccBlockTileType = decltype(gemm_1.MakeCBlockTile());