-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/hinge_loss
- Loading branch information
Showing
8 changed files
with
149 additions
and
7 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,76 @@ | ||
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, "release/*"] | ||
pull_request: | ||
branches: [master, "release/*"] | ||
|
||
jobs: | ||
conda: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7] | ||
pytorch-version: [1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9] | ||
|
||
# Timeout: https://stackoverflow.com/a/59076067/4521646 | ||
timeout-minutes: 35 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Cache conda | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/conda_pkgs_dir | ||
key: conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-${{ hashFiles('environment.yml') }} | ||
restore-keys: conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}- | ||
|
||
# Add another cache for Pip as not all packages lives in Conda env | ||
- name: Cache pip | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: pip-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}-${{ hashFiles('requirements/base.txt') }} | ||
restore-keys: pip-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}- | ||
|
||
# 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: conda-incubator/setup-miniconda@v2 | ||
with: | ||
miniconda-version: "4.7.12" | ||
python-version: ${{ matrix.python-version }} | ||
channels: conda-forge,pytorch,pytorch-test,pytorch-nightly | ||
channel-priority: true | ||
auto-activate-base: true | ||
# environment-file: ./environment.yml | ||
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! | ||
|
||
- name: Update Environment | ||
run: | | ||
conda info | ||
conda install pytorch=${{ matrix.pytorch-version }} cpuonly | ||
conda list | ||
pip --version | ||
pip install --requirement requirements.txt --upgrade-strategy only-if-needed --quiet | ||
pip install --requirement requirements/test.txt --upgrade-strategy only-if-needed --quiet | ||
pip list | ||
python -c "import torch; assert torch.__version__[:3] == '${{ matrix.pytorch-version }}', torch.__version__" | ||
shell: bash -l {0} | ||
|
||
- name: Testing | ||
run: | | ||
# NOTE: run coverage on tests does not propagare faler status for Win, https://github.com/nedbat/coveragepy/issues/1003 | ||
python -m pytest torchmetrics tests -v --durations=35 --junitxml=junit/test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml | ||
shell: bash -l {0} | ||
|
||
- name: Upload pytest test results | ||
uses: actions/upload-artifact@master | ||
with: | ||
name: test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml | ||
path: junit/test-conda-py${{ matrix.python-version }}-pt${{ matrix.pytorch-version }}.xml | ||
# Use always() to always run this step to publish test results when there are test failures | ||
if: failure() |
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 |
---|---|---|
|
@@ -38,3 +38,4 @@ prune notebook* | |
prune temp* | ||
prune test* | ||
prune benchmark* | ||
prune integration* |
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,3 @@ | ||
from torchmetrics.utilities.imports import _module_available | ||
|
||
_PL_AVAILABLE = _module_available('pytorch_lightning') |
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