Skip to content

Commit f10b897

Browse files
committed
Merge branch 'master' into milesial/master
2 parents b900ded + 6497e36 commit f10b897

File tree

613 files changed

+12735
-5255
lines changed

Some content is hidden

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

613 files changed

+12735
-5255
lines changed

.actions/assistant.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def _download_frontend(pkg_path: str, version: str = "v0.0.0"):
234234
response = urllib.request.urlopen(frontend_release_url)
235235

236236
file = tarfile.open(fileobj=response, mode="r|gz")
237-
file.extractall(path=download_dir)
237+
file.extractall(path=download_dir) # noqa: S202
238238

239239
shutil.move(download_dir, frontend_dir)
240240
print("The Lightning UI has successfully been downloaded!")
@@ -442,9 +442,20 @@ def pull_docs_files(
442442
target_dir: str = "docs/source-pytorch/XXX",
443443
checkout: str = "refs/tags/1.0.0",
444444
source_dir: str = "docs/source",
445+
single_page: Optional[str] = None,
445446
as_orphan: bool = False,
446447
) -> None:
447-
"""Pull docs pages from external source and append to local docs."""
448+
"""Pull docs pages from external source and append to local docs.
449+
450+
Args:
451+
gh_user_repo: standard GitHub user/repo string
452+
target_dir: relative location inside the docs folder
453+
checkout: specific tag or branch to checkout
454+
source_dir: relative location inside the remote / external repo
455+
single_page: copy only single page from the remote repo and name it as the repo name
456+
as_orphan: append orphan statement to the page
457+
458+
"""
448459
import zipfile
449460

450461
zip_url = f"https://github.com/{gh_user_repo}/archive/{checkout}.zip"
@@ -457,13 +468,21 @@ def pull_docs_files(
457468
raise RuntimeError(f"Requesting file '{zip_url}' does not exist or it is just unavailable.")
458469

459470
with zipfile.ZipFile(zip_file, "r") as zip_ref:
460-
zip_ref.extractall(tmp)
471+
zip_ref.extractall(tmp) # noqa: S202
461472

462473
zip_dirs = [d for d in glob.glob(os.path.join(tmp, "*")) if os.path.isdir(d)]
463474
# check that the extracted archive has only repo folder
464475
assert len(zip_dirs) == 1
465476
repo_dir = zip_dirs[0]
466477

478+
if single_page: # special case for copying single page
479+
single_page = os.path.join(repo_dir, source_dir, single_page)
480+
assert os.path.isfile(single_page), f"File '{single_page}' does not exist."
481+
name = re.sub(r"lightning[-_]?", "", gh_user_repo.split("/")[-1])
482+
new_rst = os.path.join(_PROJECT_ROOT, target_dir, f"{name}.rst")
483+
AssistantCLI._copy_rst(single_page, new_rst, as_orphan=as_orphan)
484+
return
485+
# continue with copying all pages
467486
ls_pages = glob.glob(os.path.join(repo_dir, source_dir, "*.rst"))
468487
ls_pages += glob.glob(os.path.join(repo_dir, source_dir, "**", "*.rst"))
469488
for rst in ls_pages:

.actions/requirements.txt

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

.azure/gpu-benchmarks.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
variables:
4747
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
4848
container:
49-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.0-cuda11.8.0"
49+
# TODO: Upgrade to Python 3.11
50+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
5051
options: "--gpus=all --shm-size=32g"
5152
strategy:
5253
matrix:

.azure/gpu-tests-fabric.yml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ pr:
2323
- ".azure/gpu-tests-fabric.yml"
2424
- "examples/fabric/**"
2525
- "examples/run_fabric_examples.sh"
26-
- "tests/tests_fabric/run_standalone_*.sh"
27-
- "tests/tests_pytorch/run_standalone_tests.sh" # used by fabric through a symlink
26+
- "tests/run_standalone_*.sh"
2827
- "requirements/fabric/**"
2928
- "src/lightning/__init__.py"
3029
- "src/lightning/__setup__.py"
@@ -49,18 +48,20 @@ jobs:
4948
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
5049
FREEZE_REQUIREMENTS: "1"
5150
PIP_CACHE_DIR: "/var/tmp/pip"
51+
PL_RUN_CUDA_TESTS: "1"
5252
container:
5353
image: $(image)
5454
# default shm size is 64m. Increase it to avoid:
5555
# 'Error while creating shared memory: unhandled system error, NCCL version 2.7.8'
5656
options: "--gpus=all --shm-size=2gb -v /var/tmp:/var/tmp"
5757
strategy:
5858
matrix:
59+
# TODO: Upgrade to Python 3.11
5960
"Fabric | latest":
60-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
61+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
6162
PACKAGE_NAME: "fabric"
6263
"Lightning | latest":
63-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
64+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
6465
PACKAGE_NAME: "lightning"
6566
workspace:
6667
clean: all
@@ -73,6 +74,10 @@ jobs:
7374
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(fabric="lightning_fabric").get(n, n))')
7475
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
7576
displayName: "set env. vars"
77+
- bash: |
78+
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}/torch_test.html"
79+
condition: endsWith(variables['Agent.JobName'], 'future')
80+
displayName: "set env. vars 4 future"
7681
7782
- bash: |
7883
echo $(DEVICES)
@@ -99,13 +104,14 @@ jobs:
99104
100105
- bash: |
101106
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
102-
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links ${TORCH_URL}
107+
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}"
103108
displayName: "Install package & dependencies"
104109
105110
- bash: |
106111
set -e
107112
python requirements/collect_env_details.py
108113
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
114+
python -c "import bitsandbytes"
109115
displayName: "Env details"
110116
111117
- bash: python -m pytest lightning_fabric
@@ -126,19 +132,16 @@ jobs:
126132
condition: and(succeeded(), eq(variables['PACKAGE_NAME'], 'fabric'))
127133
displayName: "Adjust tests & examples"
128134
129-
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest -v --durations=50
130-
workingDirectory: tests/tests_fabric
131-
env:
132-
PL_RUN_CUDA_TESTS: "1"
135+
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest . -v --durations=50
136+
workingDirectory: tests/tests_fabric/
133137
displayName: "Testing: fabric standard"
134138
timeoutInMinutes: "10"
135139

