Skip to content

Commit

Permalink
fix softmax max dim (PaddlePaddle#37901)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yanxing-Shi authored and Zjq9409 committed Dec 10, 2021
1 parent d4c5adf commit f9f1298
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions paddle/fluid/operators/softmax_cudnn_op.cu.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ void SoftmaxForwardCUDAKernelDriver(const platform::CUDADeviceContext& dev_ctx,
const int N = SizeToAxis(axis, dims);
const int D = SizeOutAxis(axis, dims);

constexpr int max_dim = 320;
constexpr int max_dim = 512;
constexpr int warps_per_block = 4;

if (D == 1 && dim <= max_dim && sizeof(T) <= 4) {
Expand Down Expand Up @@ -540,7 +540,7 @@ void SoftmaxBackwardCUDAKernelDriver(const platform::CUDADeviceContext& dev_ctx,
const int N = SizeToAxis(axis, dims);
const int D = SizeOutAxis(axis, dims);

constexpr int max_dim = 320;
constexpr int max_dim = 512;
constexpr int warps_per_block = 4;

if (D == 1 && dim <= max_dim && sizeof(T) <= 4) {
Expand Down

0 comments on commit f9f1298

Please sign in to comment.