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
deepspeed
Commits
91b1b7f3
Unverified
Commit
91b1b7f3
authored
Jan 27, 2021
by
Jeff Rasley
Committed by
GitHub
Jan 27, 2021
Browse files
[transformer-kernel] turn off unit test printing (#701)
parent
cd29f8b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
.github/workflows/torch16.yml
.github/workflows/torch16.yml
+1
-1
tests/unit/test_cuda_backward.py
tests/unit/test_cuda_backward.py
+11
-8
No files found.
.github/workflows/torch16.yml
View file @
91b1b7f3
...
@@ -9,7 +9,7 @@ on:
...
@@ -9,7 +9,7 @@ on:
# - 'docs/**'
# - 'docs/**'
# Allows you to run this workflow manually from the Actions tab
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch
:
workflow_dispatch
:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs
:
jobs
:
# This workflow contains a single job called "build"
# This workflow contains a single job called "build"
...
...
tests/unit/test_cuda_backward.py
View file @
91b1b7f3
...
@@ -24,8 +24,9 @@ def check_equal(first, second, atol=1e-2, verbose=False):
...
@@ -24,8 +24,9 @@ def check_equal(first, second, atol=1e-2, verbose=False):
diction_x
=
{}
diction_x
=
{}
diction_y
=
{}
diction_y
=
{}
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
first
,
second
)):
if
verbose
:
print
(
x
[
1
],
y
[
1
])
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
first
,
second
)):
print
(
x
[
1
],
y
[
1
])
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
first
,
second
)):
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
first
,
second
)):
k
=
0
k
=
0
...
@@ -38,18 +39,20 @@ def check_equal(first, second, atol=1e-2, verbose=False):
...
@@ -38,18 +39,20 @@ def check_equal(first, second, atol=1e-2, verbose=False):
diction_y
[
k
,
y
[
1
]]
=
y
[
0
]
diction_y
[
k
,
y
[
1
]]
=
y
[
0
]
if
verbose
:
if
verbose
:
print
()
print
()
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
diction_x
,
diction_y
)):
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
diction_x
,
diction_y
)):
print
(
x
,
y
)
print
(
x
,
y
)
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
diction_x
,
diction_y
)):
for
i
,
(
x
,
y
)
in
enumerate
(
zip
(
diction_x
,
diction_y
)):
if
(
x
[
0
]
==
1
):
continue
if
(
x
[
0
]
==
1
):
continue
print
(
"checking "
,
x
[
1
],
":"
)
if
verbose
:
print
(
"checking "
,
x
[
1
],
":"
)
y
=
diction_y
[
x
[
0
],
x
[
1
]]
y
=
diction_y
[
x
[
0
],
x
[
1
]]
x
=
diction_x
[
x
[
0
],
x
[
1
]]
x
=
diction_x
[
x
[
0
],
x
[
1
]]
x
=
x
.
cpu
().
detach
().
numpy
()
x
=
x
.
cpu
().
detach
().
numpy
()
y
=
y
.
cpu
().
detach
().
numpy
()
y
=
y
.
cpu
().
detach
().
numpy
()
print
(
x
)
if
verbose
:
print
(
y
)
print
(
x
)
print
(
y
)
avgx
=
np
.
sum
(
abs
(
x
),
dtype
=
float
)
avgx
=
np
.
sum
(
abs
(
x
),
dtype
=
float
)
countx
=
x
.
shape
[
0
]
countx
=
x
.
shape
[
0
]
...
@@ -60,8 +63,8 @@ def check_equal(first, second, atol=1e-2, verbose=False):
...
@@ -60,8 +63,8 @@ def check_equal(first, second, atol=1e-2, verbose=False):
if
avgx
!=
float
(
'inf'
)
and
avgx
!=
-
float
(
'inf'
):
if
avgx
!=
float
(
'inf'
)
and
avgx
!=
-
float
(
'inf'
):
avgx
=
avgx
/
countx
avgx
=
avgx
/
countx
tollerance
=
avgx
*
atol
tollerance
=
avgx
*
atol
print
(
"tollerance is "
,
tollerance
)
if
verbose
:
if
verbose
:
print
(
"tollerance is "
,
tollerance
)
print
(
"x = {}"
.
format
(
x
.
flatten
()))
print
(
"x = {}"
.
format
(
x
.
flatten
()))
print
(
"y = {}"
.
format
(
y
.
flatten
()))
print
(
"y = {}"
.
format
(
y
.
flatten
()))
print
(
'-'
*
80
)
print
(
'-'
*
80
)
...
...
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