Skip to content

Commit

Permalink
Merge branch 'master' into tests/remove-random-from-conda
Browse files Browse the repository at this point in the history
  • Loading branch information
akihironitta committed Dec 22, 2021
2 parents a8ca439 + 28ce910 commit 1dbb6c1
Show file tree
Hide file tree
Showing 321 changed files with 10,588 additions and 7,401 deletions.
2 changes: 1 addition & 1 deletion .azure-pipelines/gpu-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

steps:
- bash: |
python -m pytest benchmarks -v --durations=0
python -m pytest tests/benchmarks -v --durations=0
displayName: 'Testing: benchmarks'
env:
PL_RUNNING_BENCHMARKS: 1
10 changes: 5 additions & 5 deletions .azure-pipelines/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- bash: |
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
pip install fairscale==0.4.0
pip install deepspeed==0.5.4
pip install deepspeed==0.5.7
pip install . --requirement requirements/devel.txt
pip list
displayName: 'Install dependencies'
Expand All @@ -68,14 +68,14 @@ jobs:
displayName: 'Get legacy checkpoints'
- bash: |
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests --ignore tests/benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
displayName: 'Testing: standard'
- bash: |
bash tests/special_tests.sh
bash tests/standalone_tests.sh
env:
PL_USE_MOCKED_MNIST: "1"
displayName: 'Testing: special'
displayName: 'Testing: standalone'
- bash: |
python -m coverage report
Expand Down Expand Up @@ -113,5 +113,5 @@ jobs:
displayName: 'Testing: examples'
- bash: |
python -m pytest benchmarks -v --maxfail=2 --durations=0
python -m pytest tests/benchmarks -v --maxfail=2 --durations=0
displayName: 'Testing: benchmarks'
18 changes: 14 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ orbs:
go: circleci/go@1.3.0
codecov: codecov/codecov@1.1.0

trigger:
tags:
include:
- '*'
branches:
include:
- "master"
- "release/*"
- "refs/tags/*"
pr:
- "master"
- "release/*"

# Workflow Steps:
# 1. Checkout
# 2. Install GO
Expand All @@ -24,10 +37,7 @@ references:
run:
name: Make Documentation
command: |
# First run the same pipeline as Read-The-Docs
# apt-get update && apt-get install -y cmake
# using: https://hub.docker.com/r/readthedocs/build
# we need to use py3.7 ot higher becase of an issue with metaclass inheritence
# the image uses python 2.7 by default, force a different version
pyenv global 3.7.3
python --version
pip install -r requirements/docs.txt
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
/tests/helpers/boring_model.py @williamfalcon @tchaton @borda

/.github/CODEOWNERS @williamfalcon
/SECURITY.md @williamfalcon
/README.md @williamfalcon @edenlightning @borda
/setup.py @williamfalcon @borda
/pytorch_lightning/__about__.py @williamfalcon @borda
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ assignees: ''
Please reproduce using the BoringModel!
You can use the following Colab link:
https://colab.research.google.com/drive/1HvWVVTK8j2Nj52qU4Q4YCyzOm0_aLQF3?usp=sharing
https://colab.research.google.com/github/PytorchLightning/pytorch-lightning/blob/master/pl_examples/bug_report/bug_report_model.ipynb
IMPORTANT: has to be public.
or this simple template:
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/bug_report_model.py
https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/bug_report/bug_report_model.py
If you could not reproduce using the BoringModel and still think there's a bug, please post here
but remember, bugs with code are fixed faster!
Expand All @@ -46,9 +46,9 @@ python collect_env_details.py
You can also fill out the list below manually.
-->

- PyTorch Lightning Version (e.g., 1.3.0):
- PyTorch Version (e.g., 1.8)
- Python version:
- PyTorch Lightning Version (e.g., 1.5.0):
- PyTorch Version (e.g., 1.10):
- Python version (e.g., 3.9):
- OS (e.g., Linux):
- CUDA/cuDNN version:
- GPU models and configuration:
Expand Down
4 changes: 2 additions & 2 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ issues:
daysUntilClose: 7
# Issues with these labels will never be considered stale
exemptLabels:
- p0
- p1
- "priority: 0"
- "priority: 1"
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it hasn't had any recent activity.
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci_pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# max-parallel: 6
matrix:
os: [ubuntu-20.04, macOS-10.15, windows-2019]
python-version: [3.6, 3.9]
python-version: [3.7, 3.9]

steps:
- uses: actions/checkout@v2
Expand All @@ -26,12 +26,11 @@ jobs:

- name: Prepare env
run: |
pip install check-manifest "twine==3.2" setuptools wheel
pip install "twine==3.2" setuptools wheel
- name: Create package
run: |
check-manifest
# python setup.py check --metadata --strict
python setup.py check --metadata --strict
python setup.py sdist bdist_wheel
- name: Check package
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci_test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ jobs:

- name: Test Package [only]
run: |
# NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003
coverage run --source pytorch_lightning -m pytest pytorch_lightning -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
- name: Upload pytest test results
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ jobs:
python-version: ["3.8"] # previous to last Python version as that one is already used in test-full
pytorch-version: ["1.7", "1.8", "1.9", "1.10"] # nightly: add when there's a release candidate

# FIXME: undo this before merge
timeout-minutes: 75
timeout-minutes: 30
steps:
- uses: actions/checkout@v2

Expand All @@ -30,6 +29,8 @@ jobs:
python ./requirements/adjust_versions.py requirements/extra.txt
python ./requirements/adjust_versions.py requirements/examples.txt
pip install --requirement requirements/devel.txt --find-links https://download.pytorch.org/whl/nightly/torch_nightly.html
# set a per-test timeout of 2.5 minutes to fail sooner. this aids with hanging tests
pip install pytest-timeout
pip list
- name: Pull checkpoints from S3
Expand All @@ -42,8 +43,7 @@ jobs:
- name: Tests
run: |
# NOTE: run coverage on tests does not propagate failure status for Win, https://github.com/nedbat/coveragepy/issues/1003
coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml
coverage run --source pytorch_lightning -m pytest --timeout 150 pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml
shell: bash -l {0}

- name: Upload pytest results
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ jobs:
python-version: ["3.7", "3.9"] # minimum, maximum
requires: ["oldest", "latest"]
release: ["stable"]
include:
# test 3.6 only on oldest until EOL: https://github.com/PyTorchLightning/pytorch-lightning/issues/9981
- {os: ubuntu-18.04, python-version: "3.6", requires: "oldest", release: "stable"}
- {os: windows-2019, python-version: "3.6", requires: "oldest", release: "stable"}
- {os: macOS-10.15, python-version: "3.6", requires: "oldest", release: "stable"}
#include:
# nightly: add when there's a release candidate
#- {os: ubuntu-20.04, python-version: "3.10", requires: "latest", release: "pre"}

Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/ci_test-slow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Test

# 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:
slow:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest]
# same config as '.azure-pipelines/gpu-tests.yml'
python-version: ["3.7"]
pytorch-version: ["1.8"]

timeout-minutes: 20
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Weekly reset caching
run: echo "::set-output name=period::$(python -c 'import time ; days = time.time() / 60 / 60 / 24 ; print(int(days / 7))' 2>&1)"
id: times

- 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
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-td${{ steps.times.outputs.period }}-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-td${{ steps.times.outputs.period }}-py${{ matrix.python-version }}-
- name: Install dependencies
run: |
# adjust versions according installed Torch version
python ./requirements/adjust_versions.py requirements.txt ${{ matrix.pytorch-version }}
pip install --requirement requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
pip install --requirement requirements/test.txt
pip list
shell: bash

- name: Tests
run: |
coverage run --source pytorch_lightning -m pytest tests -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml
env:
PL_RUN_SLOW_TESTS: 1

- name: Upload pytest test results
uses: actions/upload-artifact@v2
with:
name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}
path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml
if: failure()

- name: Statistics
if: success()
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
if: success()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: cpu,pytest,torch${{ matrix.pytorch-version }}
name: CPU-coverage
fail_ci_if_error: false
4 changes: 2 additions & 2 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install mypy
- name: Install dependencies
run: |
grep mypy requirements/test.txt | xargs -0 pip install
pip install '.[dev]'
pip list
- run: mypy --install-types --non-interactive
2 changes: 1 addition & 1 deletion .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.6", "3.7", "3.8", "3.9"]
python_version: ["3.7", "3.8", "3.9"]
pytorch_version: ["1.7", "1.8", "1.9", "1.10"]
steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ repos:
rev: v2.29.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py37-plus]
name: Upgrade code

- repo: https://github.com/myint/docformatter
Expand Down Expand Up @@ -80,8 +80,8 @@ repos:
rev: v1.11.0
hooks:
- id: blacken-docs
args: [ --line-length=120 ]
additional_dependencies: [ black==21.7b0 ]
args: [--line-length=120]
additional_dependencies: [black==21.7b0]

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.10
Expand Down
10 changes: 9 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,17 @@ formats:
- htmlzip
#- pdf

build:
os: ubuntu-20.04
tools:
python: "3.9"
apt_packages:
- texlive-latex-extra
- dvipng
- texlive-pictures

# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: requirements/docs.txt
#- requirements: requirements.txt
Loading

0 comments on commit 1dbb6c1

Please sign in to comment.