2022-07-02 05:05:16 +00:00
|
|
|
name: Test PyTorch slow
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
|
2022-09-08 13:29:28 +00:00
|
|
|
on:
|
2021-12-01 19:58:18 +00:00
|
|
|
push:
|
|
|
|
branches: [master, "release/*"]
|
|
|
|
pull_request:
|
|
|
|
branches: [master, "release/*"]
|
2022-09-08 13:29:28 +00:00
|
|
|
types: [opened, reopened, ready_for_review, synchronize] # add `ready_for_review` since draft is skipped
|
2022-09-05 12:16:26 +00:00
|
|
|
paths:
|
2022-09-15 11:41:25 +00:00
|
|
|
- ".github/workflows/ci-pytorch-test-slow.yml"
|
2022-09-05 12:16:26 +00:00
|
|
|
- "requirements/pytorch/**"
|
|
|
|
- "src/pytorch_lightning/**"
|
|
|
|
- "tests/tests_pytorch/**"
|
|
|
|
- "setup.cfg" # includes pytest config
|
2022-09-15 11:41:25 +00:00
|
|
|
- "requirements/lite/**"
|
|
|
|
- "src/lightning_lite/**"
|
2022-10-20 18:23:47 +00:00
|
|
|
- ".actions/**"
|
2021-12-01 19:58:18 +00:00
|
|
|
|
2022-02-02 19:48:15 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
|
|
|
|
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
|
|
|
|
|
2021-12-01 19:58:18 +00:00
|
|
|
jobs:
|
2022-08-29 18:03:37 +00:00
|
|
|
pl-slow:
|
2021-12-01 19:58:18 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-17 02:31:32 +00:00
|
|
|
if: github.event.pull_request.draft == false
|
2021-12-01 19:58:18 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-08-10 09:02:54 +00:00
|
|
|
os: [ubuntu-20.04, windows-2022, macOS-11]
|
2022-10-12 13:18:12 +00:00
|
|
|
# same config as '.azure-pipelines/gpu-tests-pytorch.yml'
|
2021-12-01 19:58:18 +00:00
|
|
|
python-version: ["3.7"]
|
2022-06-15 00:46:44 +00:00
|
|
|
pytorch-version: ["1.11"]
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
timeout-minutes: 20
|
|
|
|
steps:
|
2022-09-05 17:13:08 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-14 19:55:30 +00:00
|
|
|
|
2022-08-19 05:31:47 +00:00
|
|
|
- uses: actions/setup-python@v4
|
2021-12-01 19:58:18 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Get pip cache
|
|
|
|
id: pip-cache
|
|
|
|
run: |
|
|
|
|
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
|
|
|
|
|
|
|
- name: Cache pip
|
2022-07-14 20:12:56 +00:00
|
|
|
uses: actions/cache@v3
|
2021-12-01 19:58:18 +00:00
|
|
|
with:
|
|
|
|
path: ${{ steps.pip-cache.outputs.dir }}
|
2022-10-05 09:52:42 +00:00
|
|
|
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements/pytorch/base.txt') }}
|
2021-12-01 19:58:18 +00:00
|
|
|
restore-keys: |
|
2022-10-05 09:52:42 +00:00
|
|
|
${{ runner.os }}-pip-py${{ matrix.python-version }}-
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
2022-06-27 13:34:18 +00:00
|
|
|
env:
|
|
|
|
PACKAGE_NAME: pytorch
|
2022-06-29 13:35:57 +00:00
|
|
|
FREEZE_REQUIREMENTS: 1
|
2021-12-01 19:58:18 +00:00
|
|
|
run: |
|
|
|
|
# adjust versions according installed Torch version
|
2022-06-21 15:11:33 +00:00
|
|
|
python ./requirements/pytorch/adjust-versions.py requirements.txt ${{ matrix.pytorch-version }}
|
2022-06-15 00:54:55 +00:00
|
|
|
pip install -e .[test] --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
|
2021-12-01 19:58:18 +00:00
|
|
|
pip list
|
|
|
|
shell: bash
|
|
|
|
|
2022-06-15 22:10:49 +00:00
|
|
|
- name: Testing PyTorch
|
|
|
|
working-directory: tests/tests_pytorch
|
|
|
|
run: coverage run --source pytorch_lightning -m pytest -v --junitxml=results-${{ runner.os }}-py${{ matrix.python-version }}.xml
|
2021-12-01 19:58:18 +00:00
|
|
|
env:
|
|
|
|
PL_RUN_SLOW_TESTS: 1
|
|
|
|
|
|
|
|
- name: Upload pytest test results
|
2022-09-05 12:16:26 +00:00
|
|
|
if: failure()
|
2022-07-12 16:34:18 +00:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-12-01 19:58:18 +00:00
|
|
|
with:
|
2022-06-15 22:10:49 +00:00
|
|
|
name: unittest-results-${{ runner.os }}-py${{ matrix.python-version }}
|
|
|
|
path: tests/tests_pytorch/results-${{ runner.os }}-py${{ matrix.python-version }}.xml
|
2021-12-01 19:58:18 +00:00
|
|
|
|
|
|
|
- name: Statistics
|
2022-09-05 12:16:26 +00:00
|
|
|
if: success()
|
2022-06-15 22:10:49 +00:00
|
|
|
working-directory: tests/tests_pytorch
|
2021-12-01 19:58:18 +00:00
|
|
|
run: |
|
|
|
|
coverage report
|
|
|
|
coverage xml
|
|
|
|
|
|
|
|
- name: Upload coverage to Codecov
|
2022-07-12 16:13:34 +00:00
|
|
|
uses: codecov/codecov-action@v3
|
2021-12-01 19:58:18 +00:00
|
|
|
# see: https://github.com/actions/toolkit/issues/399
|
|
|
|
continue-on-error: true
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
2022-06-15 22:10:49 +00:00
|
|
|
file: tests/tests_pytorch/coverage.xml
|
2022-10-20 08:33:56 +00:00
|
|
|
flags: cpu,pytest-slow,torch${{ matrix.pytorch-version }}
|
2021-12-01 19:58:18 +00:00
|
|
|
name: CPU-coverage
|
|
|
|
fail_ci_if_error: false
|