Skip to content

Commit 240735b

Browse files
committed
Merge branch 'master' into ci/tpu
2 parents 7bf069f + fee52f9 commit 240735b

File tree

33 files changed

+283
-199
lines changed

33 files changed

+283
-199
lines changed

.azure/gpu-benchmark.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,7 @@ jobs:
6868
pip list
6969
displayName: 'Image info & NVIDIA'
7070
71-
- bash: |
72-
python .actions/assistant.py requirements_prune_pkgs --packages [horovod,bagua,colossalai] --req_files [requirements/pytorch/strategies.txt]
73-
74-
PYTORCH_VERSION=$(python -c "import torch; print(torch.__version__.split('+')[0])")
75-
python ./requirements/pytorch/adjust-versions.py requirements/pytorch/base.txt ${PYTORCH_VERSION}
76-
displayName: 'Adjust dependencies'
77-
78-
- bash: pip install -e .[dev,strategies,examples] --find-links ${TORCH_URL}
71+
- bash: pip install -e .[dev] --find-links ${TORCH_URL}
7972
env:
8073
PACKAGE_NAME: "pytorch"
8174
FREEZE_REQUIREMENTS: "1"

.github/actions/pkg-publish/action.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ inputs:
55
pkg-pattern:
66
description: what file pattern is searched in folder, so for example `*_app*`
77
required: true
8+
pypi-test-token:
9+
description: login token for PyPI
10+
default: ''
11+
required: false
812
pypi-token:
913
description: login token for PyPI
10-
required: true
14+
default: ''
15+
required: false
1116

1217
runs:
1318
using: "composite"
@@ -20,16 +25,19 @@ runs:
2025
shell: bash
2126

2227
# We do this, since failures on test.pypi aren't that bad
23-
#- name: Publish to Test PyPI
24-
# uses: pypa/[email protected]
25-
# with:
26-
# user: __token__
27-
# password: ${{ secrets.test_pypi_token_lai }}
28-
# repository_url: https://test.pypi.org/legacy/
29-
# verbose: true
28+
- name: Publish to Test PyPI
29+
uses: pypa/[email protected]
30+
if: inputs.pypi-test-token != ''
31+
with:
32+
user: __token__
33+
password: ${{ secrets.test_pypi_token_lai }}
34+
repository_url: https://test.pypi.org/legacy/
35+
packages_dir: pypi/
36+
verbose: true
3037

3138
- name: Publish distribution 📦 to PyPI
3239
uses: pypa/[email protected]
40+
if: inputs.pypi-token != ''
3341
with:
3442
user: __token__
3543
password: ${{ inputs.pypi-token }}

.github/workflows/legacy-checkpoints.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,15 @@ on:
4141
AWS_SECRET_KEY_ID:
4242
required: true
4343

44+
defaults:
45+
run:
46+
shell: bash
47+
4448
jobs:
4549
create-legacy-ckpts:
4650
runs-on: ubuntu-20.04
4751
outputs:
48-
pl-version: ${{ steps.decide-pl-version.outputs.pl-version }}
52+
pl-version: ${{ steps.decide-version.outputs.pl-version }}
4953
defaults:
5054
run:
5155
working-directory: tests/legacy
@@ -69,16 +73,24 @@ jobs:
6973
env:
7074
PACKAGE_NAME: pytorch
7175
run: |
72-
pip install -e . -f https://download.pytorch.org/whl/cpu/torch_stable.html
76+
pip install . -f https://download.pytorch.org/whl/cpu/torch_stable.html
7377
pip list
7478
if: inputs.pl_version == ''
7579

80+
- name: Install PL version
81+
run: |
82+
pip install "pytorch-lightning==${{ inputs.pl_version }}" \
83+
-f https://download.pytorch.org/whl/cpu/torch_stable.html \
84+
--extra-index-url https://test.pypi.org/simple/
85+
pip list
86+
if: inputs.pl_version != ''
87+
7688
- name: Pull legacy checkpoints
7789
working-directory: ./
7890
run: bash .actions/pull_legacy_checkpoints.sh
7991

8092
- name: Decide PL version to create a PR with
81-
id: decide-pl-version
93+
id: decide-version
8294
run: |
8395
python -c "import pytorch_lightning as pl; print(f'pl-version={pl.__version__}')" >> $GITHUB_OUTPUT || echo pl-version='' >> $GITHUB_OUTPUT
8496

