Skip to content

Commit 3b3a12c

Browse files
authored
Merge branch 'master' into docs/lightning_module_enhancements
2 parents 86c2b71 + da0e646 commit 3b3a12c

Some content is hidden

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

55 files changed

+978
-726
lines changed

.actions/assistant.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,25 @@ def generate_docker_tags(
459459
tags = [f"{docker_project}:{tag}" for tag in tags]
460460
print(",".join(tags))
461461

462+
@staticmethod
463+
def prune_pytest_as_errors(
464+
pyproject_toml: str = "pyproject.toml", errors: tuple = ("FutureWarning", "DeprecationWarning")
465+
) -> None:
466+
"""Prune pytest warnings as errors from the pyproject.toml file."""
467+
import tomlkit
468+
469+
with open(pyproject_toml, encoding="utf-8") as fopen:
470+
content = fopen.read()
471+
pyproject = tomlkit.parse(content)
472+
filterwarnings = pyproject.get("tool", {}).get("pytest", {}).get("ini_options", {}).get("filterwarnings", [])
473+
if not filterwarnings:
474+
return
475+
filterwarnings = [wrn for wrn in filterwarnings if not any(f"error::{err}" in wrn for err in errors)]
476+
pyproject["tool"]["pytest"]["ini_options"]["filterwarnings"] = filterwarnings
477+
478+
with open(pyproject_toml, "w", encoding="utf-8") as fopen:
479+
fopen.write(tomlkit.dumps(pyproject))
480+
462481

463482
if __name__ == "__main__":
464483
import jsonargparse

.github/checkgroup.yml

Lines changed: 10 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ subprojects:
2121
checks:
2222
- "pl-cpu-guardian" # aggregated check for all cases
2323

24-
- id: "pytorch_lightning: Azure GPU"
24+
- id: "pytorch_lightning: lit GPU"
2525
paths:
2626
- ".actions/*"
27-
- ".azure/gpu-tests-pytorch.yml"
27+
- ".lightning/workflows/pytorch.yml"
2828
# only the azure GPU workflow runs the examples
2929
# all examples don't need to be added because they aren't used in CI, but these are
3030
- "examples/run_pl_examples.sh"
@@ -47,9 +47,9 @@ subprojects:
4747
- "!*.md"
4848
- "!**/*.md"
4949
checks:
50-
- "pytorch-lightning (GPUs) (testing Lightning | latest)"
51-
- "pytorch-lightning (GPUs) (testing PyTorch | oldest)"
52-
- "pytorch-lightning (GPUs) (testing PyTorch | latest)"
50+
- "pytorch.yml / Lit Job (nvidia/cuda:12.1.1-runtime-ubuntu22.04, pytorch, 3.10, A100_X_2)"
51+
- "pytorch.yml / Lit Job (nvidia/cuda:12.6.3-runtime-ubuntu22.04, lightning, 3.12, L4_X_2)"
52+
- "pytorch.yml / Lit Job (nvidia/cuda:12.6.3-runtime-ubuntu22.04, pytorch, 3.12, L4_X_2)"
5353

5454
- id: "pytorch_lightning: Benchmarks"
5555
paths:
@@ -111,34 +111,6 @@ subprojects:
111111
- "docs-make (pytorch, doctest)"
112112
- "docs-make (pytorch, html)"
113113

114-
- id: "pytorch_lightning: Docker"
115-
paths:
116-
- ".actions/*"
117-
- ".github/workflows/docker-build.yml"
118-
- "dockers/**"
119-
- "requirements/pytorch/**"
120-
- "requirements/fabric/**"
121-
- "setup.py"
122-
- "!requirements/*/docs.txt"
123-
- "!*.md"
124-
- "!**/*.md"
125-
checks:
126-
- "build-cuda (3.10, 2.1.2, 12.1.1)"
127-
- "build-cuda (3.11, 2.2.2, 12.1.1)"
128-
- "build-cuda (3.11, 2.3.1, 12.1.1)"
129-
- "build-cuda (3.11, 2.4.1, 12.1.1)"
130-
- "build-cuda (3.12, 2.5.1, 12.1.1)"
131-
- "build-cuda (3.12, 2.6.0, 12.4.1)"
132-
#- "build-NGC"
133-
- "build-pl (3.10, 2.1, 12.1.1)"
134-
- "build-pl (3.11, 2.2, 12.1.1)"
135-
- "build-pl (3.11, 2.3, 12.1.1)"
136-
- "build-pl (3.11, 2.4, 12.1.1)"
137-
- "build-pl (3.12, 2.5, 12.1.1)"
138-
- "build-pl (3.12, 2.6, 12.4.1)"
139-
- "build-pl (3.12, 2.7, 12.6.3)"
140-
- "build-pl (3.12, 2.8, 12.6.3, true)"
141-
142114
# SECTION: lightning_fabric
143115

144116
- id: "lightning_fabric: CPU workflow"
@@ -156,10 +128,10 @@ subprojects:
156128
checks:
157129
- "fabric-cpu-guardian" # aggregated check for all cases
158130

159-
- id: "lightning_fabric: Azure GPU"
131+
- id: "lightning_fabric: lit GPU"
160132
paths:
161133
- ".actions/*"
162-
- ".azure/gpu-tests-fabric.yml"
134+
- ".lightning/workflows/fabric.yml"
163135
- "examples/fabric/**"
164136
- "examples/run_fabric_examples.sh"
165137
- "requirements/fabric/**"
@@ -175,9 +147,9 @@ subprojects:
175147
- "!*.md"
176148
- "!**/*.md"
177149
checks:
178-
- "lightning-fabric (GPUs) (testing Fabric | oldest)"
179-
- "lightning-fabric (GPUs) (testing Fabric | latest)"
180-
- "lightning-fabric (GPUs) (testing Lightning | latest)"
150+
- "fabric.yml / Lit Job (nvidia/cuda:12.1.1-runtime-ubuntu22.04, fabric, 3.10, A100_X_2)"
151+
- "fabric.yml / Lit Job (nvidia/cuda:12.6.3-runtime-ubuntu22.04, fabric, 3.12, L4_X_2)"
152+
- "fabric.yml / Lit Job (nvidia/cuda:12.6.3-runtime-ubuntu22.04, lightning, 3.12, L4_X_2)"
181153

182154
# Temporarily disabled
183155
# - id: "lightning_fabric: TPU workflow"

.github/label-change.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ package:
5454
- "src/lightning_fabric/*"
5555
- "src/pytorch_lightning/*"
5656

57-
dockers:
58-
- changed-files:
59-
- any-glob-to-any-file:
60-
- "dockers/**"
61-
- ".github/workflows/docker-build.yml"
62-
6357
dependencies:
6458
- changed-files:
6559
- any-glob-to-any-file:

.github/workflows/_build-packages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
pkg-name: ${{ fromJSON(inputs.pkg-names) }}
2727
steps:
2828
- uses: actions/checkout@v5
29-
- uses: actions/setup-python@v5
29+
- uses: actions/setup-python@v6
3030
with:
3131
python-version: "3.x"
3232

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
python-version: ["3.9", "3.11"]
4848
steps:
4949
- uses: actions/checkout@v5
50-
- uses: actions/setup-python@v5
50+
- uses: actions/setup-python@v6
5151
with:
5252
python-version: ${{ matrix.python-version }}
5353
- uses: actions/download-artifact@v5

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ jobs:
6666
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/"
6767
# TODO: Remove this - Enable running MPS tests on this platform
6868
DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }}
69+
UV_TORCH_BACKEND: "cpu"
6970
steps:
7071
- uses: actions/checkout@v5
7172

