Skip to content

Commit a715751

Browse files
authored
Merge branch 'master' into cifar10-baseline
2 parents 7e0bd65 + 77fb425 commit a715751

File tree

160 files changed

+6333
-1921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+6333
-1921
lines changed

.drone.jsonnet

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
Copyright The PyTorch Lightning team.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
// https://github.com/drone/drone-jsonnet-config/blob/master/.drone.jsonnet
18+
19+
local pipeline(name, image) = {
20+
kind: "pipeline",
21+
type: "docker",
22+
name: name,
23+
steps: [
24+
{
25+
name: "testing",
26+
image: image,
27+
environment: {
28+
"CODECOV_TOKEN": {
29+
from_secret: "codecov_token"
30+
},
31+
"MKL_THREADING_LAYER": "GNU",
32+
},
33+
commands: [
34+
"python --version",
35+
"pip --version",
36+
"nvidia-smi",
37+
"pip install -r ./requirements/devel.txt --upgrade-strategy only-if-needed -v --no-cache-dir",
38+
"pip list",
39+
"coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v -ra --color=yes --durations=25",
40+
"python -m pytest benchmarks pl_examples -v -ra --color=yes --maxfail=2 --durations=0",
41+
"coverage report",
42+
"codecov --token $CODECOV_TOKEN --flags=gpu,pytest --name='GPU-coverage' --env=linux --build $DRONE_BUILD_NUMBER --commit $DRONE_COMMIT",
43+
"python tests/collect_env_details.py"
44+
],
45+
},
46+
],
47+
trigger: {
48+
branch: [
49+
"master",
50+
"release/*"
51+
],
52+
event: [
53+
"push",
54+
"pull_request"
55+
]
56+
},
57+
depends_on: if name == "torch-GPU-nightly" then ["torch-GPU"]
58+
};
59+
60+
[
61+
pipeline("torch-GPU", "pytorchlightning/pytorch_lightning:base-cuda-py3.7-torch1.6"),
62+
pipeline("torch-GPU-nightly", "pytorchlightning/pytorch_lightning:base-cuda-py3.7-torch1.7"),
63+
]

.drone.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,11 @@ steps:
3939
# todo: temprarl fix till https://github.com/PyTorchLightning/pytorch-lightning/pull/4922 is resolved
4040
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist "nvidia-dali-cuda100<0.27" --upgrade-strategy only-if-needed
4141
- pip list
42-
- coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=25 # --flake8
43-
- python -m pytest benchmarks pl_examples -v --maxfail=2 --durations=0 # --flake8
44-
#- cd docs; make doctest; make coverage
42+
- python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=25 # --flake8
43+
# Running special tests
44+
- sh tests/special_tests.sh
4545
- coverage report
46+
- python -m pytest benchmarks pl_examples -v --maxfail=2 --durations=0
4647
# see: https://docs.codecov.io/docs/merging-reports
4748
- codecov --token $CODECOV_TOKEN --flags=gpu,pytest --name="GPU-coverage" --env=linux --build $DRONE_BUILD_NUMBER --commit $DRONE_COMMIT
4849
# --build $DRONE_BUILD_NUMBER --branch $DRONE_BRANCH --commit $DRONE_COMMIT --tag $DRONE_TAG --pr $DRONE_PULL_REQUEST

.github/workflows/code-formatting.yml

Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -22,88 +22,55 @@ jobs:
2222
- name: Run isort
2323
run: isort --settings-path=./pyproject.toml --check-only --diff .
2424

