Skip to content

Commit a771423

Browse files
authored
Merge branch 'master' into patch-1
2 parents 71c48b2 + 87565cb commit a771423

File tree

291 files changed

+3114
-1714
lines changed

Some content is hidden

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

291 files changed

+3114
-1714
lines changed

.actions/assistant.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@
1818
import shutil
1919
import tempfile
2020
import urllib.request
21+
from collections.abc import Iterable, Iterator, Sequence
2122
from itertools import chain
2223
from os.path import dirname, isfile
2324
from pathlib import Path
24-
from typing import Any, Dict, Iterable, Iterator, List, Optional, Sequence, Tuple
25+
from typing import Any, Optional
2526

2627
from packaging.requirements import Requirement
2728
from packaging.version import Version
@@ -127,7 +128,7 @@ def _parse_requirements(lines: Iterable[str]) -> Iterator[_RequirementWithCommen
127128
pip_argument = None
128129

129130

130-
def load_requirements(path_dir: str, file_name: str = "base.txt", unfreeze: str = "all") -> List[str]:
131+
def load_requirements(path_dir: str, file_name: str = "base.txt", unfreeze: str = "all") -> list[str]:
131132
"""Loading requirements from a file.
132133
133134
>>> path_req = os.path.join(_PROJECT_ROOT, "requirements")
@@ -222,7 +223,7 @@ def _load_aggregate_requirements(req_dir: str = "requirements", freeze_requireme
222223
fp.writelines([ln + os.linesep for ln in requires] + [os.linesep])
223224

224225

225-
def _retrieve_files(directory: str, *ext: str) -> List[str]:
226+
def _retrieve_files(directory: str, *ext: str) -> list[str]:
226227
all_files = []
227228
for root, _, files in os.walk(directory):
228229
for fname in files:
@@ -232,7 +233,7 @@ def _retrieve_files(directory: str, *ext: str) -> List[str]:
232233
return all_files
233234

234235

235-
def _replace_imports(lines: List[str], mapping: List[Tuple[str, str]], lightning_by: str = "") -> List[str]:
236+
def _replace_imports(lines: list[str], mapping: list[tuple[str, str]], lightning_by: str = "") -> list[str]:
236237
"""Replace imports of standalone package to lightning.
237238
238239
>>> lns = [
@@ -320,7 +321,7 @@ def copy_replace_imports(
320321
fo.writelines(lines)
321322

322323

323-
def create_mirror_package(source_dir: str, package_mapping: Dict[str, str]) -> None:
324+
def create_mirror_package(source_dir: str, package_mapping: dict[str, str]) -> None:
324325
"""Create a mirror package with adjusted imports."""
325326
# replace imports and copy the code
326327
mapping = package_mapping.copy()

.azure/gpu-benchmarks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
variables:
4747
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
4848
container:
49-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.4-cuda12.1.0"
49+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.5-cuda12.1.0"
5050
options: "--gpus=all --shm-size=32g"
5151
strategy:
5252
matrix:

.azure/gpu-tests-fabric.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.3-cuda12.1.0"
6161
PACKAGE_NAME: "fabric"
6262
"Lightning | latest":
63-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.4-cuda12.1.0"
63+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.5-cuda12.1.0"
6464
PACKAGE_NAME: "lightning"
6565
workspace:
6666
clean: all
@@ -134,13 +134,13 @@ jobs:
134134
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
135135
displayName: "Adjust tests & examples"
136136
137-
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest . -v --durations=50
138-
workingDirectory: tests/tests_fabric/
137+
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest tests_fabric/ -v --durations=50
138+
workingDirectory: tests/
139139
displayName: "Testing: fabric standard"
140140
timeoutInMinutes: "10"
141141

142-
- bash: bash ../run_standalone_tests.sh "."
143-
workingDirectory: tests/tests_fabric/
142+
- bash: bash ./run_standalone_tests.sh "tests_fabric"
143+
workingDirectory: tests/
144144
env:
145145
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
146146
displayName: "Testing: fabric standalone"
@@ -157,7 +157,7 @@ jobs:
157157
./codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) \
158158
--flags=gpu,pytest,${COVERAGE_SOURCE} --name="GPU-coverage" --env=linux,azure
159159
ls -l
160-
workingDirectory: tests/tests_fabric/
160+
workingDirectory: tests/
161161
displayName: "Statistics"
162162
163163
- script: |

.azure/gpu-tests-pytorch.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.3-cuda12.1.0"
5454
PACKAGE_NAME: "pytorch"
5555
"Lightning | latest":
56-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.4-cuda12.1.0"
56+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.5-cuda12.1.0"
5757
PACKAGE_NAME: "lightning"
5858
pool: lit-rtx-3090
5959
variables:
@@ -155,13 +155,13 @@ jobs:
155155
ls -l checkpoints/
156156
displayName: "Get legacy checkpoints"
157157
158-
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest -v --durations=50
159-
workingDirectory: tests/tests_pytorch
158+
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest tests_pytorch/ -v --durations=50
159+
workingDirectory: tests/
160160
displayName: "Testing: PyTorch standard"
161161
timeoutInMinutes: "35"
162162

163-
- bash: bash ../run_standalone_tests.sh "."
164-
workingDirectory: tests/tests_pytorch
163+
- bash: bash ./run_standalone_tests.sh "tests_pytorch"
164+
workingDirectory: tests/
165165
env:
166166
PL_USE_MOCKED_MNIST: "1"
167167
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)

.github/CODEOWNERS

+4-27
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,16 @@
55
# the repo. Unless a later match takes precedence,
66
# @global-owner1 and @global-owner2 will be requested for
77
# review when someone opens a pull request.
8-
* @lantiga @borda @tchaton @awaelchli @justusschock
9-
10-
# CI/CD and configs
11-
/.actions/ @borda @ethanwharris @justusschock
12-
/.github/ @borda @ethanwharris @justusschock
13-
/.azure/ @borda @ethanwharris @justusschock
14-
/dockers/ @borda @ethanwharris @justusschock
15-
*.yml @borda @ethanwharris @justusschock
8+
* @lantiga @borda @tchaton @justusschock @ethanwharris
169

1710
# Docs
18-
/docs/ @lantiga @borda @awaelchli
19-
/docs/*/conf.py @borda @awaelchli
2011
/.github/*.md @williamfalcon @lantiga @borda
21-
/.github/ISSUE_TEMPLATE/ @borda @tchaton @awaelchli
22-
/docs/source-fabric/conf.py @borda @awaelchli
23-
/docs/source-fabric/index.rst @awaelchli @lantiga
24-
/docs/source-pytorch/conf.py @borda @awaelchli
12+
/docs/source-fabric/index.rst @williamfalcon @lantiga
2513
/docs/source-pytorch/index.rst @williamfalcon @lantiga
2614
/docs/source-pytorch/levels @williamfalcon @lantiga
2715

28-
# PyTorch Lightning
29-
/src/lightning/pytorch @lantiga @borda @tchaton @awaelchli @justusschock
30-
31-
# Lightning Data
32-
/src/lightning/data/ @tchaton @lantiga
33-
34-
# Lightning Fabric
35-
/src/lightning/fabric @lantiga @borda @tchaton @awaelchli @justusschock
36-
3716
/.github/CODEOWNERS @williamfalcon
3817
/SECURITY.md @williamfalcon @lantiga
3918
/README.md @williamfalcon @lantiga
40-
/setup.py @williamfalcon @borda
41-
/src/pytorch_lightning/__about__.py @williamfalcon @borda
42-
/src/lightning_fabric/__about__.py @williamfalcon @borda @awaelchli
43-
/src/*/__setup__.py @borda @justusschock
19+
/src/pytorch_lightning/__about__.py @williamfalcon @lantiga @borda
20+
/src/lightning_fabric/__about__.py @williamfalcon @lantiga @borda

.github/checkgroup.yml

+51-42
Original file line numberDiff line numberDiff line change
@@ -19,27 +19,30 @@ subprojects:
1919
- "!*.md"
2020
- "!**/*.md"
2121
checks:
22-
- "pl-cpu (macOS-13, lightning, 3.9, 2.1, oldest)"
22+
- "pl-cpu (macOS-14, lightning, 3.9, 2.1, oldest)"
2323
- "pl-cpu (macOS-14, lightning, 3.10, 2.1)"
24-
- "pl-cpu (macOS-14, lightning, 3.11, 2.2)"
24+
- "pl-cpu (macOS-14, lightning, 3.11, 2.2.2)"
2525
- "pl-cpu (macOS-14, lightning, 3.11, 2.3)"
26-
- "pl-cpu (macOS-14, lightning, 3.12, 2.4)"
26+
- "pl-cpu (macOS-14, lightning, 3.12, 2.4.1)"
27+
- "pl-cpu (macOS-14, lightning, 3.12, 2.5.1)"
2728
- "pl-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
2829
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
29-
- "pl-cpu (ubuntu-20.04, lightning, 3.11, 2.2)"
30+
- "pl-cpu (ubuntu-20.04, lightning, 3.11, 2.2.2)"
3031
- "pl-cpu (ubuntu-20.04, lightning, 3.11, 2.3)"
31-
- "pl-cpu (ubuntu-20.04, lightning, 3.12, 2.4)"
32+
- "pl-cpu (ubuntu-22.04, lightning, 3.12, 2.4.1)"
33+
- "pl-cpu (ubuntu-22.04, lightning, 3.12, 2.5.1)"
3234
- "pl-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
3335
- "pl-cpu (windows-2022, lightning, 3.10, 2.1)"
34-
- "pl-cpu (windows-2022, lightning, 3.11, 2.2)"
36+
- "pl-cpu (windows-2022, lightning, 3.11, 2.2.2)"
3537
- "pl-cpu (windows-2022, lightning, 3.11, 2.3)"
36-
- "pl-cpu (windows-2022, lightning, 3.12, 2.4)"
38+
- "pl-cpu (windows-2022, lightning, 3.12, 2.4.1)"
39+
- "pl-cpu (windows-2022, lightning, 3.12, 2.5.1)"
3740
- "pl-cpu (macOS-14, pytorch, 3.9, 2.1)"
3841
- "pl-cpu (ubuntu-20.04, pytorch, 3.9, 2.1)"
3942
- "pl-cpu (windows-2022, pytorch, 3.9, 2.1)"
40-
- "pl-cpu (macOS-12, pytorch, 3.10, 2.1)"
41-
- "pl-cpu (ubuntu-22.04, pytorch, 3.10, 2.1)"
42-
- "pl-cpu (windows-2022, pytorch, 3.10, 2.1)"
43+
- "pl-cpu (macOS-14, pytorch, 3.12, 2.5.1)"
44+
- "pl-cpu (ubuntu-22.04, pytorch, 3.12, 2.5.1)"
45+
- "pl-cpu (windows-2022, pytorch, 3.12, 2.5.1)"
4346

4447
- id: "pytorch_lightning: Azure GPU"
4548
paths:
@@ -86,14 +89,15 @@ subprojects:
8689
checks:
8790
- "lightning.Benchmarks"
8891

89-
- id: "pytorch-lightning: TPU workflow"
90-
paths:
91-
# tpu CI availability is very limited, so we only require tpu tests
92-
# to pass when their configurations are modified
93-
- ".github/workflows/tpu-tests.yml"
94-
- "tests/tests_pytorch/run_tpu_tests.sh"
95-
checks:
96-
- "test-on-tpus (pytorch, pjrt, v4-8)"
92+
# Temporarily disabled
93+
# - id: "pytorch-lightning: TPU workflow"
94+
# paths:
95+
# # tpu CI availability is very limited, so we only require tpu tests
96+
# # to pass when their configurations are modified
97+
# - ".github/workflows/tpu-tests.yml"
98+
# - "tests/tests_pytorch/run_tpu_tests.sh"
99+
# checks:
100+
# - "test-on-tpus (pytorch, pjrt, v4-8)"
97101

98102
- id: "fabric: Docs"
99103
paths:
@@ -141,15 +145,17 @@ subprojects:
141145
- "!*.md"
142146
- "!**/*.md"
143147
checks:
144-
- "build-cuda (3.11, 2.1, 12.1.0)"
145-
- "build-cuda (3.11, 2.2, 12.1.0)"
146-
- "build-cuda (3.11, 2.3, 12.1.0)"
147-
- "build-cuda (3.12, 2.4, 12.1.0)"
148+
- "build-cuda (3.10, 2.1.2, 12.1.0)"
149+
- "build-cuda (3.11, 2.2.2, 12.1.0)"
150+
- "build-cuda (3.11, 2.3.1, 12.1.0)"
151+
- "build-cuda (3.11, 2.4.1, 12.1.0)"
152+
- "build-cuda (3.12, 2.5.1, 12.1.0)"
148153
#- "build-NGC"
149-
- "build-pl (3.11, 2.1, 12.1.0)"
154+
- "build-pl (3.10, 2.1, 12.1.0)"
150155
- "build-pl (3.11, 2.2, 12.1.0)"
151156
- "build-pl (3.11, 2.3, 12.1.0)"
152-
- "build-pl (3.12, 2.4, 12.1.0)"
157+
- "build-pl (3.11, 2.4, 12.1.0)"
158+
- "build-pl (3.12, 2.5, 12.1.0)"
153159

154160
# SECTION: lightning_fabric
155161

@@ -166,27 +172,30 @@ subprojects:
166172
- "!*.md"
167173
- "!**/*.md"
168174
checks:
169-
- "fabric-cpu (macOS-13, lightning, 3.9, 2.1, oldest)"
175+
- "fabric-cpu (macOS-14, lightning, 3.9, 2.1, oldest)"
170176
- "fabric-cpu (macOS-14, lightning, 3.10, 2.1)"
171-
- "fabric-cpu (macOS-14, lightning, 3.11, 2.2)"
177+
- "fabric-cpu (macOS-14, lightning, 3.11, 2.2.2)"
172178
- "fabric-cpu (macOS-14, lightning, 3.11, 2.3)"
173-
- "fabric-cpu (macOS-14, lightning, 3.12, 2.4)"
179+
- "fabric-cpu (macOS-14, lightning, 3.12, 2.4.1)"
180+
- "fabric-cpu (macOS-14, lightning, 3.12, 2.5.1)"
174181
- "fabric-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
175182
- "fabric-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
176-
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2)"
183+
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2.2)"
177184
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.3)"
178-
- "fabric-cpu (ubuntu-20.04, lightning, 3.12, 2.4)"
185+
- "fabric-cpu (ubuntu-22.04, lightning, 3.12, 2.4.1)"
186+
- "fabric-cpu (ubuntu-22.04, lightning, 3.12, 2.5.1)"
179187
- "fabric-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
180188
- "fabric-cpu (windows-2022, lightning, 3.10, 2.1)"
181-
- "fabric-cpu (windows-2022, lightning, 3.11, 2.2)"
189+
- "fabric-cpu (windows-2022, lightning, 3.11, 2.2.2)"
182190
- "fabric-cpu (windows-2022, lightning, 3.11, 2.3)"
183-
- "fabric-cpu (windows-2022, lightning, 3.12, 2.4)"
191+
- "fabric-cpu (windows-2022, lightning, 3.12, 2.4.1)"
192+
- "fabric-cpu (windows-2022, lightning, 3.12, 2.5.1)"
184193
- "fabric-cpu (macOS-14, fabric, 3.9, 2.1)"
185194
- "fabric-cpu (ubuntu-20.04, fabric, 3.9, 2.1)"
186195
- "fabric-cpu (windows-2022, fabric, 3.9, 2.1)"
187-
- "fabric-cpu (macOS-12, fabric, 3.10, 2.1)"
188-
- "fabric-cpu (ubuntu-22.04, fabric, 3.10, 2.1)"
189-
- "fabric-cpu (windows-2022, fabric, 3.10, 2.1)"
196+
- "fabric-cpu (macOS-14, fabric, 3.12, 2.5.1)"
197+
- "fabric-cpu (ubuntu-22.04, fabric, 3.12, 2.5.1)"
198+
- "fabric-cpu (windows-2022, fabric, 3.12, 2.5.1)"
190199

