Skip to content

Commit 1fbc45b

Browse files
authored
Fix transpose conv (#21406), test=release/1.6 (#21510)
* fix transpose conv,test=develop * fix comments test=develop
1 parent 66c18f4 commit 1fbc45b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

paddle/fluid/inference/api/analysis_predictor.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ std::unique_ptr<PaddlePredictor> CreatePaddlePredictor<
500500
std::string flag = "--fraction_of_gpu_memory_to_use=" +
501501
std::to_string(fraction_of_gpu_memory);
502502
flags.push_back(flag);
503+
flags.push_back("--cudnn_deterministic=True");
503504
VLOG(3) << "set flag: " << flag;
504505
framework::InitGflags(flags);
505506
}

paddle/fluid/operators/conv_transpose_cudnn_op.cu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ class CUDNNConvTransposeOpKernel : public framework::OpKernel<T> {
243243
cudnn_output_desc, CUDNN_CONVOLUTION_BWD_DATA_SPECIFY_WORKSPACE_LIMIT,
244244
workspace_size_limit, &algo));
245245

246+
if (algo == 0 && FLAGS_cudnn_deterministic) {
247+
algo = static_cast<cudnnConvolutionBwdDataAlgo_t>(1);
248+
}
249+
246250
// get workspace size able to allocate
247251
CUDNN_ENFORCE(
248252
platform::dynload::cudnnGetConvolutionBackwardDataWorkspaceSize(

0 commit comments

Comments
 (0)