-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
30 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 |
---|---|---|
|
@@ -23,21 +23,40 @@ jobs: | |
os: [ubuntu-20.04] | ||
python-version: [3.7] | ||
# todo: add nightly versions | ||
pytorch-version: [1.3, 1.4, 1.5, 1.6, 1.7] | ||
pytorch-version: [1.3, 1.4, 1.5] # , 1.6, 1.7 | ||
|
||
# Timeout: https://stackoverflow.com/a/59076067/4521646 | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup pytorch | ||
run: | | ||
python -c "fname = 'environment.yml' ; req = open(fname).read().replace('torch>=1.3', 'torch==${{ matrix.pytorch-version }}') ; open(fname, 'w').write(req)" | ||
cat environment.yml | ||
# TODO: set source for nightly | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v1 | ||
env: # Increase this value to reset cache if etc/example-environment.yml has not changed | ||
CACHE_NUMBER: 0 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }} | ||
|
||
# https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf | ||
- name: Setup conda | ||
uses: s-weigand/setup-conda@v1 | ||
# https://gist.github.com/mwouts/9842452d020c08faf9e84a3bba38a66f | ||
- name: Setup Miniconda | ||
uses: goanpeca/[email protected] | ||
with: | ||
update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
conda-channels: anaconda, conda-forge | ||
activate-conda: true | ||
# auto-update-conda: true | ||
auto-activate-base: false | ||
miniconda-version: 'latest' | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: environment.yml | ||
# activate-environment: ci-torch | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
|
||
# TODO: add conda/pip caching | ||
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow | ||
|
@@ -50,32 +69,25 @@ jobs: | |
# restore-keys: | | ||
# ${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.pytorch-version }}-pip- | ||
|
||
- name: Create conda | ||
run: | | ||
conda create --name ci-torch | ||
conda activate ci-torch | ||
shell: bash | ||
|
||
- name: Install stable PyTorch version | ||
if: matrix.pytorch-version <= 1.6 | ||
run: | | ||
conda install pytorch=${{ matrix.pytorch-version }} --name ci-torch --channel pytorch | ||
shell: bash | ||
|
||
- name: Install nightly PyTorch version | ||
if: matrix.pytorch-version > 1.6 | ||
run: | | ||
conda install pytorch=${{ matrix.pytorch-version }} --name ci-torch --channel pytorch-nightly | ||
shell: bash | ||
#- name: Install stable PyTorch version | ||
# if: matrix.pytorch-version <= 1.6 | ||
# run: | | ||
# conda install pytorch=${{ matrix.pytorch-version }} --name ci-torch --channel pytorch | ||
# shell: bash | ||
# | ||
#- name: Install nightly PyTorch version | ||
# if: matrix.pytorch-version > 1.6 | ||
# run: | | ||
# conda install pytorch=${{ matrix.pytorch-version }} --name ci-torch --channel pytorch-nightly | ||
# shell: bash | ||
|
||
- name: Install dependencies | ||
- name: Define environemnt | ||
run: | | ||
# python -m pip install --upgrade --user pip | ||
HOROVOD_BUILD_ARCH_FLAGS="-mfma" conda env update --file environment.yml --satisfied-skip-solve --name ci-torch | ||
# conda env update --file environment.yml --name ci-torch | ||
python --version | ||
conda info | ||
conda list | ||
shell: bash | ||
shell: bash -l {0} | ||
|
||
- name: Reinstall Horovod if necessary | ||
if: runner.os != 'windows' && matrix.python-version != '3.8' | ||
|
@@ -86,7 +98,7 @@ jobs: | |
HOROVOD_BUILD_ARCH_FLAGS="-mfma" pip install --no-cache-dir $(grep "horovod" requirements/extra.txt) | ||
fi | ||
horovodrun --check-build | ||
shell: bash | ||
shell: bash -l {0} | ||
|
||
- name: Cache datasets | ||
uses: actions/cache@v1 | ||
|
@@ -100,6 +112,7 @@ jobs: | |
# NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003 | ||
python -m pytest pytorch_lightning tests pl_examples -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml | ||
# coverage report | ||
shell: bash -l {0} | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@master | ||
|
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