.github/workflows/release-pypi.yml

Lines changed: 97 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
release:
88
types: [published]
99

10+
defaults:
11+
run:
12+
shell: bash
13+
1014
jobs:
1115
init:
1216
runs-on: ubuntu-20.04
@@ -24,8 +28,7 @@ jobs:
2428
runs-on: ubuntu-20.04
2529
strategy:
2630
fail-fast: true
27-
# run sequential
28-
max-parallel: 1
31+
max-parallel: 1 # run sequential to prevent download/upload collisions
2932
matrix:
3033
pkg-name: ["lightning", "app", "lite", "pytorch"]
3134
steps:
@@ -70,7 +73,69 @@ jobs:
7073
files: 'dist/*'
7174
repo-token: ${{ secrets.GITHUB_TOKEN }}
7275

73-
publish-packages:
76+
release-version:
77+
runs-on: ubuntu-20.04
78+
outputs:
79+
tag: ${{ steps.lai-package.outputs.version }}
80+
steps:
81+
- uses: actions/checkout@v3
82+
- name: install Package
83+
env:
84+
PACKAGE_NAME: "lightning"
85+
run: pip install . -f https://download.pytorch.org/whl/cpu/torch_stable.html
86+
- name: package Version
87+
id: lai-package
88+
run: python -c "import lightning as L; print(f'version={L.__version__}')" >> $GITHUB_OUTPUT
89+
90+
signaling:
91+
runs-on: ubuntu-20.04
92+
needs: [release-version, pre-publish-packages]
93+
env:
94+
TAG: ${{ needs.release-version.outputs.tag }}
95+
steps:
96+
- uses: actions/setup-python@v4
97+
with:
98+
python-version: 3.8
99+
- uses: actions/checkout@v3
100+
with:
101+
repository: gridai/base-images
102+
token: ${{ secrets.PAT_GHOST }}
103+
ref: main
104+
- uses: fregante/setup-git-token@v1
105+
with:
106+
token: ${{ secrets.PAT_GHOST }}
107+
name: PL Ghost
108+
109+
- name: Update lightning version
110+
run: |
111+
import json, os
112+
with open("versions.json") as fo:
113+
vers = json.load(fo)
114+
vers["lightning_version"] = os.getenv('TAG')
115+
with open("versions.json", "w") as fw:
116+
json.dump(vers, fw)
117+
shell: python
118+
- name: GIT Commit
119+
run: |
120+
git add versions.json
121+
git commit -m "bumping lightning version -> ${TAG}"
122+
cat versions.json
123+
- name: GIT Push
124+
run: |
125+
git status
126+
git push
127+
128+
waiting:
129+
# TODO: replace with back signal from build images/ loop checking for a specific branch?
130+
runs-on: ubuntu-20.04
131+
needs: signaling
132+
steps:
133+
- name: Delay releasing
134+
uses: juliangruber/sleep-action@v1
135+
with:
136+
time: 30m
137+
138+
pre-publish-packages:
74139
runs-on: ubuntu-20.04
75140
needs: build-packages
76141
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
@@ -82,38 +147,59 @@ jobs:
82147
path: dist
83148
- run: ls -lh dist/
84149
- run: mkdir pypi/
85-
86-
- name: Delay releasing
87-
uses: juliangruber/sleep-action@v1
150+
- uses: ./.github/actions/pkg-publish
88151
with:
89-
time: 10m
152+
pkg-pattern: "*app*"
153+
pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_APP }}
154+
- uses: ./.github/actions/pkg-publish
155+
with:
156+
pkg-pattern: "*lite*"
157+
pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_LITE }}
158+
- uses: ./.github/actions/pkg-publish
159+
with:
160+
pkg-pattern: "*pytorch*"
161+
pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_PYTORCH }}
162+
- uses: ./.github/actions/pkg-publish
163+
with:
164+
pkg-pattern: "*"
165+
pypi-test-token: ${{ secrets.PYPI_TEST_TOKEN_LAI }}
90166

