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

[Test] Convert conv_igemm_dynamic_dlops etc to gTest #2553

Merged
merged 134 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
9a41dde
WIP: updatable env vars, first draft
amberhassaan Nov 7, 2023
1e63ea6
update env var declarations
cderb Nov 7, 2023
0222ee6
draw out env string definitions
cderb Nov 7, 2023
cd035e4
compilation fixes
cderb Nov 8, 2023
de4766e
Merge remote-tracking branch 'origin/develop' into cderb/env-var-update
cderb Nov 8, 2023
79446a4
fix
cderb Nov 8, 2023
9d4d4f5
fix
cderb Nov 8, 2023
541eea5
update driver envs
cderb Nov 8, 2023
5e59daf
env for test folder
cderb Nov 8, 2023
438aa34
compilation fixes
cderb Nov 8, 2023
fb292b3
format
cderb Nov 8, 2023
44a174f
tidy
cderb Nov 8, 2023
473b17c
quality improvements for env.h
cderb Nov 8, 2023
d33b9a9
convert to const string reference
cderb Nov 8, 2023
694a079
fix
cderb Nov 8, 2023
9c12c2f
fix string definition
cderb Nov 9, 2023
a3605ab
formatting
cderb Nov 9, 2023
688919c
fix
cderb Nov 9, 2023
5ea88a6
use std::string::compare
cderb Nov 9, 2023
434f154
rename IsDefault to IsUnset, check unset in disabled/enabled check
cderb Nov 9, 2023
708b472
Merge branch 'cderb/env-var-update' of https://github.com/ROCmSoftwar…
cderb Nov 9, 2023
55dfe4d
macro for bool + string envs
cderb Nov 9, 2023
c1a257a
fix macros
cderb Nov 9, 2023
e21d7da
relabel uint64 envs
cderb Nov 9, 2023
f037fe9
typo fix + format
cderb Nov 9, 2023
051538c
tidy
cderb Nov 10, 2023
fbc8558
Update src/include/miopen/env.hpp
cderb Nov 10, 2023
9074f83
update tests with env syntax
cderb Nov 10, 2023
dd38c5f
Merge branch 'cderb/env-var-update' of https://github.com/ROCmSoftwar…
cderb Nov 10, 2023
42893a9
Merge branch 'develop' into cderb/env-var-update
cderb Nov 10, 2023
57a80f5
format
cderb Nov 10, 2023
86c61c7
string references
cderb Nov 13, 2023
2d50b1d
Merge branch 'develop' into cderb/env-var-update
cderb Nov 13, 2023
4da821c
Merge branch 'develop' into cderb/env-var-update
cderb Nov 13, 2023
312a321
move generic_search env defaults into header
cderb Nov 13, 2023
34a21ca
Merge branch 'develop' into cderb/env-var-update
xinlipn Nov 14, 2023
9f85fae
Merge branch 'develop' into cderb/env-var-update
xinlipn Nov 15, 2023
cae82dc
mergefix
cderb Nov 15, 2023
2692bb8
mergefix
cderb Nov 16, 2023
3cfee15
missing include
cderb Nov 16, 2023
65f0f89
string fix
cderb Nov 16, 2023
61de002
Merge remote-tracking branch 'origin/develop' into cderb/env-var-update
cderb Nov 17, 2023
479d97e
mergefix
cderb Nov 17, 2023
f775ff1
Merge branch 'develop' into cderb/env-var-update
xinlipn Nov 20, 2023
6665114
address comments
cderb Nov 20, 2023
6be69d4
small performance remedy for find controls, remove log pollutants
cderb Nov 20, 2023
18cc17a
clang format
cderb Nov 20, 2023
a7b4344
revert find_controls changes
cderb Nov 20, 2023
a06e464
env namespace
cderb Nov 21, 2023
88bd707
fix
cderb Nov 21, 2023
eb46c35
fix
cderb Nov 21, 2023
a44b0d5
Merge remote-tracking branch 'origin/develop' into cderb/env-var-update
cderb Nov 21, 2023
263917e
mergefix
cderb Nov 22, 2023
2be776c
add Unset method for env, update assert string
cderb Nov 22, 2023
b597b81
fix
cderb Nov 22, 2023
707ce2d
Merge branch 'develop' into cderb/env-var-update
cderb Nov 22, 2023
c1c8336
Merge branch 'develop' into cderb/env-var-update
cderb Nov 22, 2023
4dc46ef
Merge branch 'develop' into cderb/env-var-update
xinlipn Nov 26, 2023
ec05c72
Ported sl/conv_igemm_dynamic_dlops chg to Pr2514
xinlipn Nov 27, 2023
64c53e1
Merge branch 'develop' into cderb/env-var-update
cderb Nov 27, 2023
568a2cf
Update test/CMakeLists.txt and supported GPU for one test
xinlipn Nov 28, 2023
1aea239
Merge remote-tracking branch 'origin/develop' into cderb/env-var-update
cderb Nov 28, 2023
11c11b2
Merge branch 'develop' into cderb/env-var-update
cderb Nov 28, 2023
589b8d1
Merge branch 'develop' into cderb/env-var-update
xinlipn Nov 30, 2023
ee0ca2f
Fix build errors
xinlipn Nov 30, 2023
0140d43
Fix build errors
xinlipn Nov 30, 2023
46dad61
Merge remote-tracking branch 'origin/cderb/env-var-update' into sl/co…
cderb Dec 1, 2023
5a95fe4
Merge remote-tracking branch 'origin/develop' into sl/conv_igemm_dyna…
cderb Dec 1, 2023
cd8a3fd
Remove dated miopenInt8x4 enum
xinlipn Dec 2, 2023
6f37660
Reformat and fix build errors
xinlipn Dec 4, 2023
7de180a
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
cderb Dec 4, 2023
fec43bb
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
xinlipn Dec 6, 2023
acfe592
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
cderb Dec 11, 2023
faac072
draft changes for combining gtest binaries
cderb Dec 11, 2023
ad3e487
more linking fixes
cderb Dec 12, 2023
645e289
add inline to avoid duplicate definition error
amberhassaan Dec 12, 2023
f094cc9
replace GetDataType with miopen_type
cderb Dec 12, 2023
85e64f8
Merge branch 'cderb/gtest_package' of https://github.com/ROCmSoftware…
cderb Dec 12, 2023
47ee6e0
fix template body missing error
amberhassaan Dec 12, 2023
457d265
fix linking issues
cderb Dec 12, 2023
3dc71ef
resolve compile errors
cderb Dec 12, 2023
c3229b8
Merge remote-tracking branch 'origin/develop' into cderb/gtest_package
cderb Dec 12, 2023
532c75f
reset hip_f8_impl
cderb Dec 12, 2023
3e9d843
resolve warnings, cleanup
cderb Dec 12, 2023
9c45745
remove if block from cmake
cderb Dec 13, 2023
1f87519
Merge branch 'develop' into cderb/gtest_package
cderb Dec 13, 2023
b650017
helper for evn variables update in gtests
CAHEK7 Dec 14, 2023
89f4782
add gtest binary to deb package
cderb Dec 14, 2023
b0d705d
Merge branch 'cderb/gtest_package' of https://github.com/ROCmSoftware…
cderb Dec 14, 2023
f529d95
tidy
cderb Dec 14, 2023
0f54296
Merge remote-tracking branch 'origin/develop' into cderb/gtest_package
cderb Dec 14, 2023
a6cbc3b
Merge remote-tracking branch 'origin/develop' into cderb/gtest_package
cderb Dec 14, 2023
c67f69e
move namespace for hip tidy to recognize gtest macro
cderb Dec 14, 2023
922f300
Merge branch 'develop' into C7/gtest_env
xinlipn Dec 15, 2023
8ac0916
format
cderb Dec 15, 2023
f68938d
add flag for discrete gtest
cderb Dec 15, 2023
d912f17
Merge branch 'develop' into cderb/gtest_package
cderb Dec 15, 2023
7711895
fix ci call to test_db_sync
cderb Dec 15, 2023
d13348e
Merge branch 'cderb/gtest_package' of https://github.com/ROCmSoftware…
cderb Dec 15, 2023
2941182
test refactoring and fix
CAHEK7 Dec 16, 2023
69ad878
Merge remote-tracking branch 'origin/develop' into sl/conv_igemm_dyna…
CAHEK7 Dec 17, 2023
dae3a0f
Merge remote-tracking branch 'origin/C7/gtest_env' into sl/conv_igemm…
CAHEK7 Dec 17, 2023
5f8b3be
Merge remote-tracking branch 'origin/cderb/gtest_package' into sl/con…
CAHEK7 Dec 17, 2023
d104a37
add namespaces to combine all the tests to a single binary
CAHEK7 Dec 17, 2023
48a16ba
Merge remote-tracking branch 'origin/develop' into cderb/gtest_package
cderb Dec 18, 2023
ce6a22c
add unique names for tests
cderb Dec 18, 2023
aeaa83f
resolve build conflicts
cderb Dec 18, 2023
9b8cfa4
add gtest precision checks, disable gtest pooling float
cderb Dec 18, 2023
eb3812c
default smoketest true, suspend nightly action
cderb Dec 18, 2023
1e7c6fc
test name + scope correction
cderb Dec 19, 2023
6d4e0e5
Merge branch 'cderb/gtest_package' of https://github.com/ROCmSoftware…
cderb Dec 19, 2023
5c88612
fix jenkins db_sync call
cderb Dec 19, 2023
ed002f5
Revert "[HotFix] revert #2580 and re-enable smoke tests (#2616)"
cderb Dec 19, 2023
7132297
Merge branch 'cderb/2580_revertx2' into cderb/gtest_package
cderb Dec 19, 2023
a13243f
Merge branch 'develop' into cderb/gtest_package
cderb Dec 19, 2023
1d27707
Merge remote-tracking branch 'origin/cderb/gtest_package' into sl/con…
CAHEK7 Dec 20, 2023
39fcc4f
fix typo
CAHEK7 Dec 20, 2023
8032511
fix deepbench for single-package gtest
CAHEK7 Dec 20, 2023
fed0b7c
Merge remote-tracking branch 'origin/develop' into cderb/gtest_package
CAHEK7 Dec 20, 2023
c4d224a
Merge remote-tracking branch 'origin/cderb/gtest_package' into sl/con…
CAHEK7 Dec 20, 2023
64eed1b
fix testsuite name
CAHEK7 Dec 21, 2023
b2eeb23
Merge branch 'develop' into cderb/gtest_package
junliume Dec 21, 2023
a719d15
Build discrete tests by default,
JehandadKhan Dec 21, 2023
cfdd95c
revert nightly workflow change
JehandadKhan Dec 21, 2023
996e342
Merge branch 'develop' into cderb/gtest_package
junliume Dec 21, 2023
d2d16b3
fix naming
CAHEK7 Dec 21, 2023
cf04faa
Merge remote-tracking branch 'origin/cderb/gtest_package' into sl/con…
CAHEK7 Dec 21, 2023
4b554b6
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
CAHEK7 Dec 22, 2023
0af3007
Merge remote-tracking branch 'origin/develop' into sl/conv_igemm_dyna…
CAHEK7 Dec 22, 2023
365baca
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
CAHEK7 Dec 25, 2023
fafa177
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
xinlipn Jan 8, 2024
4008bca
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
xinlipn Jan 11, 2024
58286d6
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
xinlipn Jan 12, 2024
c5bd922
Merge branch 'develop' into sl/conv_igemm_dynamic_dlops_env_var_update
xinlipn Jan 14, 2024
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
554 changes: 0 additions & 554 deletions test/CMakeLists.txt

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions test/gtest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ function(add_gtest TEST_NAME TEST_CPP)
endif()
if(NOT WIN32) # TODO: cannot run on Windows due to missing DLL dependencies
# Enable CMake to discover the test binary
# Extend GTest DISCOVERY_TIMEOUT to 5 mins
gtest_discover_tests(${TEST_NAME} DISCOVERY_TIMEOUT 300 PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL};CODECOV_TEST=${CODECOV_TEST};MIOPEN_TEST_DBSYNC=${MIOPEN_TEST_DBSYNC}")
gtest_discover_tests(${TEST_NAME} DISCOVERY_TIMEOUT 300 PROPERTIES ENVIRONMENT "MIOPEN_USER_DB_PATH=${CMAKE_CURRENT_BINARY_DIR};MIOPEN_TEST_FLOAT_ARG=${MIOPEN_TEST_FLOAT_ARG};MIOPEN_TEST_ALL=${MIOPEN_TEST_ALL};MIOPEN_TEST_MLIR=${MIOPEN_TEST_MLIR};MIOPEN_TEST_COMPOSABLEKERNEL=${MIOPEN_TEST_COMPOSABLEKERNEL};CODECOV_TEST=${CODECOV_TEST};MIOPEN_TEST_DBSYNC=${MIOPEN_TEST_DBSYNC};MIOPEN_TEST_CONV=${MIOPEN_TEST_CONV};MIOPEN_TEST_DEEPBENCH=${MIOPEN_TEST_DEEPBENCH};MIOPEN_DEBUG_TUNING_ITERATIONS_MAX=${MIOPEN_DEBUG_TUNING_ITERATIONS_MAX}")
endif()
target_link_libraries(${TEST_NAME} BZip2::BZip2)
if(WIN32)
Expand Down
130 changes: 130 additions & 0 deletions test/gtest/conv_ck_igemm_fwd_v6r1_dlops_nchw.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/*******************************************************************************
*
* MIT License
*
* Copyright (c) 2023 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*******************************************************************************/
#include <tuple>
#include <string_view>

