Skip to content

Commit dee68b1

Browse files
authored
Merge branch 'master' into device-enhance
2 parents 06a3303 + 9177ec0 commit dee68b1

File tree

18 files changed

+87
-103
lines changed

18 files changed

+87
-103
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: 1 addition & 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"

.azure/gpu-tests-fabric.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- bash: |
108108
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
109109
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
110-
pip install setuptools==75.6.0
110+
pip install setuptools==75.6.0 jsonargparse==4.35.0
111111
displayName: "Install package & dependencies"
112112
113113
- bash: |

.azure/gpu-tests-pytorch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
- bash: |
112112
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
113113
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
114-
pip install setuptools==75.6.0
114+
pip install setuptools==75.6.0 jsonargparse==4.35.0
115115
displayName: "Install package & dependencies"
116116
117117
- bash: pip uninstall -y lightning

.github/checkgroup.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -145,17 +145,17 @@ subprojects:
145145
- "!*.md"
146146
- "!**/*.md"
147147
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)"
148+
- "build-cuda (3.10, 2.1.2, 12.1.1)"
149+
- "build-cuda (3.11, 2.2.2, 12.1.1)"
150+
- "build-cuda (3.11, 2.3.1, 12.1.1)"
151+
- "build-cuda (3.11, 2.4.1, 12.1.1)"
152+
- "build-cuda (3.12, 2.5.1, 12.1.1)"
153153
#- "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)"
154+
- "build-pl (3.10, 2.1, 12.1.1)"
155+
- "build-pl (3.11, 2.2, 12.1.1)"
156+
- "build-pl (3.11, 2.3, 12.1.1)"
157+
- "build-pl (3.11, 2.4, 12.1.1)"
158+
- "build-pl (3.12, 2.5, 12.1.1, true)"
159159

160160
# SECTION: lightning_fabric
161161

