Skip to content

Commit 91e089d

Browse files
authored
Merge branch 'master' into feat_wandb_resume
2 parents f930f27 + 5d2fa98 commit 91e089d

Some content is hidden

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

52 files changed

+959
-736
lines changed

.drone.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ steps:
3636
- pip install -r ./requirements/devel.txt --upgrade-strategy only-if-needed -v --no-cache-dir
3737
- pip install git+https://${AUTH_TOKEN}@github.com/PyTorchLightning/[email protected] -v --no-cache-dir
3838
# when Image has defined CUDa version we can switch to this package spec "nvidia-dali-cuda${CUDA_VERSION%%.*}0"
39-
# todo: temprarl fix till https://github.com/PyTorchLightning/pytorch-lightning/pull/4922 is resolved
40-
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist "nvidia-dali-cuda100<0.27" --upgrade-strategy only-if-needed
39+
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist nvidia-dali-cuda100 --upgrade-strategy only-if-needed
4140
- pip list
4241
- python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=25 # --flake8
4342
# Running special tests

.github/workflows/release-docker.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Get release version
2727
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'release'
2828
id: get_version
29-
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})
29+
run: echo "::set-output name=RELEASE_VERSION::$(echo ${GITHUB_REF##*/})"
3030

3131
- name: Publish Releases to Docker
3232
# only on releases
@@ -37,6 +37,6 @@ jobs:
3737
username: ${{ secrets.DOCKER_USERNAME }}
3838
password: ${{ secrets.DOCKER_PASSWORD }}
3939
dockerfile: dockers/release/Dockerfile
40-
build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ env.RELEASE_VERSION }}
41-
tags: "${{ env.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
40+
build_args: PYTHON_VERSION=${{ matrix.python_version }},PYTORCH_VERSION=${{ matrix.pytorch_version }},LIGHTNING_VERSION=${{ steps.get_version.outputs.RELEASE_VERSION }}
41+
tags: "${{ steps.get_version.outputs.RELEASE_VERSION }}-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }},latest-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
4242
timeout-minutes: 55

