-
-
Notifications
You must be signed in to change notification settings - Fork 604
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add GitHub actions * Add contrib dependencies * Optional install for pynvml * Check python version for pynvml * Update unittests.yml * Disable fail fast strategy * Update test_gpu_info.py * Update test_gpu_info.py * Update test_gpu_info.py * add conda and nightlies * Add Python 3.8 and allow more parallel runs * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update unittests.yml * Make examples different steps * Update unittests.yml * Update unittests.yml * Update unittests.yml * Update test_gpu_info.py Co-authored-by: vfdev <vfdev.5@gmail.com>
- Loading branch information
1 parent
6d80eeb
commit 918746b
Showing
2 changed files
with
111 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
on: [pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 10 | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.5, 3.6, 3.7, 3.8] | ||
pytorch-channel: [pytorch, pytorch-nightly] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Setup Conda | ||
run: | | ||
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh | ||
bash miniconda.sh -b -p $HOME/miniconda | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
conda config --set always_yes yes --set changeps1 no | ||
conda update -q conda | ||
# Useful for debugging any issues with conda | ||
conda info -a | ||
conda create -q -n test-environment pytorch cpuonly torchvision python=${{ matrix.python-version }} -c ${{ matrix.pytorch-channel }} | ||
- name: Install dependencies | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
pip install -U pip wheel; | ||
# Contrib dependencies | ||
pip install tqdm scikit-learn matplotlib tensorboardX visdom polyaxon-client mlflow neptune-client tensorboard | ||
if [[ ${{ matrix.python-version }} != 3.5 ]]; then pip install pynvml; fi | ||
pip install numpy pytest codecov pytest-cov pytest-xdist | ||
pip install . | ||
# example dependencies | ||
pip install pandas gym | ||
- name: Run Tests | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
CUDA_VISIBLE_DEVICES="" py.test --tx 4*popen//python=python${{ matrix.python-version }} --cov ignite --cov-report term-missing -vvv tests/ | ||
# - name: Upload coverage to Codecov | ||
# uses: codecov/codecov-action@v1.0.2 | ||
# with: | ||
# token: ${{secrets.CODECOV_TOKEN}} #required | ||
# file: ./coverage.xml #optional | ||
# flags: unittests #optional | ||
# name: codecov-rising #optional | ||
|
||
- name: Run MNIST Examples | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
# MNIST | ||
# 1) mnist.py | ||
python examples/mnist/mnist.py --epochs=1 | ||
# 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) mnist_with_tensorboardx.py | ||
python examples/mnist/mnist_with_tensorboardx.py --epochs=1 | ||
- name: Run MNIST Example With Crash | ||
continue-on-error: true | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
# 4) mnist_save_resume_engine.py | ||
python examples/mnist/mnist_save_resume_engine.py --epochs=1 --crash_iteration 700 | ||
- name: Resume MNIST from previous crash | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
python examples/mnist/mnist_save_resume_engine.py --epochs=1 --resume_from=/tmp/mnist_save_resume/checkpoint_550.pth | ||
- name: Run GAN example | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
# 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 | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
# 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 | ||
run: | | ||
export PATH="$HOME/miniconda/bin:$PATH" | ||
source activate test-environment | ||
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters