Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract mpi tests from integration CI as independent CI #3606

Merged
merged 2 commits into from
Jun 1, 2022
Merged
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
11 changes: 0 additions & 11 deletions .github/workflows/tests-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,3 @@ jobs:
pytest -s tests/integration_tests \
--ignore tests/integration_tests/test_pytorch_lightning.py
fi

- name: Tests MPI
run: |
mpirun -n 2 -- pytest tests/integration_tests/test_chainermn.py

if [ ${{ matrix.python-version }} != 3.6 ]; then
mpirun -n 2 -- pytest tests/integration_tests/test_pytorch_distributed.py
fi

env:
OMP_NUM_THREADS: 1
69 changes: 69 additions & 0 deletions .github/workflows/tests-mpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Tests (MPI)

on:
push:
branches:
- master
pull_request: {}
schedule:
- cron: '0 23 * * SUN-THU'

concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true

jobs:
tests-mpi:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Python${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Setup cache
uses: actions/cache@v2
env:
cache-name: test-mpi
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ env.cache-name }}-${{ hashFiles('**/setup.py') }}-v1
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-${{ env.cache-name }}-${{ hashFiles('**/setup.py') }}

- name: Setup environment
run: |
sudo apt-get update
sudo apt-get -y install openmpi-bin libopenmpi-dev
toshihikoyanase marked this conversation as resolved.
Show resolved Hide resolved

- name: Install
run: |
python -m pip install --upgrade pip

# Install minimal dependencies and confirm that `import optuna` is successful.
pip install --progress-bar off .
python -c 'import optuna'
optuna --version

pip install --progress-bar off .[test]
pip install --progress-bar off .[optional]
pip install --progress-bar off .[integration] --extra-index-url https://download.pytorch.org/whl/cpu
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My concern is that this line installs unnecessary other integration packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is acceptable for this PR. I guess @himkt is interested in re-organization of setup.py and we can discuss this topic there.


- name: Tests
run: |
mpirun -n 2 -- pytest tests/integration_tests/test_chainermn.py

if [ ${{ matrix.python-version }} != 3.6 ]; then
mpirun -n 2 -- pytest tests/integration_tests/test_pytorch_distributed.py
fi

env:
OMP_NUM_THREADS: 1