191200
- id: "lightning_fabric: Azure GPU"
192201
paths:
@@ -258,14 +267,14 @@ subprojects:
258267
- "install-pkg (ubuntu-22.04, lightning, 3.11)"
259268
- "install-pkg (ubuntu-22.04, notset, 3.9)"
260269
- "install-pkg (ubuntu-22.04, notset, 3.11)"
261-
- "install-pkg (macOS-12, fabric, 3.9)"
262-
- "install-pkg (macOS-12, fabric, 3.11)"
263-
- "install-pkg (macOS-12, pytorch, 3.9)"
264-
- "install-pkg (macOS-12, pytorch, 3.11)"
265-
- "install-pkg (macOS-12, lightning, 3.9)"
266-
- "install-pkg (macOS-12, lightning, 3.11)"
267-
- "install-pkg (macOS-12, notset, 3.9)"
268-
- "install-pkg (macOS-12, notset, 3.11)"
270+
- "install-pkg (macOS-14, fabric, 3.9)"
271+
- "install-pkg (macOS-14, fabric, 3.11)"
272+
- "install-pkg (macOS-14, pytorch, 3.9)"
273+
- "install-pkg (macOS-14, pytorch, 3.11)"
274+
- "install-pkg (macOS-14, lightning, 3.9)"
275+
- "install-pkg (macOS-14, lightning, 3.11)"
276+
- "install-pkg (macOS-14, notset, 3.9)"
277+
- "install-pkg (macOS-14, notset, 3.11)"
269278
- "install-pkg (windows-2022, fabric, 3.9)"
270279
- "install-pkg (windows-2022, fabric, 3.11)"
271280
- "install-pkg (windows-2022, pytorch, 3.9)"

