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
Torchaudio
Commits
e9415df4
Unverified
Commit
e9415df4
authored
Jun 09, 2021
by
Salil Desai
Committed by
GitHub
Jun 09, 2021
Browse files
Update skipIfNoCuda decorator/Force GPU tests run in GPU CIs (#1559)
parent
afb6626c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
.circleci/config.yml
.circleci/config.yml
+1
-1
.circleci/config.yml.in
.circleci/config.yml.in
+1
-1
test/torchaudio_unittest/common_utils/case_utils.py
test/torchaudio_unittest/common_utils/case_utils.py
+9
-1
No files found.
.circleci/config.yml
View file @
e9415df4
...
...
@@ -465,7 +465,7 @@ jobs:
command
:
docker run -t --gpus all -e UPLOAD_CHANNEL -e CONDA_CHANNEL_FLAGS -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh
-
run
:
name
:
Run tests
command
:
docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh
command
:
docker run -t --gpus all -v $PWD:$PWD -w $PWD
-e "TORCHAUDIO_TEST_FORCE_CUDA=1"
"${image_name}" .circleci/unittest/linux/scripts/run_test.sh
-
store_test_results
:
path
:
test-results
-
store_artifacts
:
...
...
.circleci/config.yml.in
View file @
e9415df4
...
...
@@ -465,7 +465,7 @@ jobs:
command: docker run -t --gpus all -e UPLOAD_CHANNEL -e CONDA_CHANNEL_FLAGS -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/install.sh
- run:
name: Run tests
command: docker run -t --gpus all -v $PWD:$PWD -w $PWD "${image_name}" .circleci/unittest/linux/scripts/run_test.sh
command: docker run -t --gpus all -v $PWD:$PWD -w $PWD
-e "TORCHAUDIO_TEST_FORCE_CUDA=1"
"${image_name}" .circleci/unittest/linux/scripts/run_test.sh
- store_test_results:
path: test-results
- store_artifacts:
...
...
test/torchaudio_unittest/common_utils/case_utils.py
View file @
e9415df4
...
...
@@ -104,7 +104,15 @@ def skipIfNoModule(module, display_name=None):
return
unittest
.
skipIf
(
not
is_module_available
(
module
),
f
'"
{
display_name
}
" is not available'
)
skipIfNoCuda
=
unittest
.
skipIf
(
not
torch
.
cuda
.
is_available
(),
reason
=
'CUDA not available'
)
def
skipIfNoCuda
(
test_item
):
if
torch
.
cuda
.
is_available
():
return
test_item
force_cuda_test
=
os
.
environ
.
get
(
'TORCHAUDIO_TEST_FORCE_CUDA'
,
'0'
)
if
force_cuda_test
not
in
[
'0'
,
'1'
]:
raise
ValueError
(
'"TORCHAUDIO_TEST_FORCE_CUDA" must be either "0" or "1".'
)
if
force_cuda_test
==
'1'
:
raise
RuntimeError
(
'"TORCHAUDIO_TEST_FORCE_CUDA" is set but CUDA is not available.'
)
return
unittest
.
skip
(
'CUDA is not available.'
)(
test_item
)
skipIfNoSox
=
unittest
.
skipIf
(
not
is_sox_available
(),
reason
=
'Sox not available'
)
skipIfNoKaldi
=
unittest
.
skipIf
(
not
is_kaldi_available
(),
reason
=
'Kaldi not available'
)
skipIfRocm
=
unittest
.
skipIf
(
os
.
getenv
(
'TORCHAUDIO_TEST_WITH_ROCM'
,
'0'
)
==
'1'
,
...
...
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