-
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.
* drop CircleCI * add PT testing * fix * cpu * conda * conda * req * base * conda * conda * conda * conda * conda * conda * conda * name * req * info * tests * pt 1.6 * drop 1.6 * info
- Loading branch information
Showing
9 changed files
with
127 additions
and
214 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
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,94 @@ | ||
name: PyTorch & Conda | ||
|
||
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows | ||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the master branch | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
# Trigger the workflow on push or pull request | ||
# on: [push, pull_request] | ||
|
||
jobs: | ||
conda: | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-20.04] | ||
python-version: [3.7] | ||
# todo: add nightly versions | ||
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 | ||
# https://gist.github.com/mwouts/9842452d020c08faf9e84a3bba38a66f | ||
- name: Setup Miniconda | ||
uses: goanpeca/setup-miniconda@v1.6.0 | ||
with: | ||
# auto-update-conda: true | ||
auto-activate-base: false | ||
miniconda-version: 'latest' | ||
python-version: ${{ matrix.python-version }} | ||
environment-file: environment.yml | ||
activate-environment: pl-env | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
|
||
- name: Reinstall Horovod if necessary | ||
if: runner.os != 'windows' && matrix.python-version != '3.8' | ||
run: | | ||
HOROVOD_BUILT=$(python -c "import horovod.torch; horovod.torch.nccl_built(); print('SUCCESS')") | ||
if [[ $HOROVOD_BUILT != "SUCCESS" ]]; then | ||
pip uninstall -y horovod | ||
HOROVOD_BUILD_ARCH_FLAGS="-mfma" pip install --no-cache-dir $(grep "horovod" requirements/extra.txt) | ||
fi | ||
horovodrun --check-build | ||
shell: bash -l {0} | ||
|
||
- name: Cache datasets | ||
uses: actions/cache@v1 | ||
with: | ||
path: Datasets # This path is specific to Ubuntu | ||
# Look to see if there is a cache hit for the corresponding requirements file | ||
key: pl-dataset | ||
|
||
- name: Tests | ||
run: | | ||
conda info | ||
conda list | ||
# 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 -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 | ||
with: | ||
name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }} | ||
path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: always() |
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
Oops, something went wrong.