.github/workflows/_legacy-checkpoints.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/setup-python@v5
6161
with:
6262
# Python version here needs to be supported by all PL versions listed in back-compatible-versions.txt.
63-
python-version: 3.8
63+
python-version: "3.9"
6464

6565
- name: Install PL from source
6666
env:

.github/workflows/call-clear-cache.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ on:
2323
jobs:
2424
cron-clear:
2525
if: github.event_name == 'schedule' || github.event_name == 'pull_request'
26-
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.7
26+
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.9
2727
with:
28-
scripts-ref: v0.11.7
28+
scripts-ref: v0.11.8
2929
dry-run: ${{ github.event_name == 'pull_request' }}
3030
pattern: "latest|docs"
3131
age-days: 7
3232

3333
direct-clear:
3434
if: github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
35-
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.7
35+
uses: Lightning-AI/utilities/.github/workflows/cleanup-caches.yml@v0.11.9
3636
with:
37-
scripts-ref: v0.11.7
37+
scripts-ref: v0.11.8
3838
dry-run: ${{ github.event_name == 'pull_request' }}
3939
pattern: ${{ inputs.pattern || 'pypi_wheels' }} # setting str in case of PR / debugging
4040
age-days: ${{ fromJSON(inputs.age-days) || 0 }} # setting 0 in case of PR / debugging

.github/workflows/ci-check-md-links.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
check-md-links:
17-
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.11.7
17+
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.11.9
1818
with:
1919
config-file: ".github/markdown-links-config.json"
2020
base-branch: "master"

.github/workflows/ci-pkg-install.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
strategy:
4343
fail-fast: false
4444
matrix:
45-
os: ["ubuntu-22.04", "macOS-12", "windows-2022"]
45+
os: ["ubuntu-22.04", "macOS-14", "windows-2022"]
4646
pkg-name: ["fabric", "pytorch", "lightning", "notset"]
4747
python-version: ["3.9", "3.11"]
4848
steps:

.github/workflows/ci-schema.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
check:
11-
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.11.7
11+
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.11.9
1212
with:
1313
# skip azure due to the wrong schema file by MSFT
1414
# https://github.com/Lightning-AI/lightning-flash/pull/1455#issuecomment-1244793607

0 commit comments

Comments
 (0)