Skip to content

Commit 2567afa

Browse files
authored
Merge pull request #12462 from reyoung/feature/fix_cudnn_deterministic
Fix bug in cudnn_determistic
2 parents c58af84 + 040fc1c commit 2567afa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

paddle/fluid/operators/conv_cudnn_op.cu.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ limitations under the License. */
2020
#include "paddle/fluid/platform/cudnn_helper.h"
2121
#include "paddle/fluid/platform/float16.h"
2222

23-
DEFINE_bool(cudnn_deterministic, true,
23+
DEFINE_bool(cudnn_deterministic, false,
2424
"Whether allow using an autotuning algorithm for convolution "
2525
"operator. The autotuning algorithm may be non-deterministic. If "
26-
"false, the algorithm is deterministic.");
26+
"true, the algorithm is deterministic.");
2727

2828
namespace paddle {
2929
namespace operators {
@@ -272,7 +272,7 @@ class CUDNNConvGradOpKernel : public framework::OpKernel<T> {
272272
auto& dev_ctx = ctx.template device_context<platform::CUDADeviceContext>();
273273
auto handle = dev_ctx.cudnn_handle();
274274
if (input_grad) {
275-
if (FLAGS_cudnn_deterministic) {
275+
if (!FLAGS_cudnn_deterministic) {
276276
CUDNN_ENFORCE(
277277
platform::dynload::cudnnGetConvolutionBackwardDataAlgorithm(
278278
handle, cudnn_filter_desc,
@@ -297,7 +297,7 @@ class CUDNNConvGradOpKernel : public framework::OpKernel<T> {
297297
}
298298

299299
if (filter_grad) {
300-
if (FLAGS_cudnn_deterministic) {
300+
if (!FLAGS_cudnn_deterministic) {
301301
CUDNN_ENFORCE(
302302
platform::dynload::cudnnGetConvolutionBackwardFilterAlgorithm(
303303
handle, cudnn_input_desc, cudnn_output_grad_desc,

0 commit comments

Comments
 (0)