Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iq136boy committed Oct 11, 2023
1 parent 936282c commit 8091d1c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
10 changes: 10 additions & 0 deletions src/include/miopen/solver/ck_utility_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ static inline bool is_ck_supported_hardware(const Handle& handle)
StartsWith(handle.GetDeviceName(), "gfx1102");
}

static inline bool is_conv_ck_supported_hardware(const std::string& device_name, bool is_wrw)
{
auto res_wrw = StartsWith(device_name, "gfx908") || StartsWith(device_name, "gfx90a") ||
StartsWith(device_name, "gfx940") || StartsWith(device_name, "gfx941") ||
StartsWith(device_name, "gfx942");
return is_wrw ? res_wrw
: (res_wrw || StartsWith(device_name, "gfx900") ||
StartsWith(device_name, "gfx906"));
}

static inline bool is_support_amd_buffer_atomic_fadd(const std::string& device_name)
{
return StartsWith(device_name, "gfx908");
Expand Down
4 changes: 2 additions & 2 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_bwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <miopen/conv/data_invoke_params.hpp>
#include <miopen/solver/problem_description_interpreter.hpp>
#if MIOPEN_BACKEND_HIP && MIOPEN_USE_COMPOSABLEKERNEL
#include <miopen/solver/ck_utility_common.hpp>
#include <ck/library/tensor_operation_instance/gpu/grouped_convolution_backward_data.hpp>
#endif
#include <miopen/solver/implicitgemm_ck_util.hpp>
Expand Down Expand Up @@ -321,8 +322,7 @@ bool ConvHipImplicitGemm3DGroupBwdXdlops::IsApplicable(
return false;
if(!problem.IsLayoutNHWC())
return false;
const std::string& arch = ctx.GetStream().GetDeviceName();
if(miopen::StartsWith(arch, "gfx11") || miopen::StartsWith(arch, "gfx10"))
if(!ck_utility::is_conv_ck_supported_hardware(ctx.GetStream().GetDeviceName(), false))
return false;
switch(problem.GetInDataType())
{
Expand Down
4 changes: 2 additions & 2 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_fwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <miopen/conv/data_invoke_params.hpp>
#include <miopen/solver/problem_description_interpreter.hpp>
#if MIOPEN_BACKEND_HIP && MIOPEN_USE_COMPOSABLEKERNEL
#include <miopen/solver/ck_utility_common.hpp>
#include <ck/library/tensor_operation_instance/gpu/grouped_convolution_forward.hpp>
#endif
#include <miopen/solver/implicitgemm_ck_util.hpp>
Expand Down Expand Up @@ -319,8 +320,7 @@ bool ConvHipImplicitGemm3DGroupFwdXdlops::IsApplicable(
return false;
if(!problem.IsLayoutNHWC())
return false;
const std::string& arch = ctx.GetStream().GetDeviceName();
if(miopen::StartsWith(arch, "gfx11") || miopen::StartsWith(arch, "gfx10"))
if(!ck_utility::is_conv_ck_supported_hardware(ctx.GetStream().GetDeviceName(), false))
return false;
switch(problem.GetInDataType())
{
Expand Down
6 changes: 2 additions & 4 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_wrw_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <miopen/conv/wrw_invoke_params.hpp>
#include <miopen/solver/problem_description_interpreter.hpp>
#if MIOPEN_BACKEND_HIP && MIOPEN_USE_COMPOSABLEKERNEL
#include <miopen/solver/ck_utility_common.hpp>
#include <ck/library/tensor_operation_instance/gpu/grouped_convolution_backward_weight.hpp>
#endif
#include <miopen/solver/implicitgemm_ck_util.hpp>
Expand Down Expand Up @@ -315,10 +316,7 @@ bool ConvHipImplicitGemm3DGroupWrwXdlops::IsApplicable(
return false;
if(!problem.IsLayoutNHWC())
return false;
const std::string& arch = ctx.GetStream().GetDeviceName();
if(miopen::StartsWith(arch, "gfx11") || miopen::StartsWith(arch, "gfx10"))
return false;
if(arch == "gfx906" || arch == "gfx900")
if(!ck_utility::is_conv_ck_supported_hardware(ctx.GetStream().GetDeviceName(), true))
return false;
switch(problem.GetInDataType())
{
Expand Down

0 comments on commit 8091d1c

Please sign in to comment.