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

[gtest] conversion for lstm #2545

Merged
merged 122 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 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
4f46583
lstm gtest
cderb Nov 16, 2023
3cfee15
missing include
cderb Nov 16, 2023
65f0f89
string fix
cderb Nov 16, 2023
f8afcc8
fixup lstm gtest
cderb Nov 16, 2023
8024a5e
Merge remote-tracking branch 'origin/cderb/env-var-update' into cderb…
cderb Nov 16, 2023
9a66976
tidy
cderb Nov 17, 2023
b422b57
tidy
cderb Nov 17, 2023
3a42c21
remove commented lines
cderb Nov 17, 2023
61de002
Merge remote-tracking branch 'origin/develop' into cderb/env-var-update
cderb Nov 17, 2023
479d97e
mergefix
cderb Nov 17, 2023
92c8374
Merge remote-tracking branch 'origin/cderb/env-var-update' into cderb…
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
9ac26bb
Merge remote-tracking branch 'origin/cderb/env-var-update' into cderb…
cderb Nov 21, 2023
dec1532
env mergefix
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
30ab419
Merge branch 'cderb/env-var-update' into cderb/gtest
cderb Nov 21, 2023
263917e
mergefix
cderb Nov 22, 2023
d986103
Merge branch 'cderb/env-var-update' into cderb/gtest
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
64c53e1
Merge branch 'develop' into cderb/env-var-update
cderb Nov 27, 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
47458e8
Merge remote-tracking branch 'origin/cderb/env-var-update' into cderb…
cderb Nov 30, 2023
58e5750
Merge remote-tracking branch 'origin/develop' into cderb/gtest
cderb Nov 30, 2023
79cdd94
Merge remote-tracking branch 'origin/develop' into cderb/gtest
cderb Dec 4, 2023
ecb6fbe
add restructuring for lstm gtest
cderb Dec 4, 2023
6b5d1f9
convert lstm gtest format
cderb Dec 4, 2023
ab8f2c8
update lstm_extra skip condition
cderb Dec 4, 2023
91e7bda
clang format
cderb Dec 4, 2023
cc8e11c
Merge branch 'develop' into cderb/gtest
cderb Dec 5, 2023
a448547
Merge branch 'develop' into cderb/gtest
xinlipn Dec 11, 2023
af956d4
Merge branch 'develop' into cderb/gtest
cderb Dec 11, 2023
f1b6df2
rm unused header
cderb Dec 11, 2023
e6f57fd
rename lstm tests, add half test, add test flags
cderb Dec 11, 2023
5c1552c
restore lstm.cpp main
cderb Dec 11, 2023
86c90e1
cleanup, pass ENV to gtest
cderb Dec 13, 2023
6c44486
Merge branch 'develop' into cderb/gtest
cderb Dec 13, 2023
80c6bff
cderb/gtest : fix merge conflict
bghimireamd Dec 14, 2023
6147d1e
cderb/gtest: fix clang format
bghimireamd Dec 14, 2023
2582815
cderb/gtest : fix compilation error
bghimireamd Dec 14, 2023
301b3d2
Merge branch 'develop' into cderb/gtest
cderb Dec 14, 2023
b7e949c
cderb/gtest : set environment variable
bghimireamd Dec 18, 2023
586d237
cderb/gtest : fixed merge conflict
bghimireamd Dec 18, 2023
1054497
cderb/gtest : add missing env var and add namespace around test
bghimireamd Dec 18, 2023
2de7073
cderb/gtest : fix gtest name, fixed merge conflict
bghimireamd Dec 19, 2023
e937886
Merge branch 'develop' into cderb/gtest
cderb Dec 19, 2023
0efa608
Merge branch 'develop' into cderb/gtest
junliume Dec 24, 2023
1ccc296
Merge branch 'develop' into cderb/gtest
cderb Jan 4, 2024
95f8faf
redress lstm test environs
cderb Jan 4, 2024
22e633e
clang format
cderb Jan 4, 2024
4142ff0
Merge branch 'develop' into cderb/gtest
cderb Jan 5, 2024
29269c3
reenable device support check
cderb Jan 5, 2024
7ca4d31
Merge branch 'develop' into cderb/gtest
cderb Jan 5, 2024
418be36
Merge branch 'develop' into cderb/gtest
cderb Jan 8, 2024
4b05c35
Merge branch 'develop' into cderb/gtest
cderb Jan 11, 2024
3a32d79
Merge branch 'develop' into cderb/gtest
cderb Jan 15, 2024
34093b3
Remove half precision and not needed code
xinlipn Jan 23, 2024
799793d
Remove unneeded code
xinlipn Jan 29, 2024
45c16ce
Merge branch 'develop' into cderb/gtest
xinlipn Jan 31, 2024
8ba8342
Merge branch 'develop' into cderb/gtest
xinlipn Feb 5, 2024
51e15f1
Fix build
xinlipn Feb 5, 2024
fd3f0ec
Run test when standalone run OR full tests enabled with "--float"
xinlipn Feb 6, 2024
0616af1
Merge branch 'develop' into cderb/gtest
xinlipn Feb 6, 2024
6def350
Fix make error
xinlipn Feb 7, 2024
3f4c6bf
Merge branch 'develop' into cderb/gtest
xinlipn Feb 7, 2024
dd38bfa
Merge branch 'develop' into cderb/gtest
xinlipn Feb 8, 2024
2ac057e
Merge branch 'develop' into cderb/gtest
junliume Feb 11, 2024
dca7ae7
Revert class name from ConfigWithFloat_conv_trans to ConfigWithFloat
xinlipn Feb 12, 2024
5f37e02
Revert class name from ConfigWithFloat_* to ConfigWithFloat
xinlipn Feb 12, 2024
ea4477d
Merge branch 'develop' into cderb/gtest
xinlipn Feb 12, 2024
ca67a88
Change test suite name from ConfigWithFloat to ConfigWithFloat_*
xinlipn Feb 12, 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
56 changes: 0 additions & 56 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -940,65 +940,9 @@ COMMAND $<TARGET_FILE:test_conv2d> --verbose --input 8 3 108 108 --weights 63 1

