Skip to content

Commit 925eee6

Browse files
authored
Merge branch 'master' into ci/lit
2 parents 1ed22b4 + 72bb751 commit 925eee6

File tree

19 files changed

+167
-71
lines changed

19 files changed

+167
-71
lines changed

.github/checkgroup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ subprojects:
135135
- "build-pl (3.11, 2.4, 12.1.1)"
136136
- "build-pl (3.12, 2.5, 12.1.1)"
137137
- "build-pl (3.12, 2.6, 12.4.1)"
138-
- "build-pl (3.12, 2.7, 12.6.3, true)"
138+
- "build-pl (3.12, 2.7, 12.6.3)"
139+
- "build-pl (3.12, 2.8, 12.6.3, true)"
139140

140141
# SECTION: lightning_fabric
141142

.github/workflows/docker-build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ jobs:
4949
- { python_version: "3.11", pytorch_version: "2.4", cuda_version: "12.1.1" }
5050
- { python_version: "3.12", pytorch_version: "2.5", cuda_version: "12.1.1" }
5151
- { python_version: "3.12", pytorch_version: "2.6", cuda_version: "12.4.1" }
52-
- { python_version: "3.12", pytorch_version: "2.7", cuda_version: "12.6.3", latest: "true" }
52+
- { python_version: "3.12", pytorch_version: "2.7", cuda_version: "12.6.3" }
53+
- { python_version: "3.12", pytorch_version: "2.8", cuda_version: "12.6.3", latest: "true" }
5354
steps:
5455
- uses: actions/checkout@v4
5556
with:
@@ -97,7 +98,7 @@ jobs:
9798
# adding dome more images as Thunder mainly using python 3.10,
9899
# and we need to support integrations as for example LitGPT
99100
python_version: ["3.10"]
100-
pytorch_version: ["2.6.0", "2.7.1"]
101+
pytorch_version: ["2.7.1", "2.8.0"]
101102
cuda_version: ["12.6.3"]
102103
include:
103104
# These are the base images for PL release docker images.
@@ -109,6 +110,7 @@ jobs:
109110
- { python_version: "3.12", pytorch_version: "2.5.1", cuda_version: "12.1.1" }
110111
- { python_version: "3.12", pytorch_version: "2.6.0", cuda_version: "12.4.1" }
111112
- { python_version: "3.12", pytorch_version: "2.7.1", cuda_version: "12.6.3" }
113+
- { python_version: "3.12", pytorch_version: "2.8.0", cuda_version: "12.6.3" }
112114
steps:
113115
- uses: actions/checkout@v4
114116
- uses: docker/setup-buildx-action@v3
@@ -129,6 +131,7 @@ jobs:
129131
PYTHON_VERSION=${{ matrix.python_version }}
130132
PYTORCH_VERSION=${{ matrix.pytorch_version }}
131133
CUDA_VERSION=${{ matrix.cuda_version }}
134+
MAKE_FLAGS="-j2"
132135
file: dockers/base-cuda/Dockerfile
133136
push: ${{ env.PUSH_NIGHTLY }}
134137
tags: "pytorchlightning/pytorch_lightning:base-cuda-py${{ matrix.python_version }}-torch${{ env.PT_VERSION }}-cuda${{ matrix.cuda_version }}"
@@ -157,6 +160,8 @@ jobs:
157160
continue-on-error: true
158161
uses: docker/build-push-action@v6
159162
with:
163+
build-args: |
164+
PYTORCH_VERSION="25.04"
160165
file: dockers/nvidia/Dockerfile
161166
push: false
162167
timeout-minutes: 55

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ repos:
5858
#args: ["--write-changes"] # uncomment if you want to get automatic fixing
5959

6060
- repo: https://github.com/PyCQA/docformatter
61-
rev: 06907d0267368b49b9180eed423fae5697c1e909 # todo: fix for docformatter after last 1.7.5
61+
rev: v1.7.7
6262
hooks:
6363
- id: docformatter
6464
additional_dependencies: [tomli]
@@ -70,7 +70,7 @@ repos:
7070
- id: sphinx-lint
7171

7272
- repo: https://github.com/astral-sh/ruff-pre-commit
73-
rev: v0.11.4
73+
rev: v0.12.2
7474
hooks:
7575
# try to fix what is possible
7676
- id: ruff

dockers/base-cuda/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ ARG CUDA_VERSION=11.7.1
1919
FROM nvidia/cuda:${CUDA_VERSION}-runtime-ubuntu${UBUNTU_VERSION}
2020