136-
- bash: bash run_standalone_tests.sh
137-
workingDirectory: tests/tests_fabric
140+
- bash: bash ../run_standalone_tests.sh "."
141+
workingDirectory: tests/tests_fabric/
138142
env:
139-
PL_RUN_CUDA_TESTS: "1"
140143
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
141-
displayName: "Testing: fabric standalone tests"
144+
displayName: "Testing: fabric standalone"
142145
timeoutInMinutes: "10"
143146

144147
- bash: |
@@ -152,12 +155,12 @@ jobs:
152155
./codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) \
153156
--flags=gpu,pytest,${COVERAGE_SOURCE} --name="GPU-coverage" --env=linux,azure
154157
ls -l
155-
workingDirectory: tests/tests_fabric
158+
workingDirectory: tests/tests_fabric/
156159
displayName: "Statistics"
157160
158161
- script: |
159162
set -e
160163
bash run_fabric_examples.sh --accelerator=cuda --devices=1
161164
bash run_fabric_examples.sh --accelerator=cuda --devices=2 --strategy ddp
162-
workingDirectory: examples
165+
workingDirectory: examples/
163166
displayName: "Testing: fabric examples"

.azure/gpu-tests-pytorch.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,19 @@ jobs:
4848
cancelTimeoutInMinutes: "2"
4949
strategy:
5050
matrix:
51+
# TODO: Upgrade to Python 3.11
5152
"PyTorch | latest":
52-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
53+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
5354
PACKAGE_NAME: "pytorch"
5455
"Lightning | latest":
55-
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.1-cuda12.1.0"
56+
image: "pytorchlightning/pytorch_lightning:base-cuda-py3.10-torch2.2-cuda12.1.0"
5657
PACKAGE_NAME: "lightning"
5758
pool: lit-rtx-3090
5859
variables:
5960
DEVICES: $( python -c 'print("$(Agent.Name)".split("_")[-1])' )
6061
FREEZE_REQUIREMENTS: "1"
6162
PIP_CACHE_DIR: "/var/tmp/pip"
63+
PL_RUN_CUDA_TESTS: "1"
6264
container:
6365
image: $(image)
6466
# default shm size is 64m. Increase it to avoid:
@@ -75,6 +77,10 @@ jobs:
7577
scope=$(python -c 'n = "$(PACKAGE_NAME)" ; print(dict(pytorch="pytorch_lightning").get(n, n))')
7678
echo "##vso[task.setvariable variable=COVERAGE_SOURCE]$scope"
7779
displayName: "set env. vars"
80+
- bash: |
81+
echo "##vso[task.setvariable variable=TORCH_URL]https://download.pytorch.org/whl/test/cu${CUDA_VERSION_MM}/torch_test.html"
82+
condition: endsWith(variables['Agent.JobName'], 'future')
83+
displayName: "set env. vars 4 future"
7884
7985
- bash: |
8086
echo $(DEVICES)
@@ -102,13 +108,13 @@ jobs:
102108
- bash: |
103109
pip install -q -r .actions/requirements.txt
104110
python .actions/assistant.py requirements_prune_pkgs \
105-
--packages="[lightning-colossalai,lightning-bagua]" \
111+
--packages="[lightning-colossalai]" \
106112
--req_files="[requirements/_integrations/strategies.txt]"
107113
displayName: "Prune packages" # these have installation issues
108114
109115
- bash: |
110116
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
111-
pip install -e ".[${extra}dev]" -r requirements/_integrations/strategies.txt pytest-timeout -U --find-links ${TORCH_URL}
117+
pip install -e ".[${extra}dev]" -r requirements/_integrations/strategies.txt pytest-timeout -U --find-links="${TORCH_URL}"
112118
displayName: "Install package & dependencies"
113119
114120
- bash: pip uninstall -y lightning
@@ -126,6 +132,7 @@ jobs:
126132
python requirements/collect_env_details.py
127133
python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'"
128134
python requirements/pytorch/check-avail-extras.py
135+
python -c "import bitsandbytes"
129136
displayName: "Env details"
130137
131138
- bash: python -m pytest pytorch_lightning
@@ -154,16 +161,13 @@ jobs:
154161
155162
- bash: python -m coverage run --source ${COVERAGE_SOURCE} -m pytest -v --durations=50
156163
workingDirectory: tests/tests_pytorch
157-
env:
158-
PL_RUN_CUDA_TESTS: "1"
159164
displayName: "Testing: PyTorch standard"
160165
timeoutInMinutes: "35"
161166