if(MIOPEN_TEST_DEEPBENCH)
add_custom_test(test_deepbench_rnn GFX94X_ENABLED GFX103X_ENABLED GFX110X_ENABLED
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 25 --vector-len 512 --hidden-size 512 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 25 --vector-len 512 --hidden-size 512 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 64 --seq-len 25 --vector-len 512 --hidden-size 512 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 128 --seq-len 25 --vector-len 512 --hidden-size 512 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 25 --vector-len 1024 --hidden-size 1024 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 25 --vector-len 1024 --hidden-size 1024 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 64 --seq-len 25 --vector-len 1024 --hidden-size 1024 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 128 --seq-len 25 --vector-len 1024 --hidden-size 1024 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 25 --vector-len 2048 --hidden-size 2048 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 25 --vector-len 2048 --hidden-size 2048 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 64 --seq-len 25 --vector-len 2048 --hidden-size 2048 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 128 --seq-len 25 --vector-len 2048 --hidden-size 2048 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 25 --vector-len 4096 --hidden-size 4096 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 25 --vector-len 4096 --hidden-size 4096 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 64 --seq-len 25 --vector-len 4096 --hidden-size 4096 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 128 --seq-len 25 --vector-len 4096 --hidden-size 4096 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 8 --seq-len 50 --vector-len 1536 --hidden-size 1536 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 50 --vector-len 1536 --hidden-size 1536 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 50 --vector-len 1536 --hidden-size 1536 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 16 --seq-len 150 --vector-len 256 --hidden-size 256 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 150 --vector-len 256 --hidden-size 256 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 64 --seq-len 150 --vector-len 256 --hidden-size 256 --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill
)
endif()

add_custom_test(test_lstm_extra SKIP_UNLESS_ALL GFX94X_ENABLED GFX103X_ENABLED GFX110X_ENABLED
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-dhy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hx --no-dhy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-cx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hx --no-cx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-dcy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-cx --no-dcy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-dhy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hx --no-dhy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-cx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hx --no-cx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-dcy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-cx --no-dcy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-dhx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hy --no-dhx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-cy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hy --no-cy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-dcx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-cy --no-dcx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-dhx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hy --no-dhx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-cy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hy --no-cy
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-dcx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-cy --no-dcx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 0 --no-hx --no-dhy --no-cx --no-dcy --no-hy --no-dhx --no-cy --no-dcx
COMMAND $<TARGET_FILE:test_lstm> --verbose --batch-size 32 --seq-len 3 --batch-seq 32 32 32 --vector-len 128 --hidden-size 128 --num-layers 1 --in-mode 0 --bias-mode 0 -dir-mode 1 --no-hx --no-dhy --no-cx --no-dcy --no-hy --no-dhx --no-cy --no-dcx
)


