Skip to content

Commit 344822b

Browse files
authored
Merge branch 'master' into chualan/fix-19658
2 parents c20c173 + 03635d2 commit 344822b

File tree

383 files changed

+2195
-1485
lines changed

Some content is hidden

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

383 files changed

+2195
-1485
lines changed

.actions/assistant.py

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -481,23 +481,27 @@ def convert_version2nightly(ver_file: str = "src/version.info") -> None:
481481
with open(ver_file, "w") as fo:
482482
fo.write(version + os.linesep)
483483

484+
@staticmethod
485+
def generate_docker_tags(
486+
release_version: str,
487+
python_version: str,
488+
torch_version: str,
489+
cuda_version: str,
490+
docker_project: str = "pytorchlightning/pytorch_lightning",
491+
add_latest: bool = False,
492+
) -> None:
493+
"""Generate docker tags for the given versions."""
494+
tags = [f"latest-py{python_version}-torch{torch_version}-cuda{cuda_version}"]
495+
if release_version:
496+
tags += [f"{release_version}-py{python_version}-torch{torch_version}-cuda{cuda_version}"]
497+
if add_latest:
498+
tags += ["latest"]
484499

485-
if __name__ == "__main__":
486-
import sys
487-
488-
import jsonargparse
489-
from jsonargparse import ArgumentParser
490-
491-
def patch_jsonargparse_python_3_12_8():
492-
if sys.version_info < (3, 12, 8):
493-
return
494-
495-
def _parse_known_args_patch(self: ArgumentParser, args: Any = None, namespace: Any = None) -> tuple[Any, Any]:
496-
namespace, args = super(ArgumentParser, self)._parse_known_args(args, namespace, intermixed=False) # type: ignore
497-
return namespace, args
500+
tags = [f"{docker_project}:{tag}" for tag in tags]
501+
print(",".join(tags))
498502

499-
setattr(ArgumentParser, "_parse_known_args", _parse_known_args_patch)
500503

501-
patch_jsonargparse_python_3_12_8() # Required until fix https://github.com/omni-us/jsonargparse/issues/641
504+
if __name__ == "__main__":
505+
import jsonargparse
502506

503507
jsonargparse.CLI(AssistantCLI, as_positional=False)

.actions/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
jsonargparse >=4.16.0, <4.28.0
1+
jsonargparse >=4.16.0, <=4.35.0
22
requests
33
packaging

.azure/gpu-benchmarks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
7878
- bash: |
7979
pip install -e .[dev] --find-links ${TORCH_URL}
80-
pip install setuptools==75.6.0
80+
pip install setuptools==75.6.0 jsonargparse==4.35.0
8181
env:
8282
FREEZE_REQUIREMENTS: "1"
8383
displayName: "Install package"
@@ -108,5 +108,6 @@ jobs:
108108
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
109109
env:
110110
PL_RUN_CUDA_TESTS: "1"
111+
PL_RUN_STANDALONE_TESTS: "1"
111112
displayName: "Testing: fabric standalone tasks"
112113
timeoutInMinutes: "10"

.azure/gpu-tests-fabric.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,17 @@ jobs:
5656
options: "--gpus=all --shm-size=2gb -v /var/tmp:/var/tmp"
5757
strategy:
5858
matrix:
59+
"Fabric | oldest":
60+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.1"
61+
PACKAGE_NAME: "fabric"
5962
"Fabric | latest":
60-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.3-cuda12.1.0"
63+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.6-cuda12.4.1"
64+
PACKAGE_NAME: "fabric"
65+
"Fabric | future":
66+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
6167
PACKAGE_NAME: "fabric"
6268
"Lightning | latest":
63-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.5-cuda12.1.0"
69+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.6-cuda12.4.1"
6470
PACKAGE_NAME: "lightning"
6571
workspace:
6672
clean: all
@@ -77,9 +83,8 @@ jobs:
7783
displayName: "set env. vars"
7884
- bash: |
7985
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}"
80-
echo "##vso[task.setvariable variable=TORCHVISION_URL]https://download.pytorch.org/whl/test/cu124/torchvision-0.19.0%2Bcu124-cp${PYTHON_VERSION_MM}-cp${PYTHON_VERSION_MM}-linux_x86_64.whl"
8186
condition: endsWith(variables['Agent.JobName'], 'future')
82-
displayName: "set env. vars 4 future"
87+
displayName: "extend env. vars 4 future"
8388
8489
- bash: |
8590
echo $(DEVICES)
@@ -105,15 +110,17 @@ jobs:
105110
displayName: "Adjust dependencies"
106111
107112
- bash: |
113+
set -e
108114
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
109-
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
110-
pip install setuptools==75.6.0
115+
pip install -e ".[${extra}dev]" pytest-timeout -U --extra-index-url="${TORCH_URL}"
116+
pip install setuptools==75.6.0 jsonargparse==4.35.0
111117
displayName: "Install package & dependencies"
112118
113119
- bash: |
114120
set -e
115121
python requirements/collect_env_details.py
116122
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
123+
python requirements/pytorch/check-avail-extras.py
117124
python -c "import bitsandbytes"
118125
displayName: "Env details"
119126
@@ -140,10 +147,12 @@ jobs:
140147
displayName: "Testing: fabric standard"
141148
timeoutInMinutes: "10"
142149

