Skip to content

Commit

Permalink
Run CI unittests in parallel (#3445)
Browse files Browse the repository at this point in the history
Summary:
* enable parallel tests

* disable parallelism for GPU tests

* [test] limit maximum processes on linux

* [debug] limit max processes even further

* [test] use subprocesses over threads

* [test] limit intra-op threads

* only limit intra op threads for CPU tests

* [poc] use low timeout for showcasing

* [poc] fix syntax

* set timeout to 5 minutes

* fix timeout on windows

Reviewed By: fmassa

Differential Revision: D26756257

fbshipit-source-id: f2fc4753a67a1505f01116119926eec365693ab9

Co-authored-by: Francisco Massa <fvsmassa@gmail.com>
  • Loading branch information
2 people authored and facebook-github-bot committed Mar 4, 2021
1 parent 7029839 commit ffd6a1b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .circleci/unittest/linux/scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ channels:
- conda-forge
dependencies:
- pytest
- pytest-xdist
- pytest-timeout
- pytest-cov
- codecov
- pip
Expand Down
17 changes: 16 additions & 1 deletion .circleci/unittest/linux/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,20 @@ eval "$(./conda/bin/conda shell.bash hook)"
conda activate ./env

export PYTORCH_TEST_WITH_SLOW='1'
if [ "${CU_VERSION:-}" == cpu ] ; then
NUMPROCESSES="auto"
export OMP_NUM_THREADS="1"
else
NUMPROCESSES="1"
fi

python -m torch.utils.collect_env
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py
pytest \
--numprocesses=$NUMPROCESSES \
--timeout=300 \
--cov=torchvision \
--junitxml=test-results/junit.xml \
--verbose \
--durations 20 \
--ignore=test/test_datasets_download.py \
test
2 changes: 2 additions & 0 deletions .circleci/unittest/windows/scripts/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ channels:
- conda-forge
dependencies:
- pytest
- pytest-xdist
- pytest-timeout
- pytest-cov
- codecov
- pip
Expand Down
17 changes: 16 additions & 1 deletion .circleci/unittest/windows/scripts/run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,20 @@ eval "$(./conda/Scripts/conda.exe 'shell.bash' 'hook')"
conda activate ./env

export PYTORCH_TEST_WITH_SLOW='1'
if [ "${CU_VERSION:-}" == cpu ] ; then
NUMPROCESSES="auto"
export OMP_NUM_THREADS="1"
else
NUMPROCESSES="1"
fi

python -m torch.utils.collect_env
pytest --cov=torchvision --junitxml=test-results/junit.xml -v --durations 20 test --ignore=test/test_datasets_download.py
pytest \
--numprocesses=$NUMPROCESSES \
--timeout=300 \
--cov=torchvision \
--junitxml=test-results/junit.xml \
--verbose \
--durations 20 \
--ignore=test/test_datasets_download.py \
test

0 comments on commit ffd6a1b

Please sign in to comment.