Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename function and return invalid solution instead of throwing an error #2457

Merged
merged 1 commit into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/include/miopen/solver/implicitgemm_ck_util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,16 @@ template <typename DeviceOpType,
typename CKArgsType,
typename CastType,
typename ProblemDescriptionType = ProblemDescription>
ConvSolution InitInvokerFactory(const ProblemDescriptionType& problem, const std::string& kernel_id)
ConvSolution MakeInvokerFactory(const ProblemDescriptionType& problem, const std::string& kernel_id)
{
auto conv_ptrs = DeviceOpType::GetInstances();
auto ptr_iter = FindConvPtrByID(conv_ptrs, kernel_id);

if(ptr_iter == conv_ptrs.end())
MIOPEN_THROW("PerformanceConfig kernel '" + kernel_id + "' does not exist");
{
MIOPEN_LOG_E("PerformanceConfig kernel '" + kernel_id + "' does not exist.");
return {miopenStatusInvalidValue};
}

ConvSolution result;
result.invoker_factory =
Expand Down
6 changes: 3 additions & 3 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_bwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,13 +349,13 @@ ConvSolution ConvHipImplicitGemm3DGroupBwdXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenInt8:
return InitInvokerFactory<DeviceOpGBwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGBwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenHalf:
return InitInvokerFactory<DeviceOpGBwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGBwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpGBwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGBwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt32:
case miopenInt8x4: // Support discontinued.
Expand Down
6 changes: 3 additions & 3 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_fwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,13 +347,13 @@ ConvSolution ConvHipImplicitGemm3DGroupFwdXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenInt8:
return InitInvokerFactory<DeviceOpGFwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenHalf:
return InitInvokerFactory<DeviceOpGFwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpGFwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt32:
case miopenInt8x4: // Support discontinued.
Expand Down
6 changes: 3 additions & 3 deletions src/solver/conv_hip_implicit_gemm_3d_grouped_wrw_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,13 @@ ConvSolution ConvHipImplicitGemm3DGroupWrwXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenInt8:
return InitInvokerFactory<DeviceOpGWrwPtrs<int8_t>, CKArgs, conv::WrWInvokeParams>(
return MakeInvokerFactory<DeviceOpGWrwPtrs<int8_t>, CKArgs, conv::WrWInvokeParams>(
problem, config.kernel_id);
case miopenHalf:
return InitInvokerFactory<DeviceOpGWrwPtrs<ck::half_t>, CKArgs, conv::WrWInvokeParams>(
return MakeInvokerFactory<DeviceOpGWrwPtrs<ck::half_t>, CKArgs, conv::WrWInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpGWrwPtrs<float>, CKArgs, conv::WrWInvokeParams>(
return MakeInvokerFactory<DeviceOpGWrwPtrs<float>, CKArgs, conv::WrWInvokeParams>(
problem, config.kernel_id);
case miopenInt32:
case miopenInt8x4: // Support discontinued.
Expand Down
4 changes: 2 additions & 2 deletions src/solver/conv_hip_implicit_gemm_bwd_data_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ ConvSolution ConvHipImplicitGemmBwdXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenHalf:
return InitInvokerFactory<DeviceOpBwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpBwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpBwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpBwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt8:
case miopenInt32:
Expand Down
6 changes: 3 additions & 3 deletions src/solver/conv_hip_implicit_gemm_fwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,13 @@ ConvSolution ConvHipImplicitGemmFwdXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenInt8:
return InitInvokerFactory<DeviceOpPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenHalf:
return InitInvokerFactory<DeviceOpPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpPtrs<float>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpPtrs<float>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt32:
case miopenInt8x4: // Support discontinued.
Expand Down
6 changes: 3 additions & 3 deletions src/solver/conv_hip_implicit_gemm_grouped_fwd_xdlops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,13 @@ ConvSolution ConvHipImplicitGemmGroupFwdXdlops::GetSolution(
switch(problem.GetInDataType())
{
case miopenHalf:
return InitInvokerFactory<DeviceOpGFwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<ck::half_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenFloat:
return InitInvokerFactory<DeviceOpGFwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<float>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt8:
return InitInvokerFactory<DeviceOpGFwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
return MakeInvokerFactory<DeviceOpGFwdPtrs<int8_t>, CKArgs, conv::DataInvokeParams>(
problem, config.kernel_id);
case miopenInt32:
case miopenInt8x4: // Support discontinued.
Expand Down