167+
publish-packages:
168+
runs-on: ubuntu-20.04
169+
needs: waiting
170+
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
171+
steps:
172+
- uses: actions/checkout@v3
173+
- uses: actions/download-artifact@v3
174+
with:
175+
name: dist-packages-${{ github.sha }}
176+
path: dist
177+
- run: ls -lh dist/
178+
- run: mkdir pypi/
91179
- uses: ./.github/actions/pkg-publish
92180
with:
93181
pkg-pattern: "*app*"
94182
pypi-token: ${{ secrets.PYPI_TOKEN_APP }}
95-
96183
- uses: ./.github/actions/pkg-publish
97184
with:
98185
pkg-pattern: "*lite*"
99186
pypi-token: ${{ secrets.PYPI_TOKEN_LITE }}
100-
101187
- uses: ./.github/actions/pkg-publish
102188
with:
103189
pkg-pattern: "*pytorch*"
104190
pypi-token: ${{ secrets.PYPI_TOKEN_PYTORCH }}
105-
106191
- uses: ./.github/actions/pkg-publish
107192
with:
108193
pkg-pattern: "*"
109194
pypi-token: ${{ secrets.PYPI_TOKEN_LAI }}
110195

111196
legacy-checkpoints:
112-
needs: publish-packages
197+
needs: [release-version, pre-publish-packages]
113198
uses: ./.github/workflows/legacy-checkpoints.yml
114199
with:
115200
push_to_s3: true
116201
create_pr: true
202+
pl_version: ${{ needs.release-version.outputs.tag }}
117203
secrets:
118204
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
119205
AWS_SECRET_KEY_ID: ${{ secrets.AWS_SECRET_KEY_ID }}

docs/source-pytorch/advanced/model_parallel.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,9 +1108,6 @@ Combine hooks for accumulated benefit:
11081108
11091109
When using Post-localSGD, you must also pass ``model_averaging_period`` to allow for model parameter averaging:
11101110

1111-
.. note::
1112-
Post-localSGD support requires PyTorch>=1.10.0
1113-
11141111
.. code-block:: python
11151112
11161113
from pytorch_lightning import Trainer

docs/source-pytorch/common/precision_intermediate.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ BFloat16 Mixed Precision
115115

116116
.. warning::
117117

118-
BFloat16 requires PyTorch 1.10 or later and is only supported with PyTorch Native AMP.
119-
120118
BFloat16 is also experimental and may not provide significant speedups or memory improvements, offering better numerical stability.
121119

122120
Do note for GPUs, the most significant benefits require `Ampere <https://en.wikipedia.org/wiki/Ampere_(microarchitecture)>`__ based GPUs, such as A100s or 3090s.
@@ -126,14 +124,13 @@ BFloat16 Mixed precision is similar to FP16 mixed precision, however, it maintai
126124
Under the hood, we use `torch.autocast <https://pytorch.org/docs/stable/amp.html>`__ with the dtype set to ``bfloat16``, with no gradient scaling.
127125

128126
.. testcode::
129-
:skipif: not _TORCH_GREATER_EQUAL_1_10 or not torch.cuda.is_available()
127+
:skipif: not torch.cuda.is_available()
130128

131129
Trainer(accelerator="gpu", devices=1, precision="bf16")
132130

133131
It is also possible to use BFloat16 mixed precision on the CPU, relying on MKLDNN under the hood.
134132

135133
.. testcode::
136-
:skipif: not _TORCH_GREATER_EQUAL_1_10
137134

138135
Trainer(precision="bf16")
139136

docs/source-pytorch/conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,6 @@ def package_list_from_file(file):
400400
from pytorch_lightning.utilities import (
401401
_APEX_AVAILABLE,
402402
_TORCHVISION_AVAILABLE,
403-
_TORCH_GREATER_EQUAL_1_10,
404403
)
405404
from pytorch_lightning.loggers.neptune import _NEPTUNE_AVAILABLE
406405
from pytorch_lightning.loggers.comet import _COMET_AVAILABLE

requirements/app/base.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ beautifulsoup4>=4.8.0, <4.11.2
1212
inquirer>=2.10.0
1313
psutil<5.9.4
1414
click<=8.1.3
15-
lightning_api_access>=0.0.3

requirements/app/components.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# deps required by components in the lightning app repository (src/lightning_app/components)
2+
lightning_api_access>=0.0.3

requirements/app/devel.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,7 @@
1010
# extended list of dependencies for UI
1111
-r ./ui.txt
1212

13+
# extended list of dependencies for UI
14+
-r ./components.txt
15+
1316
-r ./examples.txt

0 commit comments

Comments
 (0)