#include "gtest_common.hpp"

#include "../conv2d.hpp"

MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_TEST_ALL)

namespace conv_ck_igemm_fwd_v6r1_dlops_nchw {

auto GetTestCases()
{
const auto env = std::tuple{
std::pair{ENV(MIOPEN_FIND_MODE), std::string_view("normal")},
std::pair{ENV(MIOPEN_DEBUG_FIND_ONLY_SOLVER),
std::string_view("ConvCkIgemmFwdV6r1DlopsNchw")},
std::pair{ENV(MIOPEN_DEBUG_CONV_CK_IGEMM_FWD_V6R1_DLOPS_NCHW), std::string_view("1")}};

const std::string v = " --verbose";
const std::string dis_bk_data = " --disable-backward-data";
const std::string dis_bk_wei = " --disable-backward-weights";

return std::vector{
// clang-format off
std::pair{env, v + " --input 128 1024 14 14 --weights 2048 1024 1 1 --pads_strides_dilations 0 0 2 2 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 14 14 --weights 256 1024 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 1024 14 14 --weights 512 1024 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 128 28 28 --weights 128 1024 3 3 --pads_strides_dilations 1 1 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 128 28 28 --weights 512 128 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 128 58 58 --weights 128 128 3 3 --pads_strides_dilations 1 1 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 2048 7 7 --weights 512 2048 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 14 14 --weights 1024 256 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 14 14 --weights 256 256 3 3 --pads_strides_dilations 1 1 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 30 30 --weights 256 256 3 3 --pads_strides_dilations 0 0 2 2 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 56 56 --weights 128 256 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 56 56 --weights 512 256 1 1 --pads_strides_dilations 0 0 2 2 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 256 56 56 --weights 64 256 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 16 16 --weights 512 512 3 3 --pads_strides_dilations 0 0 2 2 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 28 28 --weights 1024 512 1 1 --pads_strides_dilations 0 0 2 2 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 28 28 --weights 128 512 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 28 28 --weights 256 512 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 7 7 --weights 2048 512 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 512 7 7 --weights 512 512 3 3 --pads_strides_dilations 1 1 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 64 56 56 --weights 256 64 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 64 56 56 --weights 64 64 1 1 --pads_strides_dilations 0 0 1 1 1 1" + dis_bk_data + dis_bk_wei},
std::pair{env, v + " --input 128 64 56 56 --weights 64 64 3 3 --pads_strides_dilations 1 1 1 1 1 1" + dis_bk_data + dis_bk_wei}
// clang-format on
};
}

using TestCase = decltype(GetTestCases())::value_type;

bool SkipTest() { return miopen::IsDisabled(ENV(MIOPEN_TEST_ALL)); }
class Conv2dFloat_conv_ck_igemm_fwd_v6r1_dlops_nchw : public FloatTestCase<std::vector<TestCase>>
{
};

class Conv2dHalf_conv_ck_igemm_fwd_v6r1_dlops_nchw : public HalfTestCase<std::vector<TestCase>>
{
};

bool IsTestSupportedForDevice()
{
using e_mask = enabled<Gpu::Default>;
using d_mask = disabled<Gpu::gfx908>;
return ::IsTestSupportedForDevMask<d_mask, e_mask>();
}

} // namespace conv_ck_igemm_fwd_v6r1_dlops_nchw
using namespace conv_ck_igemm_fwd_v6r1_dlops_nchw;

TEST_P(Conv2dFloat_conv_ck_igemm_fwd_v6r1_dlops_nchw, FloatTest)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, Conv2dFloat_conv_ck_igemm_fwd_v6r1_dlops_nchw>(
default_check);
}
else
{
GTEST_SKIP();
}
};

TEST_P(Conv2dHalf_conv_ck_igemm_fwd_v6r1_dlops_nchw, HalfTest)
{
if(IsTestSupportedForDevice() && !SkipTest())
{
invoke_with_params<conv2d_driver, Conv2dHalf_conv_ck_igemm_fwd_v6r1_dlops_nchw>(
default_check);
}
else
{
GTEST_SKIP();
}
};

INSTANTIATE_TEST_SUITE_P(ConvCkIgemmFwdV6r1DlopsNchw,
Conv2dFloat_conv_ck_igemm_fwd_v6r1_dlops_nchw,
testing::Values(GetTestCases()));

INSTANTIATE_TEST_SUITE_P(ConvCkIgemmFwdV6r1DlopsNchw,
Conv2dHalf_conv_ck_igemm_fwd_v6r1_dlops_nchw,
testing::Values(GetTestCases()));
Loading