2121
ARG PYTHON_VERSION=3.10
22-
ARG PYTORCH_VERSION=2.1
22+
ARG PYTORCH_VERSION=2.8
2323
ARG MAX_ALLOWED_NCCL=2.22.3
24+
ARG MAKE_FLAGS="-j$(nproc)"
2425

2526
SHELL ["/bin/bash", "-c"]
2627
# https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/
@@ -30,8 +31,7 @@ ENV \
3031
PATH="$PATH:/root/.local/bin" \
3132
CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" \
3233
MKL_THREADING_LAYER="GNU" \
33-
# MAKEFLAGS="-j$(nproc)"
34-
MAKEFLAGS="-j2"
34+
MAKEFLAGS=${MAKE_FLAGS}
3535

3636
RUN \
3737
CUDA_VERSION_MM=${CUDA_VERSION%.*} && \

dockers/nvidia/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG PYTORCH_VERSION=22.09
15+
ARG PYTORCH_VERSION=24.05
1616

1717
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
1818
FROM nvcr.io/nvidia/pytorch:${PYTORCH_VERSION}-py3

dockers/release/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
# limitations under the License.
1414

1515
ARG PYTHON_VERSION=3.10
16-
ARG PYTORCH_VERSION=2.0
17-
ARG CUDA_VERSION=11.8.0
16+
ARG PYTORCH_VERSION=2.8
17+
ARG CUDA_VERSION=12.6.3
1818

1919
FROM pytorchlightning/pytorch_lightning:base-cuda-py${PYTHON_VERSION}-torch${PYTORCH_VERSION}-cuda${CUDA_VERSION}
2020

src/lightning/pytorch/CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2727
### Fixed
2828

2929
- fix progress bar console clearing for Rich `14.1+` ([#21016](https://github.com/Lightning-AI/pytorch-lightning/pull/21016))
30+
31+
3032
- fix `AdvancedProfiler` to handle nested profiling actions for Python 3.12+ ([#20809](https://github.com/Lightning-AI/pytorch-lightning/pull/20809))
3133

3234

35+
- Fix support for more dtypes in `ModelSummary` ([#21034](https://github.com/Lightning-AI/pytorch-lightning/pull/21034))
36+
37+
3338
- Fixed metrics in `RichProgressBar` being updated according to user provided `refresh_rate` ([#21032](https://github.com/Lightning-AI/pytorch-lightning/pull/21032))
3439

40+
41+
- Fix `save_last` behavior in the absence of validation ([#20960](https://github.com/Lightning-AI/pytorch-lightning/pull/20960))
42+
43+
3544
---
3645

3746
## [2.5.2] - 2025-06-20

src/lightning/pytorch/callbacks/model_checkpoint.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,13 @@ def on_validation_end(self, trainer: "pl.Trainer", pl_module: "pl.LightningModul
344344
self._save_topk_checkpoint(trainer, monitor_candidates)
345345
self._save_last_checkpoint(trainer, monitor_candidates)
346346

347+
@override
348+
def on_train_end(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule") -> None:
349+
"""Ensure save_last=True is applied when training ends."""
350+
if self.save_last and not self._last_checkpoint_saved:
351+
monitor_candidates = self._monitor_candidates(trainer)
352+
self._save_last_checkpoint(trainer, monitor_candidates)
353+
347354
@override
348355
def state_dict(self) -> dict[str, Any]:
349356
return {

src/lightning/pytorch/callbacks/progress/rich_progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def render(self, task: "Task") -> Text:
184184

185185
def _generate_metrics_texts(self) -> Generator[str, None, None]:
186186
for name, value in self._metrics.items():
187-
if not isinstance(value, str):
187+
if not isinstance(value, (str, int)):
188188
value = f"{value:{self._metrics_format}}"
189189
yield f"{name}: {value}"
190190

src/lightning/pytorch/core/optimizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def _configure_schedulers_automatic_opt(schedulers: list, monitor: Optional[str]
274274
scheduler["reduce_on_plateau"] = scheduler.get(
275275
"reduce_on_plateau", isinstance(scheduler["scheduler"], optim.lr_scheduler.ReduceLROnPlateau)
276276
)
277-
if scheduler["reduce_on_plateau"] and scheduler.get("monitor", None) is None:
277+
if scheduler["reduce_on_plateau"] and scheduler.get("monitor") is None:
278278
raise MisconfigurationException(
279279
"The lr scheduler dict must include a monitor when a `ReduceLROnPlateau` scheduler is used."
280280
' For example: {"optimizer": optimizer, "lr_scheduler":'

0 commit comments

Comments
 (0)