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

Reshuffle and reduce test cases #147

Merged
merged 224 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
dc7cb27
Removed redundant pooling, conv2d configs. Moved around tests for res…
Mar 5, 2020
6bf491b
Formatting.
Mar 5, 2020
2afa74a
Separate cmd job function.
Mar 6, 2020
7502465
Prefixpath mistake.
Mar 7, 2020
4e5dbd0
Forgot to add prefix.
Mar 8, 2020
6c0db95
Fixed mssing prefix.
Mar 8, 2020
8bf2d23
Fixed missing build test_conv2d
Mar 8, 2020
dcdb496
Fixed missing build test_conv2d
Mar 8, 2020
c1ed664
Wrong path.
Mar 8, 2020
1d2c523
Uncomment tests
Mar 10, 2020
fac5d70
Merge branch 'develop' into reshuffleAndReduceTestCases
Mar 26, 2020
d1c58b4
WIP conv2d and common changes for sane testing.
Mar 30, 2020
cc0076f
Formatting.
Mar 30, 2020
6f03abe
Revamp conv2.
Mar 31, 2020
bda5d47
Formatting.
Mar 31, 2020
4f0a6d1
Fixed conv3d tests.
Apr 1, 2020
7c3d2ce
Merge branch 'develop' into reshuffleAndReduceTestCases
Apr 9, 2020
3b64c19
Set limit of the number of combinations for a specific dimension to r…
Apr 10, 2020
65e8b0b
Formatting.
Apr 10, 2020
bd4616d
Limit full tests to 5 and correct function name.
Apr 11, 2020
4732a31
Changed how the limit is selected.
Apr 12, 2020
91a435a
Corrected default limit_set value.
Apr 12, 2020
b2c8282
Limit to 4 on full short tests.
Apr 13, 2020
a41bd84
Place back the integer initialization code.
Apr 13, 2020
65a100a
Fixed inccorect arguments due to overlooked default values.
Apr 13, 2020
6516f79
[ci skip] add back inputs and weights.
Apr 15, 2020
028a871
Merge branch 'develop' into reshuffleAndReduceTestCases
Apr 27, 2020
5876ec3
Merge branch 'develop' into reshuffleAndReduceTestCases
May 20, 2020
b035c4e
Jenkinsfile updated.
May 21, 2020
854c1bd
Merge branch 'develop' into reshuffleAndReduceTestCases
May 21, 2020
3aaaf57
Fixed legacy arg parsing.
May 22, 2020
c1afcff
formatting.
May 27, 2020
bee78f5
Formatting.
May 27, 2020
53a23ab
Updated Jenkinsfile
May 27, 2020
a2dca7a
Corrected g++ path.
May 28, 2020
18c89a9
Add filter selections.
May 28, 2020
9e752c9
Revert changes to immediate 3d test.
May 28, 2020
09a1eae
Filter for immediate mode.
May 28, 2020
f9c38ec
Reverted over filtering configs.
May 29, 2020
5b344c3
Merge branch 'reshuffleAndReduceTestCases' of github.com:ROCmSoftware…
May 29, 2020
862ff97
No half tests on OpenCL backend.
May 29, 2020
4b7b18a
Incorrect usage of get spatial dims.
May 29, 2020
9871ccf
Limit to 3 levels.
May 30, 2020
e423450
Remove bfp16 for non-gfx908
May 31, 2020
e3722d4
Update hip-clang docker to release 3.5 and merge jenkinsfile changes.
Jun 3, 2020
520c81f
Missing quotes.
Jun 4, 2020
8b8fc5f
Merge branch 'reshuffleAndReduceTestCases' of github.com:ROCmSoftware…
Jun 4, 2020
63e8623
Added cmake variable to limit test length.
Jun 9, 2020
e0f5d44
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 10, 2020
6f7e3e6
Limit to 3
Jun 10, 2020
a1e258d
Limit bfp16 to 2.
Jun 12, 2020
ffa3088
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 16, 2020
86a79db
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 18, 2020
3d6a7e4
Add back gfx908 test flag.
Jun 19, 2020
51ead52
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 19, 2020
1ffc780
Forgot to tune on gfx908 cmake variable.
Jun 19, 2020
447603e
CmakeList.txt changes for reduced number of tests.
Jun 23, 2020
17a2904
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 24, 2020
e907e1a
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 25, 2020
389a64d
Update jenkins file.
Jun 25, 2020
7189bfd
Merge branch 'develop' into reshuffleAndReduceTestCases
Jun 29, 2020
a2ea2ae
Missing bfp16 flag.
Jun 29, 2020
bf3bd73
Merge branch 'reshuffleAndReduceTestCases' of github.com:ROCmSoftware…
Jul 1, 2020
cb594e0
Merge branch 'develop' into reshuffleAndReduceTestCases
Jul 1, 2020
5985ec7
Merge branch 'develop' into reshuffleAndReduceTestCases
Jul 11, 2020
d8adeb7
Limit to 2.
Jul 11, 2020
82483e7
Merge branch 'develop' into reshuffleAndReduceTestCases
Jul 14, 2020
34dab75
Logging with failing config.
Jul 14, 2020
71c3d1e
Merge branch 'develop' into reshuffleAndReduceTestCases
Jul 16, 2020
f200691
Merge branch 'develop' into reshuffleAndReduceTestCases
Jul 29, 2020
3fd3081
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 12, 2020
0f88a7e
Remove logging.
Aug 12, 2020
560574a
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 17, 2020
6cafc22
Upgrade to rocm 3.7
Aug 21, 2020
55ecb3a
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 21, 2020
371ad03
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 24, 2020
caee86e
fix pooling bwd index error
ce1adon Aug 26, 2020
21e36ea
Merge branch 'pool_asym' into reshuffleAndReduceTestCases
ce1adon Aug 26, 2020
0e570ce
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 27, 2020
c537205
Merge branch 'develop' into reshuffleAndReduceTestCases
Aug 27, 2020
3271f9a
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 9, 2020
1b64c7c
Switch full fp32 test to debug to find issue with conv3d test.
Sep 12, 2020
72a6b8a
Failing test first.
Sep 12, 2020
5ce3dcf
Isolate conv3d test.
Sep 14, 2020
38535e5
Refactor test
Sep 14, 2020
a795a3f
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 20, 2020
8f14273
Cut away conv3d to its own test.
Sep 20, 2020
3c021ac
omit testflag variable.
Sep 20, 2020
5f8fd0a
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 20, 2020
d65d5bb
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 21, 2020
a3a8815
Split of int8.
Sep 21, 2020
b4aef92
Filter conv3d.
Sep 22, 2020
3a8833a
Still trying to get conv3d separated.
Sep 23, 2020
543d97c
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 29, 2020
d137ac5
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 29, 2020
2d41f57
Adding logging line.
Sep 29, 2020
22e0e3f
Merge branch 'develop' into reshuffleAndReduceTestCases
Sep 30, 2020
6106250
bump to ROCm 3.8
Sep 30, 2020
1a84fcc
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 5, 2020
1f60ca2
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 5, 2020
394ac39
Factor out convolutions from tests.
Oct 5, 2020
44f20c7
Removed bad comments.
Oct 5, 2020
93035b5
Merge branch 'reshuffleAndReduceTestCases' of github.com:ROCmSoftware…
Oct 7, 2020
ac3ed53
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 7, 2020
914f924
Skip conv2d for full tests.
Oct 9, 2020
f401005
Bump version.
Oct 9, 2020
d98ad84
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 11, 2020
6410a24
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 11, 2020
cd33bf1
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 12, 2020
8c97270
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 12, 2020
67573b6
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 14, 2020
f8201be
Change cmake variables.
Oct 14, 2020
5fbe4d3
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 14, 2020
13f7f36
More cmakelist changes.
Oct 15, 2020
dc133ff
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 15, 2020
b747743
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 16, 2020
d4914e0
Split conv2d into their own test.
Oct 16, 2020
69a433a
Split parallel job for survivability.
Oct 16, 2020
3288b24
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 21, 2020
17af0f3
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 24, 2020
916e3d3
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 25, 2020
920c4d5
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 25, 2020
9534fd6
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 25, 2020
47a5ad0
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 27, 2020
49e49d6
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Oct 29, 2020
a334414
Merge branch 'develop' into reshuffleAndReduceTestCases
Oct 29, 2020
3c66865
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Nov 1, 2020
22e1c9c
Merge branch 'develop' of github.com:ROCmSoftwarePlatform/MIOpen into…
Nov 2, 2020
8f510d7
Merge branch 'develop' into reshuffleAndReduceTestCases
Nov 3, 2020
99ba13f
Narrowing the datatype of variant.
Nov 3, 2020
a134c2a
Too many closing parans.
Nov 3, 2020
0f31af8
Docker check.
Nov 4, 2020
c6df23e
add image definition.
Nov 5, 2020
c148100
Add variant variable.
Nov 5, 2020
1d3161c
Merge branch 'develop' into reshuffleAndReduceTestCases
Nov 15, 2020
7b28108
Missing curly braces
Nov 15, 2020
d06c645
Missing step.
Nov 15, 2020
dbd3aff
Remove GCC half as it is unsupported.
Nov 16, 2020
0bb6ffe
Merge branch 'develop' into reshuffleAndReduceTestCases
Nov 20, 2020
ff9adc7
Force gfx908.
Nov 20, 2020
ee962eb
Explicit HIP backend flag.
Nov 23, 2020
2518914
Merge develop
Dec 3, 2020
7fdafab
Merge branch 'develop' into reshuffleAndReduceTestCases
Dec 10, 2020
d5b646d
Fixed all tests on gfx908
Dec 11, 2020
1732b90
Get rid of miopen-tensile filter.
Dec 11, 2020
7db4b8e
Fix the no-list bug.
Dec 12, 2020
74f33df
Fixed bias filtering issue, and remove conv2d filtering on half test.
Dec 14, 2020
4c6acc9
Formatting.
Dec 15, 2020
458757b
Merged stages due to redundant testing.:
Dec 15, 2020
afa10c2
Move to ROCm 3.9
Dec 16, 2020
d71bf6c
Merge branch 'develop' into reshuffleAndReduceTestCases
Dec 22, 2020
08bd411
Merge branch 'develop' into reshuffleAndReduceTestCases
Feb 5, 2021
fd02d1d
fix after broken merge
shurale-nkn Mar 19, 2021
6f97399
Merge remote-tracking branch 'develop' into HEAD
shurale-nkn Mar 20, 2021
0fbfe1d
Jenkinsfile update
shurale-nkn Mar 23, 2021
1cc4c58
Merge remote-tracking branch 'develop' into HEAD
shurale-nkn Mar 23, 2021
25dff7b
Jenkins code update
shurale-nkn Mar 26, 2021
c354721
Jenkins fix
shurale-nkn Mar 26, 2021
97d14c0
Jenkins fix
shurale-nkn Mar 28, 2021
4dc164d
fixed tensor generation with group conv
shurale-nkn Apr 6, 2021
4ebb7eb
Merge remote-tracking branch 'Public/develop' into HEAD
shurale-nkn Apr 8, 2021
6a0faa3
fixed limit usage
shurale-nkn Apr 8, 2021
6325c27
test reshufl
shurale-nkn Apr 12, 2021
9312f7d
jenkins cmd reduced
shurale-nkn Apr 12, 2021
5aa78ff
parameterized build improved
shurale-nkn Apr 12, 2021
5ccf6c2
config update
shurale-nkn Apr 14, 2021
4663a5b
less tests
shurale-nkn Apr 14, 2021
120454b
next conv setup
shurale-nkn Apr 15, 2021
5e4ef53
Extratests for vega20
shurale-nkn Apr 16, 2021
1b457f3
Cmake update
shurale-nkn Apr 16, 2021
51e3327
Pipline update less duplications
shurale-nkn Apr 16, 2021
883778b
Hip don't work with codecov. Disabled
shurale-nkn Apr 16, 2021
e50d93d
remove some env
shurale-nkn Apr 16, 2021
7b17f90
test update
shurale-nkn Apr 17, 2021
e734be8
missing braces
shurale-nkn Apr 18, 2021
f8fdee4
cmake: move to old place
shurale-nkn Apr 18, 2021
32f5edb
REMOVE_DUPLICATES fixed
shurale-nkn Apr 19, 2021
67710e4
LONG_TESTS using fixed
shurale-nkn Apr 19, 2021
32e2a4c
Workaround for (UndefinedBehaviorSanitizer: undefined-behavior)
shurale-nkn Apr 20, 2021
3497a57
make codecov test faster
shurale-nkn Apr 20, 2021
d463247
fixed __attribute__ for gcc
shurale-nkn Apr 20, 2021
40d2114
comgr fix
shurale-nkn Apr 22, 2021
6ab727b
WORKAROUND for ISSUE_890: some tests disabled
shurale-nkn Apr 23, 2021
c9c3257
limit decreased
shurale-nkn Apr 27, 2021
c1f7450
added limit_multiplier for more important parts of layer
shurale-nkn Apr 27, 2021
d761dce
pooling test rebalanced
shurale-nkn Apr 27, 2021
04a427c
Merge remote-tracking branch 'develop' into reshuffleAndReduceTestCases
shurale-nkn Apr 29, 2021
0f56482
missing parameters for tensile
shurale-nkn Apr 30, 2021
c07443f
replaced tests for CODECOV
shurale-nkn Apr 30, 2021
c070060
fix test_immed_conv2d_codecov
shurale-nkn Apr 30, 2021
37a6935
test conv2d rebalance
shurale-nkn May 1, 2021
8d07bc0
LONG_TESTS list update
shurale-nkn May 4, 2021
e55ac8a
test_conv3d_extra typo
shurale-nkn May 4, 2021
733b876
WORKAROUND ROCM3.7 compiler problems with tests
shurale-nkn May 5, 2021
7dc1f7d
WORKAROUND ROCM3.7 compiler problems with tests 2
shurale-nkn May 5, 2021
4de974e
WORKAROUND ROCM3.7 compiler problems with tests 3
shurale-nkn May 5, 2021
ffe1dee
Merge remote-tracking branch 'develop' into reshuffleAndReduceTestCases
shurale-nkn May 11, 2021
5a8ad6f
WORKAROUND for issue 917
shurale-nkn May 11, 2021
8e34369
remove workaround for issue 873
shurale-nkn May 11, 2021
238c4e6
remove workaround for issue 870
shurale-nkn May 11, 2021
adb4c5a
jenkinsfile typo
shurale-nkn May 11, 2021
8670a01
jenkins ext libs step fix
shurale-nkn May 11, 2021
89c31d4
test_conv3d_extra takes more than 5 hrs on jenkins. locally <10min
shurale-nkn May 12, 2021
3919ba8
expand WORKAROUND_iGemm_917
shurale-nkn May 12, 2021
193fe5e
disable-verification for codecov to save time in debug mode
shurale-nkn May 12, 2021
0d568b2
disable-verification typo in argument
shurale-nkn May 12, 2021
e36b80c
typo fix
shurale-nkn May 13, 2021
e3daabb
test_conv3d_extra disabled
shurale-nkn May 13, 2021
1878b1b
expand WORKAROUND_iGemm_917
shurale-nkn May 17, 2021
c1f3733
WORKAROUND_iGemm_936
shurale-nkn May 18, 2021
0e03121
tests in CMakeList ignoring failed verification without this fix
shurale-nkn May 21, 2021
f38c716
disable WA for fixed issues
shurale-nkn Jun 15, 2021
af59573
change default
shurale-nkn Jun 15, 2021
03ac8d0
Merge remote-tracking branch 'develop' into reshuffleAndReduceTestCases
shurale-nkn Jun 16, 2021
93c29f2
fix typo
shurale-nkn Jun 17, 2021
87b96e2
typo fix
shurale-nkn Jun 17, 2021
f3ca1c8
WORKAROUND_ISSUE_936
shurale-nkn Jun 21, 2021
d393291
Merge remote-tracking branch 'Public/develop' into HEAD
shurale-nkn Jul 4, 2021
90139ea
typo
shurale-nkn Jul 4, 2021
391ba79
low smoke update
shurale-nkn Jul 4, 2021
1ac9899
fix tify
shurale-nkn Jul 4, 2021
cc6231b
typo
shurale-nkn Jul 5, 2021
470acfe
rmoved unnecessary code
shurale-nkn Jul 5, 2021
002c320
Merge branch 'develop' into reshuffleAndReduceTestCases
atamazov Jul 5, 2021
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
830 changes: 255 additions & 575 deletions Jenkinsfile

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/ocl/batchnormocl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ void BatchNormBackward(Handle& handle,
unsigned int ldsgcn = 0;
unsigned int ldsnogcn = 0;
bool single = true;
unsigned int variant = 1;
int variant = 1;

//*************************************************************************************************
// N*H*W < 32M and H*W > 1024, use batchnorm variant#1 implementation which parallelize
Expand Down
209 changes: 165 additions & 44 deletions test/CMakeLists.txt

Large diffs are not rendered by default.

22 changes: 18 additions & 4 deletions test/conv2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,26 @@ struct conv2d_driver : conv_driver<T>
{
conv2d_driver() : conv_driver<T>()
{
this->add(this->input, "input", this->get_tensor(get_inputs, tensor_elem_gen_integer()));
this->add(
this->weights, "weights", this->get_tensor(get_weights, tensor_elem_gen_integer()));
this->add(this->input_dims, "input");
this->add(this->weight_tensor_dims, "weights");
this->add(this->batch_size,
"batch_size",
this->generate_data_limited(this->get_batch_sizes(), 1));
this->add(this->input_channels,
"input_channels",
this->generate_data_limited(this->get_input_channels(), 1, {32}));
this->add(this->output_channels,
"output_channels",
this->generate_data_limited(this->get_output_channels(), 1, {64}));
this->add(this->spatial_dim_elements,
"spatial_dim_elements",
this->generate_data_limited(this->get_2d_spatial_dims(), 1, {28, 28}));
this->add(this->filter_dims,
"filter_dims",
this->generate_data_limited(this->get_2d_filter_dims(), 2, {3, 3}));
this->add(this->pads_strides_dilations,
"pads_strides_dilations",
this->generate_data(this->get_2d_pads_strides_dilations()));
this->generate_data_limited(this->get_2d_pads_strides_dilations(), 2));
this->add(this->trans_output_pads,
"trans_output_pads",
this->generate_data(this->get_2d_trans_output_pads()));
Expand Down
27 changes: 19 additions & 8 deletions test/conv3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,29 @@ struct conv3d_driver : conv_driver<T>
{
conv3d_driver() : conv_driver<T>()
{
this->add(this->input,
"input",
this->get_tensor(get_3d_conv_input_shapes, tensor_elem_gen_integer()));
this->add(this->weights,
"weights",
this->get_tensor(get_3d_conv_weight_shapes, tensor_elem_gen_integer()));
this->add(this->input_dims, "input");
this->add(this->weight_tensor_dims, "weights");
this->add(this->batch_size,
"batch_size",
this->generate_data_limited(this->get_batch_sizes(), 1, {8}));
this->add(this->input_channels,
"input_channels",
this->generate_data_limited(this->get_input_channels(), 1, {32}));
this->add(this->output_channels,
"output_channels",
this->generate_data_limited(this->get_output_channels(), 1, {32}));
this->add(this->spatial_dim_elements,
"spatial_dim_elements",
this->generate_data_limited(this->get_3d_spatial_dims(), 1, {16, 16, 16}));
this->add(this->filter_dims,
"filter_dims",
this->generate_data_limited(this->get_3d_filter_dims(), 2, {3, 3, 3}));
this->add(this->pads_strides_dilations,
"pads_strides_dilations",
this->generate_data(this->get_3d_pads_strides_dilations()));
this->generate_data_limited(this->get_3d_pads_strides_dilations(), 2));
this->add(this->trans_output_pads,
"trans_output_pads",
this->generate_data(this->get_3d_trans_output_pads()));
this->generate_data_limited(this->get_3d_trans_output_pads(), 1));
this->add(this->in_layout, "in_layout", this->generate_data({"NCDHW"}));
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCDHW"}));
this->add(this->out_layout, "out_layout", this->generate_data({"NCDHW"}));
Expand Down
152 changes: 143 additions & 9 deletions test/conv_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,6 +1571,13 @@ struct conv_driver : test_driver
miopen::ConvolutionDescriptor filter;
std::string conv_mode;
std::string pad_mode;
std::vector<std::size_t> spatial_dim_elements{};
std::vector<std::size_t> input_dims{};
std::vector<std::size_t> weight_tensor_dims{};
std::vector<std::size_t> filter_dims{};
std::size_t batch_size{};
std::size_t input_channels{};
std::size_t output_channels{};
std::string in_layout;
std::string fil_layout; // keep same as MIOpenDriver argument name
std::string out_layout;
Expand All @@ -1596,6 +1603,41 @@ struct conv_driver : test_driver
{"VALID", miopenPaddingValid},
{"DEFAULT", miopenPaddingDefault}};

std::vector<std::size_t> get_batch_sizes() { return {1, 8, 2, 64, 30, 128, 352, 512}; }

std::vector<std::vector<std::size_t>> get_2d_spatial_dims()
{
return {{14, 14},
{28, 28},
{32, 32},
{7, 7},
{17, 17},
{56, 56},
{55, 55},
{64, 128},
{224, 224},
{1024, 2048},
{3072, 3072},
{1, 1},
{1, 7},
{7, 1}};
}

std::vector<std::vector<std::size_t>> get_2d_filter_dims()
{
return {{1, 1}, {3, 3}, {1, 7}, {5, 5}, {7, 1}, {7, 7}, {11, 11}, {2, 2}, {4, 4}};
}

std::vector<std::size_t> get_output_channels()
{
return {32, 64, 16, 128, 96, 112, 192, 256, 320, 512, 1024};
}

std::vector<std::size_t> get_input_channels()
{
return {16, 32, 3, 128, 96, 112, 192, 256, 320, 512, 1024};
}

std::vector<std::vector<int>> get_2d_pads_strides_dilations()
{
return {{0, 0, 1, 1, 1, 1},
Expand All @@ -1611,6 +1653,32 @@ struct conv_driver : test_driver
{1, 1, 2, 2, 2, 1}};
}

std::vector<std::vector<std::size_t>> get_3d_spatial_dims()
{
return {{3, 4, 4},
{4, 9, 9},
{3, 14, 14},
{4, 28, 28},
{4, 56, 56},
{4, 161, 700},
{4, 227, 227},
{1, 1, 1},
{1, 2, 2}};
}

std::vector<std::vector<std::size_t>> get_3d_filter_dims()
{
return {{1, 1, 1},
{3, 3, 3},
{3, 5, 5},
{3, 7, 7},
{5, 7, 7},
{3, 11, 11},
{3, 1, 7},
{3, 7, 1},
{3, 5, 20}};
}

std::vector<std::vector<int>> get_2d_trans_output_pads() { return {{0, 0}}; }

std::vector<std::vector<int>> get_3d_pads_strides_dilations()
Expand All @@ -1636,11 +1704,12 @@ struct conv_driver : test_driver
{
for(int i = 2; i < 4; i++)
{
if(input.desc.GetSize() == i + 2 and weights.desc.GetSize() == i + 2 and
if(input_dims.size() == i + 2 and weight_tensor_dims.size() == i + 2 and
pads_strides_dilations.size() == i * 3 and trans_output_pads.size() == i)
return i;
}
return -1;
std::cout << "FAILED: get_spatial_dim() can't calculate dims count." << std::endl;
exit(-1); // NOLINT (concurrency-mt-unsafe)
}

conv_driver()
Expand All @@ -1661,6 +1730,69 @@ struct conv_driver : test_driver

void run()
{

if(!input_dims.empty())
filter.spatialDim = get_spatial_dim();
else
filter.spatialDim = filter_dims.size();

filter.mode = cmode_lookup[miopen::ToUpper(conv_mode)];
filter.paddingMode = pmode_lookup[miopen::ToUpper(pad_mode)];
std::size_t spatial_dim = filter.GetSpatialDimension();
filter.group_count = std::max(static_cast<int>(groupCount), 1);

if(!input_dims.empty())
{
input = tensor<T>{input_dims}.generate(tensor_elem_gen_integer{17});
batch_size = input_dims.at(0);
input_channels = input_dims.at(1);
std::copy(input_dims.begin() + 2, input_dims.end(), spatial_dim_elements.begin());
}
else if(spatial_dim == 2)
{
input = tensor<T>{
batch_size,
input_channels,
spatial_dim_elements.at(0),
spatial_dim_elements.at(
1)}.generate(tensor_elem_gen_integer{17});
}
else if(spatial_dim == 3)
{
input = tensor<T>{
batch_size,
input_channels,
spatial_dim_elements.at(0),
spatial_dim_elements.at(1),
spatial_dim_elements.at(
2)}.generate(tensor_elem_gen_integer{17});
}

if(!weight_tensor_dims.empty())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{
weights = tensor<T>{weight_tensor_dims}.generate(tensor_elem_gen_integer{17});
output_channels = weight_tensor_dims.at(0);
}
else if(spatial_dim == 2)
{
weights = tensor<T>{
output_channels,
input_channels / filter.group_count,
filter_dims.at(0),
filter_dims.at(
1)}.generate(tensor_elem_gen_integer{17});
}
else if(spatial_dim == 3)
{
weights = tensor<T>{
output_channels,
input_channels / filter.group_count,
filter_dims.at(0),
filter_dims.at(1),
filter_dims.at(
2)}.generate(tensor_elem_gen_integer{17});
}

if(input.desc.GetSize() != in_layout.size() ||
weights.desc.GetSize() != fil_layout.size() || input.desc.GetSize() != out_layout.size())
{
Expand Down Expand Up @@ -1695,11 +1827,6 @@ struct conv_driver : test_driver
weights.desc = miopen::TensorDescriptor(miopen_type<T>{}, dim_lens, dim_strides);
}

filter.spatialDim = get_spatial_dim();
filter.mode = cmode_lookup[miopen::ToUpper(conv_mode)];
filter.paddingMode = pmode_lookup[miopen::ToUpper(pad_mode)];
std::size_t spatial_dim = filter.GetSpatialDimension();

if(input.desc.GetSize() != 2 + spatial_dim || weights.desc.GetSize() != 2 + spatial_dim ||
pads_strides_dilations.size() != 3 * spatial_dim ||
trans_output_pads.size() != spatial_dim)
Expand All @@ -1721,8 +1848,6 @@ struct conv_driver : test_driver
filter.dilations.begin());
std::copy_n(trans_output_pads.begin(), spatial_dim, filter.trans_output_pads.begin());

filter.group_count = std::max(static_cast<int>(groupCount), 1);

std::size_t in_c_len = input.desc.GetLengths()[1];
std::size_t wei_k_len = weights.desc.GetLengths()[0];
std::size_t wei_c_len = weights.desc.GetLengths()[1];
Expand Down Expand Up @@ -2113,6 +2238,15 @@ struct conv_bias_driver : test_driver

tensor<T> bias(bias_lens);

if(!(bias.desc.GetLengths()[0] == 1 &&
bias.desc.GetLengths()[1] == output.desc.GetLengths()[0] &&
std::all_of(bias.desc.GetLengths().begin() + 2,
bias.desc.GetLengths().end(),
[](auto v) { return v == 1; })))
{
return;
}

size_t total_mem =
bias.desc.GetNumBytes() + output.desc.GetNumBytes(); // estimate based on backward pass
size_t device_mem = get_handle().GetGlobalMemorySize();
Expand Down
39 changes: 39 additions & 0 deletions test/driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ struct test_driver
std::string cache_path = compute_cache_path();
miopenDataType_t type = miopenFloat;
bool full_set = false;
int limit_set = 0;
bool verbose = false;
double tolerance = 80;
bool time = false;
Expand All @@ -198,6 +199,7 @@ struct test_driver
template <class Visitor>
void parse(Visitor v)
{
v(limit_set, {"--limit"}, "Limits the number of generated test elements.");
v(full_set, {"--all"}, "Run all tests");
v(verbose, {"--verbose", "-v"}, "Run verbose mode");
v(tolerance, {"--tolerance", "-t"}, "Set test tolerance");
Expand Down Expand Up @@ -477,6 +479,25 @@ struct test_driver
}};
}

