Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
apex
Commits
d0555980
Commit
d0555980
authored
May 19, 2020
by
lcskrishna
Browse files
enable fp16_utils test suite
parent
a73d7d3b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
3 deletions
+9
-3
apex/__init__.py
apex/__init__.py
+3
-0
apex/testing/__init__.py
apex/testing/__init__.py
+1
-0
apex/testing/common_utils.py
apex/testing/common_utils.py
+3
-0
tests/L0/run_test.py
tests/L0/run_test.py
+2
-3
No files found.
apex/__init__.py
View file @
d0555980
...
@@ -18,3 +18,6 @@ from . import fp16_utils
...
@@ -18,3 +18,6 @@ from . import fp16_utils
from
.
import
optimizers
from
.
import
optimizers
from
.
import
normalization
from
.
import
normalization
from
.
import
pyprof
from
.
import
pyprof
#common utilties to run tests on ROCm.
from
.
import
testing
apex/testing/__init__.py
0 → 100644
View file @
d0555980
#from common_utils import *
tests/L0
/common_utils.py
→
apex/testing
/common_utils.py
View file @
d0555980
...
@@ -3,6 +3,9 @@ This file contains common utility functions for running the unit tests on ROCM.
...
@@ -3,6 +3,9 @@ This file contains common utility functions for running the unit tests on ROCM.
'''
'''
import
torch
import
torch
import
os
import
sys
TEST_WITH_ROCM
=
os
.
getenv
(
'APEX_TEST_WITH_ROCM'
,
'0'
)
==
'1'
TEST_WITH_ROCM
=
os
.
getenv
(
'APEX_TEST_WITH_ROCM'
,
'0'
)
==
'1'
...
...
tests/L0/run_test.py
View file @
d0555980
import
unittest
import
unittest
import
sys
import
sys
from
common_utils
import
*
from
apex.testing.common_utils
import
TEST_WITH_ROCM
,
skipIfRocm
test_dirs
=
[
"run_amp"
,
"run_fp16util"
,
"run_optimizers"
,
"run_fused_layer_norm"
,
"run_pyprof_nvtx"
,
"run_pyprof_data"
,
"run_mlp"
]
test_dirs
=
[
"run_amp"
,
"run_fp16util"
,
"run_optimizers"
,
"run_fused_layer_norm"
,
"run_pyprof_nvtx"
,
"run_pyprof_data"
,
"run_mlp"
]
ROCM_BLACKLIST
=
[
ROCM_BLACKLIST
=
[
'run_amp'
,
'run_amp'
,
'run_fp16util'
,
'run_optimizers'
,
'run_optimizers'
,
'run_fused_layer_norm'
,
'run_fused_layer_norm'
,
'run_pyprof_nvtx'
,
'run_pyprof_nvtx'
,
...
@@ -20,7 +19,7 @@ runner = unittest.TextTestRunner(verbosity=2)
...
@@ -20,7 +19,7 @@ runner = unittest.TextTestRunner(verbosity=2)
errcode
=
0
errcode
=
0
for
test_dir
in
test_dirs
:
for
test_dir
in
test_dirs
:
if
test_dir
in
ROCM_BLACKLIST
:
if
(
test_dir
in
ROCM_BLACKLIST
)
and
TEST_WITH_ROCM
:
continue
continue
suite
=
unittest
.
TestLoader
().
discover
(
test_dir
)
suite
=
unittest
.
TestLoader
().
discover
(
test_dir
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment