Skip to content

Commit

Permalink
Produced solutions now contain original problem (#3413)
Browse files Browse the repository at this point in the history
* Produced solutions now contain original problem

* Enabled some tests cases for transpose

* moved const around to be consistent
  • Loading branch information
DrizztDoUrden authored Dec 2, 2024
1 parent 2007c54 commit 377eaeb
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/include/miopen/problem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ struct Problem
const FindOptions& options,
std::size_t max_solutions,
const Buffers& buffers,
const ConvolutionDescriptor& conv_desc) const;
const ConvolutionDescriptor& conv_desc,
const Problem& problem) const;

std::vector<Solution> FindSolutionsImpl(Handle& handle,
const FindOptions& options,
Expand Down
10 changes: 6 additions & 4 deletions src/problem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,10 @@ Problem::FindSolutions(Handle& handle, const FindOptions& options, std::size_t m
[&](const ConvolutionDescriptor& op_desc) {
if(op_desc.mode == miopenTranspose)
return MakeTransposed().FindSolutionsImpl(
handle, options, max_solutions, buffers, op_desc);
handle, options, max_solutions, buffers, op_desc, *this);
else
return FindSolutionsImpl(handle, options, max_solutions, buffers, op_desc);
return FindSolutionsImpl(
handle, options, max_solutions, buffers, op_desc, *this);
},
[&](const SoftmaxDescriptor& op_desc) {
return FindSolutionsImpl(handle, options, max_solutions, buffers, op_desc);
Expand Down Expand Up @@ -464,7 +465,8 @@ std::vector<Solution> Problem::FindSolutionsImpl(Handle& handle,
const FindOptions& options,
std::size_t max_solutions,
const Buffers& buffers,
const ConvolutionDescriptor& conv_desc) const
const ConvolutionDescriptor& conv_desc,
const Problem& original) const
{
if(tensor_descriptors.size() != 3)
{
Expand Down Expand Up @@ -518,7 +520,7 @@ std::vector<Solution> Problem::FindSolutionsImpl(Handle& handle,

for(auto& result : results)
{
result.SetProblem({*this});
result.SetProblem({original});

if(result.GetKernels().empty())
{
Expand Down
25 changes: 25 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,31 @@ add_custom_test(smoke_solver_ConvMlirIgemm_W GFX900_DISABLED GFX908_DISABLED GFX
ENVIRONMENT MIOPEN_FIND_ENFORCE=SEARCH_DB_UPDATE MIOPEN_DEBUG_TUNING_ITERATIONS_MAX=5 ${IMPLICITGEMM_MLIR_ENV_W}
COMMAND $<TARGET_FILE:test_conv2d> ${TEST_CONV_VERBOSE_W} --input 64 64 28 28 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1 ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_fwd
COMMAND $<TARGET_FILE:test_conv2d> ${TEST_CONV_VERBOSE_F} --input 1 16 24 24 --weights 16 16 7 7 --pads_strides_dilations 3 3 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_bwd
COMMAND $<TARGET_FILE:test_conv2d> ${TEST_CONV_VERBOSE_B} --input 64 64 28 28 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_wrw
COMMAND $<TARGET_FILE:test_conv2d> ${TEST_CONV_VERBOSE_W} --input 64 64 28 28 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_fwd_find_2
COMMAND $<TARGET_FILE:test_conv2d_find2> ${TEST_CONV_VERBOSE_F} --input 1 16 24 24 --weights 16 16 7 7 --pads_strides_dilations 3 3 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_bwd_find_2
COMMAND $<TARGET_FILE:test_conv2d_find2> ${TEST_CONV_VERBOSE_B} --input 64 64 28 28 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

add_custom_test(conv_transposed_wrw_find_2
COMMAND $<TARGET_FILE:test_conv2d_find2> ${TEST_CONV_VERBOSE_W} --input 64 64 28 28 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1 --cmode transpose ${MIOPEN_TEST_FLAGS_ARGS}
)

#Dont install the tests if we are building each test separately
#When the tests are built as a single unit, then we want to be
#able to package them
Expand Down

0 comments on commit 377eaeb

Please sign in to comment.