template <class T>
generate_data_t<std::vector<T>>
generate_data_limited(std::vector<T> dims, int limit_multiplier, T single)
{
return {[=]() -> std::vector<T> {
if(limit_set > 0)
{
auto endpoint =
std::min(static_cast<int>(dims.size()), limit_set * limit_multiplier);
std::vector<T> subvec(dims.cbegin(), dims.cbegin() + endpoint);
return subvec;
}
else if(full_set)
return dims;
else
return {single};
}};
}

template <class T>
generate_data_t<std::vector<T>> generate_data(std::initializer_list<T> dims)
{
Expand All @@ -501,6 +522,24 @@ struct test_driver
}};
}

template <class T>
generate_data_t<std::vector<T>> generate_data_limited(std::vector<T> dims, int limit_multiplier)
{
return {[=]() -> std::vector<T> {
if(limit_set > 0)
{
auto endpoint =
std::min(static_cast<int>(dims.size()), limit_set * limit_multiplier);
std::vector<T> subvec(dims.cbegin(), dims.cbegin() + endpoint);
return subvec;
}
else if(full_set)
return dims;
else
return {dims.front()};
}};
}

template <class F, class T>
auto lazy_generate_data(F f, T single) -> generate_data_t<decltype(f())>
{
Expand Down
26 changes: 19 additions & 7 deletions test/immed_conv2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,29 @@ struct conv2d_driver : conv_driver<T, true>
{
conv2d_driver() : conv_driver<T, true>()
{
this->add(
this->input, "input", this->get_tensor(get_immed_inputs, tensor_elem_gen_integer()));
this->add(this->weights,
"weights",
this->get_tensor(get_immed_weights, tensor_elem_gen_integer()));
this->add(this->input_dims, "input");
this->add(this->weight_tensor_dims, "weights");
this->add(this->batch_size,
"batch_size",
this->generate_data_limited(this->get_batch_sizes(), 1, {16}));
this->add(this->input_channels,
"input_channels",
this->generate_data_limited(this->get_input_channels(), 1, {32}));
this->add(this->output_channels,
"output_channels",
this->generate_data_limited(this->get_output_channels(), 1, {32}));
this->add(this->spatial_dim_elements,
"spatial_dim_elements",
this->generate_data_limited(this->get_2d_spatial_dims(), 1, {56, 56}));
this->add(this->filter_dims,
"filter_dims",
this->generate_data_limited(this->get_2d_filter_dims(), 2, {3, 3}));
this->add(this->pads_strides_dilations,
"pads_strides_dilations",
this->generate_data(this->get_2d_pads_strides_dilations()));
this->generate_data_limited(this->get_2d_pads_strides_dilations(), 2));
this->add(this->trans_output_pads,
"trans_output_pads",
this->generate_data(this->get_2d_trans_output_pads()));
this->generate_data_limited(this->get_2d_trans_output_pads(), 1));
this->add(this->in_layout, "in_layout", this->generate_data({"NCHW"}));
this->add(this->fil_layout, "fil_layout", this->generate_data({"NCHW"}));
this->add(this->out_layout, "out_layout", this->generate_data({"NCHW"}));
Expand Down
Loading