.github/workflows/ci-tests-fabric.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,16 @@ jobs:
4949
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5050
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5151
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
52-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
53-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
54-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
55-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
56-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
57-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
52+
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
53+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
54+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
55+
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
56+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
57+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
5858
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
59-
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.5.1" }
60-
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.5.1" }
61-
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.5.1" }
59+
- { os: "macOS-14", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.5.1" }
60+
- { os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.5.1" }
61+
- { os: "windows-2022", pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.5.1" }
6262
# "oldest" versions tests, only on minimum Python
6363
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.9", pytorch-version: "2.1", requires: "oldest" }
6464
- {

.github/workflows/ci-tests-pytorch.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ jobs:
5353
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5454
- { os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5555
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
56-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
57-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
58-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.4.1" }
59-
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
60-
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
61-
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12", pytorch-version: "2.5.1" }
56+
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
57+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
58+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
59+
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
60+
- { os: "ubuntu-22.04", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
61+
- { os: "windows-2022", pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
6262
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
63-
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.5.1" }
64-
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.5.1" }
65-
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.5.1" }
63+
- { os: "macOS-14", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.5.1" }
64+
- { os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.5.1" }
65+
- { os: "windows-2022", pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.5.1" }
6666
# "oldest" versions tests, only on minimum Python
6767
- { os: "macOS-14", pkg-name: "lightning", python-version: "3.9", pytorch-version: "2.1", requires: "oldest" }
6868
- {

.github/workflows/docker-build.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
include:
4444
# We only release one docker image per PyTorch version.
4545
# Make sure the matrix here matches the one below.
46-
- { python_version: "3.10", pytorch_version: "2.1", cuda_version: "12.1.0" }
47-
- { python_version: "3.11", pytorch_version: "2.2", cuda_version: "12.1.0" }
48-
- { python_version: "3.11", pytorch_version: "2.3", cuda_version: "12.1.0" }
49-
- { python_version: "3.11", pytorch_version: "2.4", cuda_version: "12.1.0" }
50-
- { python_version: "3.12", pytorch_version: "2.5", cuda_version: "12.1.0" }
46+
- { python_version: "3.10", pytorch_version: "2.1", cuda_version: "12.1.1" }
47+
- { python_version: "3.11", pytorch_version: "2.2", cuda_version: "12.1.1" }
48+
- { python_version: "3.11", pytorch_version: "2.3", cuda_version: "12.1.1" }
49+
- { python_version: "3.11", pytorch_version: "2.4", cuda_version: "12.1.1" }
50+
- { python_version: "3.12", pytorch_version: "2.5", cuda_version: "12.1.1", latest: "true" }
5151
steps:
5252
- uses: actions/checkout@v4
5353
with:
@@ -65,23 +65,14 @@ jobs:
6565
run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF##*/})" >> $GITHUB_ENV
6666
- name: Set tags
6767
run: |
68-
import os
69-
70-
repo = "pytorchlightning/pytorch_lightning"
71-
ver = os.getenv('RELEASE_VERSION')
72-
py_ver = "${{ matrix.python_version }}"
73-
pt_ver = "${{ matrix.pytorch_version }}"
74-
cuda_ver = "${{ matrix.cuda_version }}"
75-
tags = [f"latest-py{py_ver}-torch{pt_ver}-cuda{cuda_ver}"]
76-
if ver:
77-
tags += [f"{ver}-py{py_ver}-torch{pt_ver}-cuda{cuda_ver}"]
78-
if py_ver == '3.11' and pt_ver == '2.3' and cuda_ver == '12.1.0':
79-
tags += ["latest"]
80-
81-
tags = [f"{repo}:{tag}" for tag in tags]
82-
with open(os.getenv('GITHUB_ENV'), "a") as gh_env:
83-
gh_env.write("DOCKER_TAGS=" + ",".join(tags))
84-
shell: python
68+
pip install -q -r .actions/requirements.txt
69+
tags=$(python .actions/assistant.py generate_docker_tags \
70+
--release_version="${{ env.RELEASE_VERSION }}" \
71+
--python_version="${{ matrix.python_version }}" \
72+
--torch_version="${{ matrix.pytorch_version }}" \
73+
--cuda_version="${{ matrix.cuda_version }}" \
74+
--add_latest="${{ matrix.latest || 'false' }}")
75+
echo "DOCKER_TAGS=$tags" >> $GITHUB_ENV
8576
8677
- uses: docker/build-push-action@v6
8778
with:
@@ -104,11 +95,11 @@ jobs:
10495
include:
10596
# These are the base images for PL release docker images.
10697
# Make sure the matrix here matches the one above.
107-
- { python_version: "3.10", pytorch_version: "2.1.2", cuda_version: "12.1.0" }
108-
- { python_version: "3.11", pytorch_version: "2.2.2", cuda_version: "12.1.0" }
109-
- { python_version: "3.11", pytorch_version: "2.3.1", cuda_version: "12.1.0" }
110-
- { python_version: "3.11", pytorch_version: "2.4.1", cuda_version: "12.1.0" }
111-
- { python_version: "3.12", pytorch_version: "2.5.1", cuda_version: "12.1.0" }
98+
- { python_version: "3.10", pytorch_version: "2.1.2", cuda_version: "12.1.1" }
99+
- { python_version: "3.11", pytorch_version: "2.2.2", cuda_version: "12.1.1" }
100+
- { python_version: "3.11", pytorch_version: "2.3.1", cuda_version: "12.1.1" }
101+
- { python_version: "3.11", pytorch_version: "2.4.1", cuda_version: "12.1.1" }
102+
- { python_version: "3.12", pytorch_version: "2.5.1", cuda_version: "12.1.1" }
112103
steps:
113104
- uses: actions/checkout@v4
114105
- uses: docker/setup-buildx-action@v3

docs/source-pytorch/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,8 @@ def _load_py_module(name: str, location: str) -> ModuleType:
464464
("py:func", "lightning.pytorch.utilities.rank_zero.rank_zero_only"),
465465
("py:class", "lightning.pytorch.utilities.types.LRSchedulerConfig"),
466466
("py:class", "lightning.pytorch.utilities.types.LRSchedulerConfigType"),
467-
("py:class", "lightning.pytorch.utilities.types.OptimizerConfigType"),
468-
("py:class", "lightning.pytorch.utilities.types.OptimizerLRSchedulerConfigType"),
467+
("py:class", "lightning.pytorch.utilities.types.OptimizerConfig"),
468+
("py:class", "lightning.pytorch.utilities.types.OptimizerLRSchedulerConfig"),
469469
("py:class", "lightning_habana.pytorch.plugins.precision.HPUPrecisionPlugin"),
470470
("py:class", "lightning_habana.pytorch.strategies.HPUDDPStrategy"),
471471
("py:class", "lightning_habana.pytorch.strategies.HPUParallelStrategy"),

0 commit comments

Comments
 (0)