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

Github Actions workflow CI for horovod on CPU #1377

Merged
merged 7 commits into from
Oct 9, 2020
Merged
Changes from 5 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
99 changes: 99 additions & 0 deletions .github/workflows/hvd-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Run Horovod tests
on: [push, pull_request]

jobs:
horovod-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7]
pytorch-channel: [pytorch]


steps:
- uses: actions/checkout@v2
- name: Setup Miniconda
uses: goanpeca/setup-miniconda@v1
with:
miniconda-version: "latest"
python-version: ${{ matrix.python-version }}

- name: Install dependencies
shell: bash -l {0}
run: |
#install other dependencies
conda install pytorch torchvision cpuonly -c ${{ matrix.pytorch-channel }}
pip install -r requirements-dev.txt
# Fixes #1153
pip install --upgrade scipy==1.4.1
pip install horovod
python setup.py install

- name: Run Tests
shell: bash -l {0}
run: |
SKIP_DISTRIB_TESTS=${{ matrix.skip-distrib-tests }} CI_PYTHON_VERSION="${{ matrix.python-version }}" sh tests/run_cpu_tests.sh

- name: Run MNIST Examples
vfdev-5 marked this conversation as resolved.
Show resolved Hide resolved
shell: bash -l {0}
run: |
# MNIST
# 1) mnist.py
python examples/mnist/mnist.py --epochs=1

- name: Run MNIST with loggers Examples
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# 2) mnist_with_visdom.py
python -c "from visdom.server import download_scripts; download_scripts()" # download scripts : https://github.com/facebookresearch/visdom/blob/master/py/server.py#L929
python -m visdom.server &
sleep 10
python examples/mnist/mnist_with_visdom.py --epochs=1
kill %1
# 3.1) mnist_with_tensorboard.py with tbX
python examples/mnist/mnist_with_tensorboard.py --epochs=1
# 3.2) mnist_with_tensorboard.py with native torch tb
pip uninstall -y tensorboardX
python examples/mnist/mnist_with_tensorboard.py --epochs=1

- name: Run MNIST Example With Crash
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
continue-on-error: true
run: |
# 4) mnist_save_resume_engine.py
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --crash_iteration 1100

- name: Resume MNIST from previous crash
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
python examples/mnist/mnist_save_resume_engine.py --epochs=2 --resume_from=/tmp/mnist_save_resume/checkpoint_1.pt

- name: Run GAN example
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# DCGAN
python examples/gan/dcgan.py --dataset fake --dataroot /tmp/fakedata --output-dir /tmp/outputs-dcgan --batch-size 2 --epochs 2 --workers 0

- name: Run RL Examples
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
# RL
# 1) Actor-Critic
python examples/reinforcement_learning/actor_critic.py --max-episodes=2
# 2) Reinforce
python examples/reinforcement_learning/reinforce.py --max-episodes=2

- name: Run Neural Style Example
shell: bash -l {0}
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
#fast-neural-style
#train
mkdir -p ~/.cache/torch/checkpoints/ && wget "https://download.pytorch.org/models/vgg16-397923af.pth" -O ~/.cache/torch/checkpoints/vgg16-397923af.pth
python examples/fast_neural_style/neural_style.py train --epochs 1 --cuda 0 --dataset test --dataroot . --image_size 32 --style_image examples/fast_neural_style/images/style_images/mosaic.jpg --style_size 32