143-
- bash: bash ./run_standalone_tests.sh "tests_fabric"
150+
- bash: |
151+
wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/run_standalone_tests.sh
152+
bash ./run_standalone_tests.sh "tests_fabric"
144153
workingDirectory: tests/
145154
env:
146-
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
155+
PL_RUN_STANDALONE_TESTS: "1"
147156
displayName: "Testing: fabric standalone"
148157
timeoutInMinutes: "10"
149158

.azure/gpu-tests-pytorch.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,17 @@ jobs:
4949
cancelTimeoutInMinutes: "2"
5050
strategy:
5151
matrix:
52+
"PyTorch | oldest":
53+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.1"
54+
PACKAGE_NAME: "pytorch"
5255
"PyTorch | latest":
53-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.11-torch2.3-cuda12.1.0"
56+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.6-cuda12.4.1"
57+
PACKAGE_NAME: "pytorch"
58+
"PyTorch | future":
59+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.7-cuda12.6.3"
5460
PACKAGE_NAME: "pytorch"
5561
"Lightning | latest":
56-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.5-cuda12.1.0"
62+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.12-torch2.6-cuda12.4.1"
5763
PACKAGE_NAME: "lightning"
5864
pool: lit-rtx-3090
5965
variables:
@@ -81,9 +87,8 @@ jobs:
8187
displayName: "set env. vars"
8288
- bash: |
8389
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}"
84-
echo "##vso[task.setvariable variable=TORCHVISION_URL]https://download.pytorch.org/whl/test/cu124/torchvision-0.19.0%2Bcu124-cp${PYTHON_VERSION_MM}-cp${PYTHON_VERSION_MM}-linux_x86_64.whl"
8590
condition: endsWith(variables['Agent.JobName'], 'future')
86-
displayName: "set env. vars 4 future"
91+
displayName: "extend env. vars 4 future"
8792
8893
- bash: |
8994
echo $(DEVICES)
@@ -109,9 +114,10 @@ jobs:
109114
displayName: "Adjust dependencies"
110115
111116
- bash: |
117+
set -e
112118
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
113-
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
114-
pip install setuptools==75.6.0
119+
pip install -e ".[${extra}dev]" pytest-timeout -U --extra-index-url="${TORCH_URL}"
120+
pip install setuptools==75.6.0 jsonargparse==4.35.0
115121
displayName: "Install package & dependencies"
116122
117123
- bash: pip uninstall -y lightning
@@ -161,11 +167,13 @@ jobs:
161167
displayName: "Testing: PyTorch standard"
162168
timeoutInMinutes: "35"
163169

164-
- bash: bash ./run_standalone_tests.sh "tests_pytorch"
170+
- bash: |
171+
wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/run_standalone_tests.sh
172+
bash ./run_standalone_tests.sh "tests_pytorch"
165173
workingDirectory: tests/
166174
env:
167175
PL_USE_MOCKED_MNIST: "1"
168-
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
176+
PL_RUN_STANDALONE_TESTS: "1"
169177
displayName: "Testing: PyTorch standalone tests"
170178
timeoutInMinutes: "35"
171179

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,14 @@ We welcome any useful contribution! For your convenience here's a recommended wo
182182
1. Use tags in PR name for the following cases:
183183

