From 3591ef1f6a3480036233275a4bcb8e3a01d6891a Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Fri, 21 May 2021 21:59:04 +0800 Subject: [PATCH] fix(mgb): fix conv cudnnconvbackwarddata algo witch is not shake GitOrigin-RevId: 379bfbe376563bacb50f38734fa44ff9a331a36b --- dnn/src/cuda/cudnn_wrapper.cpp | 4 ++++ src/opr/impl/search_policy/algo_chooser.cpp | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dnn/src/cuda/cudnn_wrapper.cpp b/dnn/src/cuda/cudnn_wrapper.cpp index dbc2c4dc..2dcf2b51 100644 --- a/dnn/src/cuda/cudnn_wrapper.cpp +++ b/dnn/src/cuda/cudnn_wrapper.cpp @@ -485,7 +485,11 @@ CudnnAlgoPack::conv_bwd_data_algos() { CudnnAlgoPack::Attr> algos = { DEF_ALGO(CUDNN_CONVOLUTION_BWD_DATA_ALGO_0, false, false), +#if CUDNN_VERSION == 8004 DEF_ALGO(CUDNN_CONVOLUTION_BWD_DATA_ALGO_1, true, true), +#else + DEF_ALGO(CUDNN_CONVOLUTION_BWD_DATA_ALGO_1, true, false), +#endif DEF_ALGO(CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT, true, true), DEF_ALGO(CUDNN_CONVOLUTION_BWD_DATA_ALGO_FFT_TILING, true, true), #if CUDNN_MAJOR >= 5 diff --git a/src/opr/impl/search_policy/algo_chooser.cpp b/src/opr/impl/search_policy/algo_chooser.cpp index 4fd7a6b9..4bf2dc48 100644 --- a/src/opr/impl/search_policy/algo_chooser.cpp +++ b/src/opr/impl/search_policy/algo_chooser.cpp @@ -471,16 +471,22 @@ AlgoChooser::AlgoChooserHelper::get_profile_result_from_cache( } } + std::string layouts_str = + format_fixlayouts(m_layouts, arity_in, arity_out); if (skip_by_negative) { mgb_log_error( - "No usable algo. There are available algos match positive " - "strategy(%s), but filtered by negative stategy(%s).", + "opr: %s, layouts: %s, No usable algo. There are available algos match " + "positive strategy(%s), but filtered by negative stategy(%s).", + m_base_mgb_opr->dyn_typeinfo()->name, + layouts_str.c_str(), Algorithm::attribute_str(target_attr.first).c_str(), Algorithm::attribute_str(target_attr.second).c_str()); } else { mgb_log_error( - "No usable algo. algos read from cache could not satisfy " - "positive strategy(%s)", + "opr: %s, layouts: %s, No usable algo. algos read from cache could not " + "satisfy positive strategy(%s)", + m_base_mgb_opr->dyn_typeinfo()->name, + layouts_str.c_str(), Algorithm::attribute_str(target_attr.first).c_str()); }