add_custom_test(test_conv_extra SKIP_UNLESS_ALL GFX94X_ENABLED GFX103X_ENABLED GFX110X_ENABLED
# COMMAND $<TARGET_FILE:test_conv2d> --verbose --input 1 1 1 1 --weights 1 1 2 2 --pads_strides_dilations 0 0 3 3 1 1
COMMAND $<TARGET_FILE:test_conv2d> --verbose --input 4 1 161 700 --weights 4 1 5 20 --pads_strides_dilations 0 0 2 2 1 1
Expand Down
122 changes: 122 additions & 0 deletions test/gtest/deepbench_lstm.cpp
junliume marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*******************************************************************************
*
* 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 <utility>

#include "lstm.hpp"
#include "get_handle.hpp"
#include <miopen/env.hpp>
#include <gtest/gtest_common.hpp>
#include <gtest/gtest.h>

MIOPEN_DECLARE_ENV_VAR_BOOL(MIOPEN_TEST_DEEPBENCH)

namespace deepbench_lstm {

void GetArgs(const std::string& param, std::vector<std::string>& tokens)
{
std::stringstream ss(param);
std::istream_iterator<std::string> begin(ss);
std::istream_iterator<std::string> end;
while(begin != end)
tokens.push_back(*begin++);
}

auto GetTestCases(std::string precision)
{
std::string flags = "test_lstm --verbose " + precision;
Copy link
Contributor

Choose a reason for hiding this comment

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

The original test is only enabled for FP32, which is the default for test_lstm, so we can either pass --float or nothing.

Copy link
Contributor

Choose a reason for hiding this comment

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

[resolved]

std::string commonFlags =
" --num-layers 1 --in-mode 1 --bias-mode 0 -dir-mode 0 --rnn-mode 0 --flat-batch-fill";

// clang-format off
return std::vector<std::string>{
{flags + " --batch-size 16 --seq-len 25 --vector-len 512 --hidden-size 512" + commonFlags},
{flags + " --batch-size 32 --seq-len 25 --vector-len 512 --hidden-size 512" + commonFlags},
{flags + " --batch-size 64 --seq-len 25 --vector-len 512 --hidden-size 512" + commonFlags},
{flags + " --batch-size 128 --seq-len 25 --vector-len 512 --hidden-size 512" + commonFlags},
{flags + " --batch-size 16 --seq-len 25 --vector-len 1024 --hidden-size 1024" + commonFlags},
{flags + " --batch-size 32 --seq-len 25 --vector-len 1024 --hidden-size 1024" + commonFlags},
{flags + " --batch-size 64 --seq-len 25 --vector-len 1024 --hidden-size 1024" + commonFlags},
{flags + " --batch-size 128 --seq-len 25 --vector-len 1024 --hidden-size 1024" + commonFlags},
{flags + " --batch-size 16 --seq-len 25 --vector-len 2048 --hidden-size 2048" + commonFlags},
{flags + " --batch-size 32 --seq-len 25 --vector-len 2048 --hidden-size 2048" + commonFlags},
{flags + " --batch-size 64 --seq-len 25 --vector-len 2048 --hidden-size 2048" + commonFlags},
{flags + " --batch-size 128 --seq-len 25 --vector-len 2048 --hidden-size 2048" + commonFlags},
{flags + " --batch-size 16 --seq-len 25 --vector-len 4096 --hidden-size 4096" + commonFlags},
{flags + " --batch-size 32 --seq-len 25 --vector-len 4096 --hidden-size 4096" + commonFlags},
{flags + " --batch-size 64 --seq-len 25 --vector-len 4096 --hidden-size 4096" + commonFlags},
{flags + " --batch-size 128 --seq-len 25 --vector-len 4096 --hidden-size 4096" + commonFlags},
{flags + " --batch-size 8 --seq-len 50 --vector-len 1536 --hidden-size 1536" + commonFlags},
{flags + " --batch-size 16 --seq-len 50 --vector-len 1536 --hidden-size 1536" + commonFlags},
{flags + " --batch-size 32 --seq-len 50 --vector-len 1536 --hidden-size 1536" + commonFlags},
{flags + " --batch-size 16 --seq-len 150 --vector-len 256 --hidden-size 256" + commonFlags},
{flags + " --batch-size 32 --seq-len 150 --vector-len 256 --hidden-size 256" + commonFlags},
{flags + " --batch-size 64 --seq-len 150 --vector-len 256 --hidden-size 256" + commonFlags}
};
// clang-format on
}

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

class ConfigWithFloat_deepbench_lstm : public testing::TestWithParam<std::vector<TestCase>>
{
};

void Run2dDriverFloat(void)
{
std::vector<std::string> params = ConfigWithFloat_deepbench_lstm::GetParam();

for(const auto& test_value : params)
{
std::vector<std::string> tokens;
GetArgs(test_value, tokens);
std::vector<const char*> ptrs;

std::transform(tokens.begin(), tokens.end(), std::back_inserter(ptrs), [](const auto& str) {
return str.data();
});
testing::internal::CaptureStderr();
test_drive<lstm_driver>(ptrs.size(), ptrs.data());
auto capture = testing::internal::GetCapturedStderr();
std::cout << capture;
}
};
} // namespace deepbench_lstm

using namespace deepbench_lstm;

TEST_P(ConfigWithFloat_deepbench_lstm, FloatTest_deepbench_lstm)
{
if(!miopen::IsEnabled(ENV(MIOPEN_TEST_DEEPBENCH)))
{
GTEST_SKIP();
}

Run2dDriverFloat();
};

INSTANTIATE_TEST_SUITE_P(DeepbenchLstm,
ConfigWithFloat_deepbench_lstm,
testing::Values(GetTestCases("--float")));
Loading