184184
- **\[blocked by #<number>\]** if your work is dependent on other PRs.
185-
- **\[wip\]** when you start to re-edit your work, mark it so no one will accidentally merge it in meantime.
185+
- **[wip]** when you start to re-edit your work, mark it so no one will accidentally merge it in meantime.
186186

187187
### Question & Answer
188188

189189
#### How can I help/contribute?
190190

191191
All types of contributions are welcome - reporting bugs, fixing documentation, adding test cases, solving issues, and preparing bug fixes.
192-
To get started with code contributions, look for issues marked with the label [good first issue](https://github.com/Lightning-AI/lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or chose something close to your domain with the label [help wanted](https://github.com/Lightning-AI/lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). Before coding, make sure that the issue description is clear and comment on the issue so that we can assign it to you (or simply self-assign if you can).
192+
To get started with code contributions, look for issues marked with the label [good first issue](https://github.com/Lightning-AI/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) or chose something close to your domain with the label [help wanted](https://github.com/Lightning-AI/pytorch-lightning/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22). Before coding, make sure that the issue description is clear and comment on the issue so that we can assign it to you (or simply self-assign if you can).
193193

194194
#### Is there a recommendation for branch names?
195195

.github/ISSUE_TEMPLATE/1_bug_report.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- "v2.2"
3838
- "v2.3"
3939
- "v2.4"
40+
- "v2.5"
4041
- "master"
4142
validations:
4243
required: true
@@ -91,8 +92,8 @@ body:
9192
<summary>Current environment</summary>
9293
9394
```
94-
#- PyTorch Lightning Version (e.g., 2.4.0):
95-
#- PyTorch Version (e.g., 2.4):
95+
#- PyTorch Lightning Version (e.g., 2.5.0):
96+
#- PyTorch Version (e.g., 2.5):
9697
#- Python version (e.g., 3.12):
9798
#- OS (e.g., Linux):
9899
#- CUDA/cuDNN version:

.github/actions/pip-wheels/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ runs:
4646
run: |
4747
# cat requirements.dump
4848
pip wheel -r requirements.dump --prefer-binary \
49-
--wheel-dir=.wheels \
50-
-f ${{ inputs.torch-url }} -f ${{ inputs.wheel-dir }}
49+
--wheel-dir=".wheels" \
50+
--extra-index-url=${{ inputs.torch-url }} -f ${{ inputs.wheel-dir }}
5151
ls -lh .wheels/
5252
shell: bash
5353

.github/advanced-issue-labeler.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ policy:
1616
keys: ["v2_3", "v2.3", "2.3.x"]
1717
- name: "ver: 2.4.x"
1818
keys: ["v2_4", "v2.4", "2.4.x"]
19-
- name: "ver: 2.4.x"
19+
- name: "ver: 2.5.x"
20+
keys: ["v2_5", "v2.5", "2.5.x"]
21+
- name: "ver: 2.5.x"
2022
keys: ["master"]

.github/checkgroup.yml

Lines changed: 15 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,7 @@ subprojects:
1919
- "!*.md"
2020
- "!**/*.md"
2121
checks:
22-
- "pl-cpu (macOS-14, lightning, 3.9, 2.1, oldest)"
23-
- "pl-cpu (macOS-14, lightning, 3.10, 2.1)"
24-
- "pl-cpu (macOS-14, lightning, 3.11, 2.2.2)"
25-
- "pl-cpu (macOS-14, lightning, 3.11, 2.3)"
26-
- "pl-cpu (macOS-14, lightning, 3.12, 2.4.1)"
27-
- "pl-cpu (macOS-14, lightning, 3.12, 2.5.1)"
28-
- "pl-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
29-
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
30-
- "pl-cpu (ubuntu-20.04, lightning, 3.11, 2.2.2)"
31-
- "pl-cpu (ubuntu-20.04, lightning, 3.11, 2.3)"
32-
- "pl-cpu (ubuntu-22.04, lightning, 3.12, 2.4.1)"
33-
- "pl-cpu (ubuntu-22.04, lightning, 3.12, 2.5.1)"
34-
- "pl-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
35-
- "pl-cpu (windows-2022, lightning, 3.10, 2.1)"
36-
- "pl-cpu (windows-2022, lightning, 3.11, 2.2.2)"
37-
- "pl-cpu (windows-2022, lightning, 3.11, 2.3)"
38-
- "pl-cpu (windows-2022, lightning, 3.12, 2.4.1)"
39-
- "pl-cpu (windows-2022, lightning, 3.12, 2.5.1)"
40-
- "pl-cpu (macOS-14, pytorch, 3.9, 2.1)"
41-
- "pl-cpu (ubuntu-20.04, pytorch, 3.9, 2.1)"
42-
- "pl-cpu (windows-2022, pytorch, 3.9, 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)"
22+
- "pl-cpu-guardian" # aggregated check for all cases
4623

4724
- id: "pytorch_lightning: Azure GPU"
4825
paths:
@@ -145,17 +122,19 @@ subprojects:
145122
- "!*.md"
146123
- "!**/*.md"
147124
checks:
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)"
125+
- "build-cuda (3.10, 2.1.2, 12.1.1)"
126+
- "build-cuda (3.11, 2.2.2, 12.1.1)"
127+
- "build-cuda (3.11, 2.3.1, 12.1.1)"
128+
- "build-cuda (3.11, 2.4.1, 12.1.1)"
129+
- "build-cuda (3.12, 2.5.1, 12.1.1)"
130+
- "build-cuda (3.12, 2.6.0, 12.4.1)"
153131
#- "build-NGC"
154-
- "build-pl (3.10, 2.1, 12.1.0)"
155-
- "build-pl (3.11, 2.2, 12.1.0)"
156-
- "build-pl (3.11, 2.3, 12.1.0)"
157-
- "build-pl (3.11, 2.4, 12.1.0)"
158-
- "build-pl (3.12, 2.5, 12.1.0)"
132+
- "build-pl (3.10, 2.1, 12.1.1)"
133+
- "build-pl (3.11, 2.2, 12.1.1)"
134+
- "build-pl (3.11, 2.3, 12.1.1)"
135+
- "build-pl (3.11, 2.4, 12.1.1)"
136+
- "build-pl (3.12, 2.5, 12.1.1)"
137+
- "build-pl (3.12, 2.6, 12.4.1, true)"
159138

160139
# SECTION: lightning_fabric
161140

@@ -172,30 +151,7 @@ subprojects:
172151
- "!*.md"
173152
- "!**/*.md"
174153
checks:
175-
- "fabric-cpu (macOS-14, lightning, 3.9, 2.1, oldest)"
176-
- "fabric-cpu (macOS-14, lightning, 3.10, 2.1)"
177-
- "fabric-cpu (macOS-14, lightning, 3.11, 2.2.2)"
178-
- "fabric-cpu (macOS-14, lightning, 3.11, 2.3)"
179-
- "fabric-cpu (macOS-14, lightning, 3.12, 2.4.1)"
180-
- "fabric-cpu (macOS-14, lightning, 3.12, 2.5.1)"
181-
- "fabric-cpu (ubuntu-20.04, lightning, 3.9, 2.1, oldest)"
182-
- "fabric-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
183-
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2.2)"
184-
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.3)"
185-
- "fabric-cpu (ubuntu-22.04, lightning, 3.12, 2.4.1)"
186-
- "fabric-cpu (ubuntu-22.04, lightning, 3.12, 2.5.1)"
187-
- "fabric-cpu (windows-2022, lightning, 3.9, 2.1, oldest)"
188-
- "fabric-cpu (windows-2022, lightning, 3.10, 2.1)"
189-
- "fabric-cpu (windows-2022, lightning, 3.11, 2.2.2)"
190-
- "fabric-cpu (windows-2022, lightning, 3.11, 2.3)"
191-
- "fabric-cpu (windows-2022, lightning, 3.12, 2.4.1)"
192-
- "fabric-cpu (windows-2022, lightning, 3.12, 2.5.1)"
193-
- "fabric-cpu (macOS-14, fabric, 3.9, 2.1)"
194-
- "fabric-cpu (ubuntu-20.04, fabric, 3.9, 2.1)"
195-
- "fabric-cpu (windows-2022, fabric, 3.9, 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)"
154+
- "fabric-cpu-guardian" # aggregated check for all cases
199155

200156
- id: "lightning_fabric: Azure GPU"
201157
paths:
@@ -259,27 +215,4 @@ subprojects:
259215
- "!*.md"
260216
- "!**/*.md"
261217
checks:
262-
- "install-pkg (ubuntu-22.04, fabric, 3.9)"
263-
- "install-pkg (ubuntu-22.04, fabric, 3.11)"
264-
- "install-pkg (ubuntu-22.04, pytorch, 3.9)"
265-
- "install-pkg (ubuntu-22.04, pytorch, 3.11)"
266-
- "install-pkg (ubuntu-22.04, lightning, 3.9)"
267-
- "install-pkg (ubuntu-22.04, lightning, 3.11)"
268-
- "install-pkg (ubuntu-22.04, notset, 3.9)"
269-
- "install-pkg (ubuntu-22.04, 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)"
278-
- "install-pkg (windows-2022, fabric, 3.9)"
279-
- "install-pkg (windows-2022, fabric, 3.11)"
280-
- "install-pkg (windows-2022, pytorch, 3.9)"
281-
- "install-pkg (windows-2022, pytorch, 3.11)"
282-
- "install-pkg (windows-2022, lightning, 3.9)"
283-
- "install-pkg (windows-2022, lightning, 3.11)"
284-
- "install-pkg (windows-2022, notset, 3.9)"
285-
- "install-pkg (windows-2022, notset, 3.11)"
218+
- "install-pkg-guardian" # aggregated check for all cases

0 commit comments

Comments
 (0)