@@ -98,11 +99,14 @@ jobs:
9899
- name: Set min. dependencies
99100
if: ${{ matrix.config.requires == 'oldest' }}
100101
run: |
101-
cd requirements/fabric
102102
uv pip install -U "lightning-utilities[cli]"
103-
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'strategies.txt', 'test.txt']"
103+
python -m lightning_utilities.cli requirements set-oldest \
104+
--req_files "['requirements/fabric/base.txt', 'requirements/fabric/strategies.txt', 'requirements/fabric/test.txt']"
104105
uv pip install "cython<3.0" wheel
105106
uv pip install "pyyaml==5.4" --no-build-isolation
107+
# This script removes any line containing "error::FutureWarning" from pyproject.toml
108+
uv pip install -r requirements/ci.txt
109+
python .actions/assistant.py prune_pytest_as_errors
106110
107111
- name: Adjust PyTorch versions in requirements files
108112
if: ${{ matrix.config.requires != 'oldest' }}

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
7272
# TODO: Remove this - Enable running MPS tests on this platform
7373
DISABLE_MPS: ${{ matrix.os == 'macOS-14' && '1' || '0' }}
74+
UV_TORCH_BACKEND: "cpu"
7475
steps:
7576
- uses: actions/checkout@v5
7677

@@ -97,11 +98,14 @@ jobs:
9798
- name: Set min. dependencies
9899
if: ${{ matrix.config.requires == 'oldest' }}
99100
run: |
100-
cd requirements/pytorch
101101
uv pip install -U "lightning-utilities[cli]"
102-
python -m lightning_utilities.cli requirements set-oldest --req_files "['base.txt', 'extra.txt', 'strategies.txt', 'examples.txt', 'test.txt']"
102+
python -m lightning_utilities.cli requirements set-oldest \
103+
--req_files "['requirements/pytorch/base.txt', 'requirements/pytorch/extra.txt', 'requirements/pytorch/strategies.txt', 'requirements/pytorch/examples.txt', 'requirements/pytorch/test.txt']"
103104
uv pip install "cython<3.0" wheel
104105
uv pip install "pyyaml==5.4" --no-build-isolation
106+
# This script removes any line containing "error::FutureWarning" from pyproject.toml
107+
uv pip install -r requirements/ci.txt
108+
python .actions/assistant.py prune_pytest_as_errors
105109
106110
- name: Adjust PyTorch versions in requirements files
107111
if: ${{ matrix.config.requires != 'oldest' }}