162-
- bash: bash run_standalone_tests.sh
167+
- bash: bash ../run_standalone_tests.sh "."
163168
workingDirectory: tests/tests_pytorch
164169
env:
165170
PL_USE_MOCKED_MNIST: "1"
166-
PL_RUN_CUDA_TESTS: "1"
167171
PL_STANDALONE_TESTS_SOURCE: $(COVERAGE_SOURCE)
168172
displayName: "Testing: PyTorch standalone tests"
169173
timeoutInMinutes: "35"
@@ -172,7 +176,6 @@ jobs:
172176
workingDirectory: tests/tests_pytorch
173177
env:
174178
PL_USE_MOCKED_MNIST: "1"
175-
PL_RUN_CUDA_TESTS: "1"
176179
displayName: "Testing: PyTorch standalone tasks"
177180
timeoutInMinutes: "10"
178181

.github/ISSUE_TEMPLATE/1_bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ body:
3636
- "v1.9"
3737
- "v2.0"
3838
- "v2.1"
39+
- "v2.2"
3940
- "master"
4041
validations:
4142
required: true

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ runs:
1919
using: "composite"
2020
steps:
2121
- name: install dev. env
22-
run: pip install setuptools wheel
22+
run: pip install -r requirements/ci.txt
2323
shell: bash
2424

2525
- name: Freeze local emv.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ runs:
1414
using: "composite"
1515
steps:
1616
- name: install dev. env
17-
run: pip install "twine==4.0.1" setuptools wheel flake8
17+
run: pip install -r requirements/ci.txt
1818
shell: bash
1919

2020
- name: Set PACKAGE_NAME envvar

.github/checkgroup.yml

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@ subprojects:
1919
- "!*.md"
2020
- "!**/*.md"
2121
checks:
22-
- "pl-cpu (macOS-11, lightning, 3.8, 1.12, oldest)"
23-
- "pl-cpu (macOS-11, lightning, 3.9, 1.12)"
22+
- "pl-cpu (macOS-11, lightning, 3.8, 1.13, oldest)"
2423
- "pl-cpu (macOS-11, lightning, 3.10, 1.13)"
25-
- "pl-cpu (macOS-11, lightning, 3.10, 2.0)"
2624
- "pl-cpu (macOS-11, lightning, 3.10, 2.1)"
27-
- "pl-cpu (ubuntu-20.04, lightning, 3.8, 1.12, oldest)"
28-
- "pl-cpu (ubuntu-20.04, lightning, 3.9, 1.12)"
25+
- "pl-cpu (macOS-11, lightning, 3.10, 2.2)"
26+
- "pl-cpu (ubuntu-20.04, lightning, 3.8, 1.13, oldest)"
2927
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 1.13)"
30-
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.0)"
3128
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.1)"
32-
- "pl-cpu (windows-2022, lightning, 3.8, 1.12, oldest)"
33-
- "pl-cpu (windows-2022, lightning, 3.9, 1.12)"
29+
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 2.2)"
30+
- "pl-cpu (windows-2022, lightning, 3.8, 1.13, oldest)"
3431
- "pl-cpu (windows-2022, lightning, 3.10, 1.13)"
35-
- "pl-cpu (windows-2022, lightning, 3.10, 2.0)"
3632
- "pl-cpu (windows-2022, lightning, 3.10, 2.1)"
33+
- "pl-cpu (windows-2022, lightning, 3.10, 2.2)"
3734
- "pl-cpu (macOS-11, pytorch, 3.8, 1.13)"
3835
- "pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.13)"
3936
- "pl-cpu (windows-2022, pytorch, 3.8, 1.13)"
@@ -95,7 +92,6 @@ subprojects:
9592
- ".github/workflows/tpu-tests.yml"
9693
- "tests/tests_pytorch/run_tpu_tests.sh"
9794
checks:
98-
- "test-on-tpus (pytorch, xrt, v4-8)"
9995
- "test-on-tpus (pytorch, pjrt, v4-8)"
10096