25-
code-black:
26-
name: Check code formatting with Black
27-
runs-on: ubuntu-20.04
28-
steps:
29-
- name: Checkout
30-
uses: actions/checkout@v2
31-
- name: Set up Python 3.8
32-
uses: actions/setup-python@v2
33-
with:
34-
python-version: 3.8
35-
- name: Install Black
36-
run: pip install black==19.10b0
37-
- name: Run Black
38-
run: echo "LGTM"
39-
# run black --skip-string-normalization --config=pyproject.toml --check . # TODO, uncomment
25+
#code-black:
26+
# name: Check code formatting with Black
27+
# runs-on: ubuntu-20.04
28+
# steps:
29+
# - name: Checkout
30+
# uses: actions/checkout@v2
31+
# - name: Set up Python 3.8
32+
# uses: actions/setup-python@v2
33+
# with:
34+
# python-version: 3.8
35+
# - name: Install Black
36+
# run: pip install black==19.10b0
37+
# - name: Run Black
38+
# run: echo "LGTM"
39+
# run black --skip-string-normalization --config=pyproject.toml --check . # TODO, uncomment
4040

41-
python-types:
42-
name: Python static type checking with Pyright
41+
python-pep8:
42+
name: Python formatting PEP8
4343
runs-on: ubuntu-20.04
4444

4545
# Timeout: https://stackoverflow.com/a/59076067/4521646
46-
timeout-minutes: 15
46+
timeout-minutes: 10
4747
steps:
4848
- name: Checkout
4949
uses: actions/checkout@v2
5050
- uses: actions/setup-python@v2
5151
with:
5252
python-version: 3.7
5353

54-
# Note: This uses an internal pip API and may not always work
55-
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
56-
- name: Cache pip
57-
uses: actions/cache@v2
58-
with:
59-
path: ~/.cache/pip
60-
key: ${{ runner.os }}-pip-extras-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements/extra.txt') }}
61-
restore-keys: |
62-
${{ runner.os }}-pip-extras-
63-
6454
- name: Install dependencies
65-
env:
66-
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
67-
HOROVOD_WITHOUT_MXNET: 1
68-
HOROVOD_WITHOUT_TENSORFLOW: 1
6955
run: |
70-
# python -m pip install --upgrade --user pip
71-
pip install --requirement requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
72-
pip install --requirement ./requirements/devel.txt --quiet
73-
# pip install tox coverage
74-
python --version ; pip --version ; pip list
75-
shell: bash
76-
77-
- name: Set up node
78-
uses: actions/setup-node@v1
79-
with:
80-
node-version: '12'
81-
82-
- name: Install pyright
83-
run: |
84-
npm install pyright
56+
pip install flake8
8557
86-
- name: Run type checking
58+
- name: Run checking
8759
run: |
88-
$(npm bin)/pyright --project .pyrightconfig.json
60+
flake8 .
8961
90-
python-pep8:
91-
name: Python formatting PEP8
62+
python-typing-mypy:
63+
name: Python typing check [mypy]
9264
runs-on: ubuntu-20.04
93-
94-
# Timeout: https://stackoverflow.com/a/59076067/4521646
95-
timeout-minutes: 10
9665
steps:
97-
- name: Checkout
98-
uses: actions/checkout@v2
66+
- uses: actions/checkout@master
9967
- uses: actions/setup-python@v2
10068
with:
101-
python-version: 3.7
102-
103-
- name: Install dependencies
69+
python-version: 3.8
70+
- name: Install mypy
10471
run: |
105-
pip install flake8
106-
107-
- name: Run checking
72+
pip install mypy
73+
pip list
74+
- name: mypy check
10875
run: |
109-
flake8 .
76+
mypy

.github/workflows/release-pypi.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,17 @@ jobs:
2828
python setup.py sdist bdist_wheel
2929
ls -lh dist/
3030
31+
- name: Upload to release
32+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
33+
uses: svenstaro/upload-release-action@v2
34+
with:
35+
repo_token: ${{ secrets.GITHUB_TOKEN }}
36+
file: dist/*
37+
tag: ${{ github.ref }}
38+
asset_name: packages
39+
overwrite: false
40+
file_glob: true
41+
3142
- name: Delay releasing
3243
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
3344
uses: juliangruber/sleep-action@v1

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ repos:
3030
args: [--settings-path, ./pyproject.toml]
3131
language: system
3232
types: [python]
33+
34+
- repo: https://github.com/pre-commit/mirrors-mypy
35+
rev: v0.790
36+
hooks:
37+
- id: mypy

.pyrightconfig.json

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)