From 0f319f8afa1cfc7441d7d00b8c5ef5d3a235fd38 Mon Sep 17 00:00:00 2001 From: Zhang Zheng <32410583+ZzSean@users.noreply.github.com> Date: Wed, 10 May 2023 15:51:33 +0800 Subject: [PATCH] Fix bug in log_softmax kernel when lastdim is larger than 100000 (#53654) --- paddle/phi/kernels/gpudnn/softmax_gpudnn.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paddle/phi/kernels/gpudnn/softmax_gpudnn.h b/paddle/phi/kernels/gpudnn/softmax_gpudnn.h index 8ba329301c9..9db814f1986 100644 --- a/paddle/phi/kernels/gpudnn/softmax_gpudnn.h +++ b/paddle/phi/kernels/gpudnn/softmax_gpudnn.h @@ -499,8 +499,7 @@ __global__ void KeMatrixSoftmaxForward(T* softmax, const T* src, int dim_size) { // write data to softmax_output according to the LogMode if (LogMode) { - LogSoftmaxForwardFunctor reduction(thread_max, - std::log(thread_exp)); + LogSoftmaxForwardFunctor reduction(thread_max, thread_exp); if (input_align_shift == output_align_shift) { ThreadVecWriteVec( batch_output, batch_input, dim_size, input_align_shift, reduction); -- GitLab