From 312793c49f92f1d3b6c81c83880d1bf56c96d6ad Mon Sep 17 00:00:00 2001 From: carlushuang Date: Mon, 23 Oct 2023 06:03:44 -0400 Subject: [PATCH 1/3] disable bwd_gemm solver --- src/solver/gemm_bwd.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/solver/gemm_bwd.cpp b/src/solver/gemm_bwd.cpp index df7d08304b..b00f345b92 100644 --- a/src/solver/gemm_bwd.cpp +++ b/src/solver/gemm_bwd.cpp @@ -43,6 +43,7 @@ MIOPEN_DECLARE_ENV_VAR(MIOPEN_CONV_PRECISE_ROCBLAS_TIMING) #define WORKAROUND_MIOPENGEMM_ISSUE_59 1 +#define WORKAROUND_MIOPENGEMM_ISSUE_2474 1 // copy from convolution.cpp // Workaround for issue 1430. @@ -246,6 +247,9 @@ bool GemmBwd1x1_stride2::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { #if MIOPEN_USE_GEMM +#if WORKAROUND_MIOPENGEMM_ISSUE_2474 + return false; +#endif if(!GemmBwdBase::IsApplicable(context, problem)) return false; @@ -482,7 +486,9 @@ bool GemmBwd1x1_stride1::IsApplicableBeforeWorkaround(const ExecutionContext& co bool GemmBwd1x1_stride1::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if MIOPEN_USE_GEMM && (!MIOPEN_USE_MIOPENGEMM || !WORKAROUND_MIOPENGEMM_ISSUE_59) +#if WORKAROUND_MIOPENGEMM_ISSUE_2474 + return false; +#elif MIOPEN_USE_GEMM && (!MIOPEN_USE_MIOPENGEMM || !WORKAROUND_MIOPENGEMM_ISSUE_59) return IsApplicableBeforeWorkaround(context, problem); #else std::ignore = context; @@ -683,6 +689,9 @@ bool GemmBwdRest::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { #if MIOPEN_USE_GEMM +#if WORKAROUND_MIOPENGEMM_ISSUE_2474 + return false; +#endif if(!GemmBwdBase::IsApplicable(context, problem)) return false; From d75aace6237a547b7a50ef127fff687f5fce6c1e Mon Sep 17 00:00:00 2001 From: carlushuang Date: Mon, 23 Oct 2023 08:11:36 -0400 Subject: [PATCH 2/3] fix tidy error --- src/solver/gemm_bwd.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/solver/gemm_bwd.cpp b/src/solver/gemm_bwd.cpp index b00f345b92..18affdd6cc 100644 --- a/src/solver/gemm_bwd.cpp +++ b/src/solver/gemm_bwd.cpp @@ -246,10 +246,7 @@ size_t GemmBwd1x1_stride2::GetWorkspaceSize(const ExecutionContext& context, bool GemmBwd1x1_stride2::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if MIOPEN_USE_GEMM -#if WORKAROUND_MIOPENGEMM_ISSUE_2474 - return false; -#endif +#if MIOPEN_USE_GEMM && !WORKAROUND_MIOPENGEMM_ISSUE_2474 if(!GemmBwdBase::IsApplicable(context, problem)) return false; @@ -486,9 +483,8 @@ bool GemmBwd1x1_stride1::IsApplicableBeforeWorkaround(const ExecutionContext& co bool GemmBwd1x1_stride1::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if WORKAROUND_MIOPENGEMM_ISSUE_2474 - return false; -#elif MIOPEN_USE_GEMM && (!MIOPEN_USE_MIOPENGEMM || !WORKAROUND_MIOPENGEMM_ISSUE_59) +#if MIOPEN_USE_GEMM && (!MIOPEN_USE_MIOPENGEMM || !WORKAROUND_MIOPENGEMM_ISSUE_59) && \ + !WORKAROUND_MIOPENGEMM_ISSUE_2474 return IsApplicableBeforeWorkaround(context, problem); #else std::ignore = context; @@ -688,10 +684,7 @@ size_t GemmBwdRest::GetWorkspaceSize(const ExecutionContext& context, bool GemmBwdRest::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if MIOPEN_USE_GEMM -#if WORKAROUND_MIOPENGEMM_ISSUE_2474 - return false; -#endif +#if MIOPEN_USE_GEMM && !WORKAROUND_MIOPENGEMM_ISSUE_2474 if(!GemmBwdBase::IsApplicable(context, problem)) return false; From fa5a598adc02d6a381d50ceb80fd41d7cf68c9b7 Mon Sep 17 00:00:00 2001 From: carlushuang Date: Mon, 23 Oct 2023 10:34:05 -0400 Subject: [PATCH 3/3] renaming the macro --- src/solver/gemm_bwd.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solver/gemm_bwd.cpp b/src/solver/gemm_bwd.cpp index 18affdd6cc..e42e45bae4 100644 --- a/src/solver/gemm_bwd.cpp +++ b/src/solver/gemm_bwd.cpp @@ -43,7 +43,7 @@ MIOPEN_DECLARE_ENV_VAR(MIOPEN_CONV_PRECISE_ROCBLAS_TIMING) #define WORKAROUND_MIOPENGEMM_ISSUE_59 1 -#define WORKAROUND_MIOPENGEMM_ISSUE_2474 1 +#define WORKAROUND_ISSUE_2474 1 // copy from convolution.cpp // Workaround for issue 1430. @@ -246,7 +246,7 @@ size_t GemmBwd1x1_stride2::GetWorkspaceSize(const ExecutionContext& context, bool GemmBwd1x1_stride2::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if MIOPEN_USE_GEMM && !WORKAROUND_MIOPENGEMM_ISSUE_2474 +#if MIOPEN_USE_GEMM && !WORKAROUND_ISSUE_2474 if(!GemmBwdBase::IsApplicable(context, problem)) return false; @@ -484,7 +484,7 @@ bool GemmBwd1x1_stride1::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { #if MIOPEN_USE_GEMM && (!MIOPEN_USE_MIOPENGEMM || !WORKAROUND_MIOPENGEMM_ISSUE_59) && \ - !WORKAROUND_MIOPENGEMM_ISSUE_2474 + !WORKAROUND_ISSUE_2474 return IsApplicableBeforeWorkaround(context, problem); #else std::ignore = context; @@ -684,7 +684,7 @@ size_t GemmBwdRest::GetWorkspaceSize(const ExecutionContext& context, bool GemmBwdRest::IsApplicable(const ExecutionContext& context, const conv::ProblemDescription& problem) const { -#if MIOPEN_USE_GEMM && !WORKAROUND_MIOPENGEMM_ISSUE_2474 +#if MIOPEN_USE_GEMM && !WORKAROUND_ISSUE_2474 if(!GemmBwdBase::IsApplicable(context, problem)) return false;