10197
- id: "fabric: Docs"
@@ -144,13 +140,11 @@ subprojects:
144140
- "!*.md"
145141
- "!**/*.md"
146142
checks:
147-
- "build-cuda (3.9, 1.12, 11.7.1)"
148143
- "build-cuda (3.9, 1.13, 11.8.0)"
149144
- "build-cuda (3.9, 1.13, 12.0.1)"
150145
- "build-cuda (3.10, 2.0, 11.8.0)"
151146
- "build-cuda (3.10, 2.1, 12.1.0)"
152147
#- "build-NGC"
153-
- "build-pl (3.9, 1.12, 11.7.1)"
154148
- "build-pl (3.9, 1.13, 11.8.0)"
155149
- "build-pl (3.9, 1.13, 12.0.1)"
156150
- "build-pl (3.10, 2.0, 11.8.0)"
@@ -194,21 +188,18 @@ subprojects:
194188
- "!*.md"
195189
- "!**/*.md"
196190
checks:
197-
- "fabric-cpu (macOS-11, lightning, 3.8, 1.12, oldest)"
198-
- "fabric-cpu (macOS-11, lightning, 3.9, 1.12)"
191+
- "fabric-cpu (macOS-11, lightning, 3.8, 1.13, oldest)"
199192
- "fabric-cpu (macOS-11, lightning, 3.10, 1.13)"
200-
- "fabric-cpu (macOS-11, lightning, 3.10, 2.0)"
201193
- "fabric-cpu (macOS-11, lightning, 3.11, 2.1)"
202-
- "fabric-cpu (ubuntu-20.04, lightning, 3.8, 1.12, oldest)"
203-
- "fabric-cpu (ubuntu-20.04, lightning, 3.9, 1.12)"
194+
- "fabric-cpu (macOS-11, lightning, 3.11, 2.2)"
195+
- "fabric-cpu (ubuntu-20.04, lightning, 3.8, 1.13, oldest)"
204196
- "fabric-cpu (ubuntu-20.04, lightning, 3.10, 1.13)"
205-
- "fabric-cpu (ubuntu-20.04, lightning, 3.10, 2.0)"
206197
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.1)"
207-
- "fabric-cpu (windows-2022, lightning, 3.8, 1.12, oldest)"
208-
- "fabric-cpu (windows-2022, lightning, 3.9, 1.12)"
198+
- "fabric-cpu (ubuntu-20.04, lightning, 3.11, 2.2)"
199+
- "fabric-cpu (windows-2022, lightning, 3.8, 1.13, oldest)"
209200
- "fabric-cpu (windows-2022, lightning, 3.10, 1.13)"
210-
- "fabric-cpu (windows-2022, lightning, 3.10, 2.0)"
211201
- "fabric-cpu (windows-2022, lightning, 3.11, 2.1)"
202+
- "fabric-cpu (windows-2022, lightning, 3.11, 2.2)"
212203
- "fabric-cpu (macOS-11, fabric, 3.8, 1.13)"
213204
- "fabric-cpu (ubuntu-20.04, fabric, 3.8, 1.13)"
214205
- "fabric-cpu (windows-2022, fabric, 3.8, 1.13)"
@@ -225,8 +216,7 @@ subprojects:
225216
- ".azure/gpu-tests-fabric.yml"
226217
- "examples/fabric/**"
227218
- "examples/run_fabric_examples.sh"
228-
- "tests/tests_fabric/run_standalone_*.sh"
229-
- "tests/tests_pytorch/run_standalone_tests.sh" # used by Fabric through a symlink
219+
- "tests/run_standalone_*.sh"
230220
- "requirements/fabric/**"
231221
- "src/lightning/__init__.py"
232222
- "src/lightning/__setup__.py"
@@ -249,7 +239,6 @@ subprojects:
249239
- ".github/workflows/tpu-tests.yml"
250240
- "tests/tests_fabric/run_tpu_tests.sh"
251241
checks:
252-
- "test-on-tpus (fabric, xrt, v4-8)"
253242
- "test-on-tpus (pytorch, pjrt, v4-8)"
254243

255244
# SECTION: lightning_app

0 commit comments

Comments
 (0)