.github/workflows/code-checks.yml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,32 @@ jobs:
2929
runs-on: ubuntu-22.04
3030
steps:
3131
- uses: actions/checkout@v5
32-
- uses: actions/setup-python@v5
33-
with:
34-
python-version: "3.11"
3532

36-
- name: Mypy cache
37-
uses: actions/cache@v4
33+
- name: Install uv and set Python version
34+
uses: astral-sh/setup-uv@v6
3835
with:
39-
path: .mypy_cache
40-
key: mypy-${{ hashFiles('requirements/typing.txt') }}
36+
python-version: "3.11"
37+
# TODO: Avoid activating environment like this
38+
# see: https://github.com/astral-sh/setup-uv/tree/v6/?tab=readme-ov-file#activate-environment
39+
activate-environment: true
40+
enable-cache: true
4141

4242
- name: Install dependencies
4343
env:
4444
FREEZE_REQUIREMENTS: 1
4545
timeout-minutes: 20
4646
run: |
47-
pip install -e '.[pytorch-all,fabric-all]' -r requirements/typing.txt
48-
pip list
47+
uv pip install '.[pytorch-all,fabric-all]' -r requirements/typing.txt
48+
uv pip list
49+
50+
- name: mypy cache
51+
uses: actions/cache@v4
52+
with:
53+
path: .mypy_cache
54+
key: mypy-${{ hashFiles('requirements/typing.txt') }}
4955

5056
- name: Check typing
5157
run: mypy
58+
59+
- name: Minimize uv cache
60+
run: uv cache prune --ci

0 commit comments

Comments
 (0)