Skip to content

Commit 8445225

Browse files
committed
Merge branch 'master' into pbar
2 parents cecb680 + 92c22ae commit 8445225

File tree

17 files changed

+81
-103
lines changed

17 files changed

+81
-103
lines changed

.github/workflows/ci_dockers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
1717
- ".github/workflows/events-nightly.yml"
1818
- "setup.py"
1919

20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
22+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
23+
2024
jobs:
2125
build-PL:
2226
runs-on: ubuntu-20.04

.github/workflows/ci_pkg-install.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77
pull_request:
88
branches: [master, "release/*"]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
12+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
13+
1014
jobs:
1115

1216
install:

.github/workflows/ci_test-base.yml

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# this jobs runs `pytest` over the source directory. It does not install any extra dependencies.
22
# this is useful to catch errors where an import has been added which is not part of the basic dependencies.
3-
name: Test
3+
name: Test simple
44

55
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
66
on: # Trigger the workflow on push or pull request, but only for the master branch
@@ -9,6 +9,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
99
pull_request:
1010
branches: [master, "release/*"]
1111

12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
14+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
15+
1216
jobs:
1317
source:
1418
runs-on: ${{ matrix.os }}
@@ -36,16 +40,14 @@ jobs:
3640
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
3741
- name: Get pip cache
3842
id: pip-cache
39-
run: |
40-
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
43+
run: python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
4144

4245
- name: Cache pip
4346
uses: actions/cache@v2
4447
with:
4548
path: ${{ steps.pip-cache.outputs.dir }}
4649
key: ${{ runner.os }}-pip-td${{ steps.times.outputs.period }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ hashFiles('requirements.txt') }}
47-
restore-keys: |
48-
${{ runner.os }}-pip-td${{ steps.times.outputs.period }}-py${{ matrix.python-version }}-${{ matrix.requires }}-
50+
restore-keys: ${{ runner.os }}-pip-td${{ steps.times.outputs.period }}-py${{ matrix.python-version }}-${{ matrix.requires }}-
4951

5052
- name: Install dependencies
5153
run: |
@@ -59,14 +61,7 @@ jobs:
5961

6062
- name: Test Package [only]
6163
run: |
62-
coverage run --source pytorch_lightning -m pytest pytorch_lightning -v --junitxml=junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
63-
64-
- name: Upload pytest test results
65-
uses: actions/upload-artifact@v2
66-
with:
67-
name: pytest-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}
68-
path: junit/test-results-${{ runner.os }}-${{ matrix.python-version }}-${{ matrix.requires }}.xml
69-
if: failure()
64+
coverage run --source pytorch_lightning -m pytest pytorch_lightning -v
7065
7166
- name: Statistics
7267
if: success()

.github/workflows/ci_test-conda.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Test with Conda
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the master branch
@@ -7,6 +7,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77
pull_request:
88
branches: [master, "release/*"]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
12+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
13+
1014
jobs:
1115
conda:
1216
runs-on: ubuntu-20.04

.github/workflows/ci_test-full.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Test full
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the master branch
@@ -8,10 +8,13 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
88
branches: [master, "release/*"]
99
types: [opened, reopened, ready_for_review, synchronize]
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
13+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
14+
1115
jobs:
1216

1317
cpu:
14-
1518
runs-on: ${{ matrix.os }}
1619
if: github.event.pull_request.draft == false
1720
strategy:
@@ -68,8 +71,7 @@ jobs:
6871
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
6972
- name: Get pip cache dir
7073
id: pip-cache
71-
run: |
72-
echo "::set-output name=dir::$(pip cache dir)"
74+
run: echo "::set-output name=dir::$(pip cache dir)"
7375

7476
- name: pip cache
7577
uses: actions/cache@v2

.github/workflows/ci_test-slow.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Test slow
22

33
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
44
on: # Trigger the workflow on push or pull request, but only for the master branch
@@ -7,6 +7,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77
pull_request:
88
branches: [master, "release/*"]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
12+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
13+
1014
jobs:
1115
slow:
1216
runs-on: ${{ matrix.os }}

.github/workflows/code-checks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
name: Test
1+
name: Code check
22

33
on: # Trigger the workflow on push or pull request, but only for the master branch
44
push:
55
branches: [master, "release/*"]
66
pull_request:
77
branches: [master, "release/*"]
88

9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
11+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
12+
913
jobs:
1014
mypy:
1115
runs-on: ubuntu-20.04

.github/workflows/docs-checks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test
1+
name: Check Docs
22
# https://github.com/marketplace/actions/sphinx-build
33

44
on: # Trigger the workflow on push or pull request, but only for the master branch
@@ -7,6 +7,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
77
pull_request:
88
branches: [master, "release/*"]
99

10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
12+
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
13+
1014
jobs:
1115
doctest:
1216
runs-on: ubuntu-20.04

dockers/base-cuda/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ RUN \
103103

104104
RUN \
105105
# install NVIDIA apex
106-
pip install --no-cache-dir --global-option="--cuda_ext" https://github.com/NVIDIA/apex/archive/refs/heads/master.zip && \
106+
pip install --user --no-cache-dir --global-option="--cuda_ext" https://github.com/NVIDIA/apex/archive/refs/heads/master.zip && \
107107
python -c "from apex import amp"
108108

109109
RUN \

pytorch_lightning/accelerators/accelerator.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from abc import abstractmethod
14+
from abc import ABC, abstractmethod
1515
from typing import Any, Dict, Union
1616

1717
import torch
1818

1919
import pytorch_lightning as pl
2020

2121

22-
class Accelerator:
22+
class Accelerator(ABC):
2323
"""The Accelerator Base Class. An Accelerator is meant to deal with one type of Hardware.
2424
2525
Currently there are accelerators for:
@@ -45,7 +45,7 @@ def setup(self, trainer: "pl.Trainer") -> None:
4545
"""
4646

4747
def get_device_stats(self, device: Union[str, torch.device]) -> Dict[str, Any]:
48-
"""Gets stats for a given device.
48+
"""Get stats for a given device.
4949
5050
Args:
5151
device: device for which to get stats
@@ -58,4 +58,4 @@ def get_device_stats(self, device: Union[str, torch.device]) -> Dict[str, Any]:
5858
@staticmethod
5959
@abstractmethod
6060
def auto_device_count() -> int:
61-
"""Get the devices when set to auto."""
61+
"""Get the device count when set to auto."""

0 commit comments

Comments
 (0)