.mergify.yml

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,59 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
pull_request_rules:
16-
17-
- name: Automatic merge on approval
18-
conditions:
19-
- base=master
20-
# number of review approvals
21-
- "#approved-reviews-by>=3"
22-
# no waiting or assigned review
23-
- "#review-requested=0"
24-
# no requested chnages from any reviewer
25-
- "#changes-requested-reviews-by=0"
26-
# this serves as ALL check has to pass as we have actually around 40 tests in total
27-
- "#status-success>=54"
28-
# this is just in case since we rely on GPU tests (note: redundand to the above)
29-
- status-success=continuous-integration/drone/pr
30-
- "status-success=ci/circleci: TPU-tests"
31-
# this is patter-like, unofrunatly serves as `any(...)` (note: redundand to the above)
32-
#- "status-success~=^ci/circleci:"
33-
# no conflict with master branch
34-
- -conflict
35-
# was not closed yet
36-
- -closed
37-
# filter-out GH draft PRs
38-
- -draft
39-
actions:
40-
delete_head_branch: {}
41-
merge:
42-
# https://doc.mergify.io/merge-action.html#strict-merge
43-
# (on head branch) $ git merge --no-ff base
44-
# (on head branch) # Wait for CI to go green
45-
# (on head branch) # Squash all commits
46-
# (on base branch) $ git merge --ff head
47-
strict: true
48-
method: squash
49-
comment:
50-
message: Great job! =)
51-
52-
- name: warn on conflicts
53-
conditions:
54-
- conflict
55-
# filter-out GH draft PRs
56-
- -draft
57-
actions:
58-
comment:
59-
message: This pull request is now in conflict... :(
60-
61-
- name: add core reviewer
62-
conditions:
63-
# filter-out GH draft PRs
64-
- -draft
65-
# number of review approvals
66-
- "#approved-reviews-by<3"
67-
actions:
68-
request_reviews:
69-
teams:
70-
- core-contributors
15+
#pull_request_rules:
16+
#
17+
# - name: Automatic merge on approval
18+
# conditions:
19+
# - base=master
20+
# # number of review approvals
21+
# - "#approved-reviews-by>=3"
22+
# # no waiting or assigned review
23+
# - "#review-requested=0"
24+
# # no requested chnages from any reviewer
25+
# - "#changes-requested-reviews-by=0"
26+
# # this serves as ALL check has to pass as we have actually around 40 tests in total
27+
# - "#status-success>=54"
28+
# # this is just in case since we rely on GPU tests (note: redundand to the above)
29+
# - status-success=continuous-integration/drone/pr
30+
# - "status-success=ci/circleci: TPU-tests"
31+
# # this is patter-like, unofrunatly serves as `any(...)` (note: redundand to the above)
32+
# #- "status-success~=^ci/circleci:"
33+
# # no conflict with master branch
34+
# - -conflict
35+
# # was not closed yet
36+
# - -closed
37+
# # filter-out GH draft PRs
38+
# - -draft
39+
# actions:
40+
# delete_head_branch: {}
41+
# merge:
42+
# # https://doc.mergify.io/merge-action.html#strict-merge
43+
# # (on head branch) $ git merge --no-ff base
44+
# # (on head branch) # Wait for CI to go green
45+
# # (on head branch) # Squash all commits
46+
# # (on base branch) $ git merge --ff head
47+
# strict: true
48+
# method: squash
49+
# comment:
50+
# message: Great job! =)
51+
#
52+
# - name: warn on conflicts
53+
# conditions:
54+
# - conflict
55+
# # filter-out GH draft PRs
56+
# - -draft
57+
# actions:
58+
# comment:
59+
# message: This pull request is now in conflict... :(
60+
#
61+
# - name: add core reviewer
62+
# conditions:
63+
# # filter-out GH draft PRs
64+
# - -draft
65+
# # number of review approvals
66+
# - "#approved-reviews-by<3"
67+
# actions:
68+
# request_reviews:
69+
# teams:
70+
# - core-contributors

CHANGELOG.md

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8-
## [unreleased.BugFix] - YYYY-MM-DD
8+
## [1.1.2rc1] - 2020-12-17
99

1010
### Added
1111

12+
- Support number for logging with `sync_dist=True` ([#5080](https://github.com/PyTorchLightning/pytorch-lightning/pull/5080)
13+
1214

1315
### Changed
1416

@@ -18,20 +20,60 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
1820

1921
### Removed
2022

23+
- `enable_pl_optimizer=False` by default to temporarily fix AMP issues ([#5163](https://github.com/PyTorchLightning/pytorch-lightning/pull/5163)
24+
2125

2226
### Fixed
2327

24-
- Fixed trainer by default `None` in `DDPAccelerator` ([#4915](https://github.com/PyTorchLightning/pytorch-lightning/pull/4915))
28+
- Metric reduction with Logging ([#5150](https://github.com/PyTorchLightning/pytorch-lightning/pull/5150)
29+
30+
31+
- Remove nan loss in manual optimization ([#5121](https://github.com/PyTorchLightning/pytorch-lightning/pull/5121)
32+
33+
34+
- Un-balanced logging properly supported ([#5119](https://github.com/PyTorchLightning/pytorch-lightning/pull/5119)
35+
36+
37+
- Fix hanging in DDP HPC accelerators ([#5157](https://github.com/PyTorchLightning/pytorch-lightning/pull/5157)
38+
39+
40+
- Fix saved filename in `ModelCheckpoint` if it already exists ([#4861](https://github.com/PyTorchLightning/pytorch-lightning/pull/4861)
41+
2542

43+
- Fix reset `TensorRunningAccum` ([#5106](https://github.com/PyTorchLightning/pytorch-lightning/pull/5106)
2644

27-
- Fixed `LightningOptimizer` exposes optimizer attributes ([#5095](https://github.com/PyTorchLightning/pytorch-lightning/pull/5095))
2845

46+
## [1.1.1] - 2020-12-15
2947

48+
### Added
49+
50+
- Add a notebook example to reach a quick baseline of ~94% accuracy on CIFAR10 using Resnet in Lightning ([#4818](https://github.com/PyTorchLightning/pytorch-lightning/pull/4818)
51+
52+
### Changed
53+
54+
- Simplify accelerator steps ([#5015](https://github.com/PyTorchLightning/pytorch-lightning/pull/5015)
55+
- Refactor load in checkpoint connector ([#4593](https://github.com/PyTorchLightning/pytorch-lightning/pull/4593)
3056
- Fixed the saved filename in `ModelCheckpoint` when it already exists ([#4861](https://github.com/PyTorchLightning/pytorch-lightning/pull/4861))
3157

58+
### Removed
3259

33-
- Do not warn when the `name` key is used in the `lr_scheduler` dict ([#5057](https://github.com/PyTorchLightning/pytorch-lightning/pull/5057))
60+
- Drop duplicate metrics ([#5014](https://github.com/PyTorchLightning/pytorch-lightning/pull/5014)
61+
- Remove beta arg from F1 class and functional ([#5076](https://github.com/PyTorchLightning/pytorch-lightning/pull/5076)
62+
63+
### Fixed
3464

65+
- Fixed trainer by default `None` in `DDPAccelerator` ([#4915](https://github.com/PyTorchLightning/pytorch-lightning/pull/4915))
66+
- Fixed `LightningOptimizer` to expose optimizer attributes ([#5095](https://github.com/PyTorchLightning/pytorch-lightning/pull/5095))
67+
- Do not warn when the `name` key is used in the `lr_scheduler` dict ([#5057](https://github.com/PyTorchLightning/pytorch-lightning/pull/5057))
68+
- Check if optimizer supports closure ([#4981](https://github.com/PyTorchLightning/pytorch-lightning/pull/4981)
69+
- Extend LightningOptimizer to exposure underlying Optimizer attributes + update doc ([#5095](https://github.com/PyTorchLightning/pytorch-lightning/pull/5095)
70+
- Add deprecated metric utility functions back to functional (
71+
[#5067](https://github.com/PyTorchLightning/pytorch-lightning/pull/5067),
72+
[#5068](https://github.com/PyTorchLightning/pytorch-lightning/pull/5068))
73+
- Allow any input in `to_onnx` and `to_torchscript` ([#4378](https://github.com/PyTorchLightning/pytorch-lightning/pull/4378)
74+
- Do not warn when the name key is used in the `lr_scheduler` dict ([#5057](https://github.com/PyTorchLightning/pytorch-lightning/pull/5057)
75+
76+
- Fixed `DDPHPCAccelerator` hangs in DDP construction by calling `init_device` ([#5157](https://github.com/PyTorchLightning/pytorch-lightning/pull/5157))
3577

3678

3779
## [1.1.0] - 2020-12-09

benchmarks/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright The PyTorch Lightning team.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
import os
15+
16+
BENCHMARK_ROOT = os.path.dirname(__file__)
17+
PROJECT_ROOT = os.path.dirname(BENCHMARK_ROOT)

benchmarks/generate_comparison.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright The PyTorch Lightning team.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
import os
15+
16+
import matplotlib.pylab as plt
17+
import pandas as pd
18+
19+
from benchmarks.test_basic_parity import lightning_loop, vanilla_loop
20+
from tests.base.models import ParityModuleMNIST, ParityModuleRNN
21+
22+
NUM_EPOCHS = 20
23+
NUM_RUNS = 50
24+
MODEL_CLASSES = (ParityModuleRNN, ParityModuleMNIST)
25+
PATH_HERE = os.path.dirname(__file__)
26+
FIGURE_EXTENSION = '.png'
27+
28+
29+
def _main():
30+
fig, axarr = plt.subplots(nrows=len(MODEL_CLASSES))
31+
32+
for i, cls_model in enumerate(MODEL_CLASSES):
33+
path_csv = os.path.join(PATH_HERE, f'dump-times_{cls_model.__name__}.csv')
34+
if os.path.isfile(path_csv):
35+
df_time = pd.read_csv(path_csv, index_col=0)
36+
else:
37+
vanilla = vanilla_loop(cls_model, num_epochs=NUM_EPOCHS, num_runs=NUM_RUNS)
38+
lightning = lightning_loop(cls_model, num_epochs=NUM_EPOCHS, num_runs=NUM_RUNS)
39+
40+
df_time = pd.DataFrame({'vanilla PT': vanilla['durations'][1:], 'PT Lightning': lightning['durations'][1:]})
41+
df_time /= NUM_RUNS
42+
df_time.to_csv(os.path.join(PATH_HERE, f'dump-times_{cls_model.__name__}.csv'))
43+
# todo: add also relative X-axis ticks to see both: relative and absolute time differences
44+
df_time.plot.hist(
45+
ax=axarr[i],
46+
bins=20,
47+
alpha=0.5,
48+
title=cls_model.__name__,
49+
legend=True,
50+
grid=True,
51+
)
52+
axarr[i].set(xlabel='time [seconds]')
53+
54+
path_fig = os.path.join(PATH_HERE, f'figure-parity-times{FIGURE_EXTENSION}')
55+
fig.tight_layout()
56+
fig.savefig(path_fig)
57+
58+
59+
if __name__ == '__main__':
60+
_main()

0 commit comments

Comments
 (0)