From 4c61e141077117e1342ed7bf2d5e86314b1ad4fe Mon Sep 17 00:00:00 2001 From: limingshu <61349199+JamesLim-sy@users.noreply.github.com> Date: Tue, 25 Jan 2022 19:16:46 +0800 Subject: [PATCH] GetWorkspaceSize trigger modfication in heuristic cudnn conv (#39184) * first commit * add more changes --- paddle/fluid/operators/conv_cudnn_helper.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/conv_cudnn_helper.h b/paddle/fluid/operators/conv_cudnn_helper.h index 4c972739175..7ad49de4eed 100644 --- a/paddle/fluid/operators/conv_cudnn_helper.h +++ b/paddle/fluid/operators/conv_cudnn_helper.h @@ -251,7 +251,7 @@ struct SearchAlgorithm { args.cdesc.desc(), args.odesc.desc(), kNUM_CUDNN_FWD_ALGS, &perf_count, perf_results.get())); algo = (perf_results.get())[best_algo_idx].algo; - workspace_size = GetWorkspaceSize(args, algo); + workspace_size = (perf_results.get())[best_algo_idx].memory; if (workspace_size > workspace_size_limit) { #if CUDNN_VERSION >= 8000 @@ -502,7 +502,8 @@ struct SearchAlgorithm { args.cdesc.desc(), args.wdesc.desc(), kNUM_CUDNN_BWD_FILTER_ALGS, &perf_count, perf_results.get())); algo = (perf_results.get())[best_algo_idx].algo; - workspace_size = GetWorkspaceSize(args, algo); + workspace_size = (perf_results.get())[best_algo_idx].memory; + if (workspace_size > workspace_size_limit) { workspace_size = workspace_size_limit; #if CUDNN_VERSION >= 8000 -- GitLab