Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
60 changes: 53 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ commands:
echo "In venv: $(pyenv local) - $(python -V), $(pip -V)"
sudo "$(which python)" -m pip install --upgrade pip
sudo "$(which python)" -m pip install pytest
sudo "$(which python)" -m pip install coverage
sudo "$(which python)" -m pip install coveralls

run_nvidia_smi:
description: "Prints GPU capabilities from nvidia-smi"
Expand Down Expand Up @@ -92,13 +94,34 @@ commands:
no_output_timeout: 1h
command: |
mkdir unittest-reports
python -m pytest --doctest-modules -p conftest --junitxml=unittest-reports/junit.xml opacus
coverage run -m pytest --doctest-modules -p conftest --junitxml=unittest-reports/junit.xml opacus
coverage report -i -m

- store_test_results:
path: unittest-reports
- store_artifacts:
path: unittest-reports

command_unit_tests_multi_gpu:
description: "Run multi gpu unit tests"
steps:
- run:
name: "Unit test multi_gpu"
no_output_timeout: 1h
command: |
mkdir unittest-multigpu-reports
coverage run -m unittest opacus.tests.multigpu_gradcheck.GradientComputationTest.test_gradient_correct
coverage report -i -m

coveralls_upload_parallel:
description: "upload coverage to coveralls"
steps:
- run:
name: "coveralls upload"
no_output_timeout: 5m
command: |
pip install coveralls --user
COVERALLS_PARALLEL=true COVERALLS_FLAG_NAME="${CIRCLE_JOB}" coveralls

mnist_integration_test:
description: "Runs MNIST example end to end"
Expand Down Expand Up @@ -300,6 +323,7 @@ jobs:
- checkout
- pip_dev_install
- unit_tests
- coveralls_upload_parallel

unittest_py38_torch_release:
docker:
Expand All @@ -308,6 +332,7 @@ jobs:
- checkout
- pip_dev_install
- unit_tests
- coveralls_upload_parallel

unittest_py39_torch_release:
docker:
Expand All @@ -316,6 +341,7 @@ jobs:
- checkout
- pip_dev_install
- unit_tests
- coveralls_upload_parallel

unittest_py39_torch_nightly:
docker:
Expand All @@ -325,6 +351,7 @@ jobs:
- pip_dev_install:
args: "-n"
- unit_tests
- coveralls_upload_parallel

integrationtest_py37_torch_release_cpu:
docker:
Expand Down Expand Up @@ -449,12 +476,8 @@ jobs:
- py_3_7_setup
- pip_dev_install
- run_nvidia_smi
- run:
name: "Unit test multi_gpu"
no_output_timeout: 1h
command: |
mkdir unittest-multigpu-reports
python -m unittest opacus.tests.multigpu_gradcheck.GradientComputationTest.test_gradient_correct
- command_unit_tests_multi_gpu
- coveralls_upload_parallel


auto_deploy_site:
Expand All @@ -469,6 +492,17 @@ jobs:
- configure_docusaurus_bot
- deploy_site

finish_coveralls_parallel:
docker:
- image: cimg/python:3.9
steps:
- run:
name: "finish coveralls parallel"
no_output_timeout: 5m
command: |
pip install coveralls --user
coveralls --finish


aliases:

Expand Down Expand Up @@ -503,6 +537,14 @@ workflows:
filters: *exclude_ghpages
- integrationtest_py37_torch_release_cuda:
filters: *exclude_ghpages
- finish_coveralls_parallel:
filters: *exclude_ghpages
requires:
- unittest_py37_torch_release
- unittest_py38_torch_release
- unittest_py39_torch_release
- unittest_py39_torch_nightly
- unittest_multi_gpu

nightly:
when:
Expand All @@ -518,6 +560,10 @@ workflows:
filters: *exclude_ghpages
- micro_benchmarks_py37_torch_release_cuda:
filters: *exclude_ghpages
- finish_coveralls_parallel:
filters: *exclude_ghpages
requires:
- unittest_py39_torch_nightly

website_deployment:
when:
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<hr/>

[![CircleCI](https://circleci.com/gh/pytorch/opacus.svg?style=svg)](https://circleci.com/gh/pytorch/opacus)
[![Coverage Status](https://coveralls.io/repos/github/pytorch/opacus/badge.svg?branch=main)](https://coveralls.io/github/pytorch/opacus?branch=main)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![License](https://img.shields.io/badge/license-apache2-green.svg)](LICENSE)

Expand Down
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ scikit-learn
pytorch-lightning
lightning-bolts
jsonargparse[signatures]>=3.19.3 # required for Lightning CLI
coverage