Skip to content

Commit

Permalink
[Cherry-Pick] Fix bug in log_softmax kernel when lastdim is larger th…
Browse files Browse the repository at this point in the history
…an 100000 (PaddlePaddle#53656)
  • Loading branch information
ZzSean authored May 12, 2023
1 parent fb3dbcc commit adaa251
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions paddle/phi/kernels/gpudnn/softmax_gpudnn.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<AccT, T> reduction(thread_max,
std::log(thread_exp));
LogSoftmaxForwardFunctor<AccT, T> reduction(thread_max, thread_exp);
if (input_align_shift == output_align_shift) {
ThreadVecWriteVec<LogSoftmaxForwardFunctor, T, AccT, VecSize>(
batch_output, batch_input, dim_size, input_align_shift, reduction);
Expand Down

0 comments on commit adaa251

Please sign in to comment.