Skip to content

Commit 5ea69dd

Browse files
authored
Merge branch 'master' into bugfix/21264_pbardeadlock
2 parents a1a3700 + 79ffe50 commit 5ea69dd

File tree

35 files changed

+827
-142
lines changed

35 files changed

+827
-142
lines changed

.github/CODEOWNERS

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55
# the repo. Unless a later match takes precedence,
66
# @global-owner1 and @global-owner2 will be requested for
77
# review when someone opens a pull request.
8-
* @lantiga @borda @tchaton @justusschock @ethanwharris
8+
* @lantiga @tchaton @justusschock @ethanwharris
99

1010
# Docs
11-
/.github/*.md @williamfalcon @lantiga @borda
11+
/.github/*.md @williamfalcon @lantiga
1212
/docs/source-fabric/index.rst @williamfalcon @lantiga
1313
/docs/source-pytorch/index.rst @williamfalcon @lantiga
1414
/docs/source-pytorch/levels @williamfalcon @lantiga
1515

1616
/.github/CODEOWNERS @williamfalcon
1717
/SECURITY.md @williamfalcon @lantiga
1818
/README.md @williamfalcon @lantiga
19-
/src/pytorch_lightning/__about__.py @williamfalcon @lantiga @borda
20-
/src/lightning_fabric/__about__.py @williamfalcon @lantiga @borda
19+
/src/pytorch_lightning/__about__.py @williamfalcon @lantiga
20+
/src/lightning_fabric/__about__.py @williamfalcon @lantiga
2121

2222
/src/lightning/fabric/loggers @williamfalcon
2323
/src/lightning/pytorch/loggers @williamfalcon

.github/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,8 @@ We welcome any useful contribution! For your convenience here's a recommended wo
212212
- [Test README](https://github.com/Lightning-AI/pytorch-lightning/blob/master/tests/README.md)
213213
- [CI/CD README](https://github.com/Lightning-AI/pytorch-lightning/tree/master/.github/workflows#readme)
214214

215+
1. Once you have a PR opened (and thereby a PR number), please update the respective changelog for [fabric](https://github.com/Lightning-AI/pytorch-lightning/blob/master/src/lightning/fabric/CHANGELOG.md) or [pytorch](https://github.com/Lightning-AI/pytorch-lightning/blob/master/src/lightning/pytorch/CHANGELOG.md) subpackage depending on where you made your changes.
216+
215217
1. When you feel ready for integrating your work, mark your PR "Ready for review".
216218

217219
- Your code should be readable and follow the project's design principles.

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,20 @@ jobs:
4040
matrix:
4141
os: [macOS-14, ubuntu-22.04, windows-2022]
4242
config:
43-
# only run PyTorch latest
43+
# Test unified "lightning" package with PyTorch 2.1-2.5
4444
- { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
4545
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
4646
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
4747
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
4848
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
4949

50-
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
50+
# Test "fabric" package with PyTorch 2.6-2.9
5151
- { pkg-name: "fabric", python-version: "3.12.7", pytorch-version: "2.6" }
52-
53-
# "fabric" installs the standalone package
54-
- { pkg-name: "fabric", python-version: "3.10", pytorch-version: "2.7" }
55-
56-
# adding recently cut Torch 2.7 - FUTURE
52+
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.7" }
5753
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.8" }
54+
- { pkg-name: "fabric", python-version: "3.12", pytorch-version: "2.9" }
5855

59-
# "oldest" versions tests, only on minimum Python
56+
# Test minimum supported versions (oldest)
6057
- { pkg-name: "fabric", pytorch-version: "2.1", requires: "oldest" }
6158
timeout-minutes: 25 # because of building grpcio on Mac
6259
env:

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,20 @@ jobs:
4444
matrix:
4545
os: [macOS-14, ubuntu-22.04, windows-2022]
4646
config:
47-
# only run PyTorch latest
47+
# Test unified "lightning" package with PyTorch 2.1-2.5
4848
- { pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.1" }
4949
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.2.2" }
5050
- { pkg-name: "lightning", python-version: "3.11", pytorch-version: "2.3" }
5151
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.4.1" }
5252
- { pkg-name: "lightning", python-version: "3.12.7", pytorch-version: "2.5.1" }
5353

54-
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
54+
# Test "pytorch" package with PyTorch 2.6-2.9
5555
- { pkg-name: "pytorch", python-version: "3.12.7", pytorch-version: "2.6" }
56-
57-
# "pytorch" installs the standalone package
58-
- { pkg-name: "pytorch", python-version: "3.10", pytorch-version: "2.7" }
59-
60-
# adding recently cut Torch 2.7 - FUTURE
56+
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.7" }
6157
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.8" }
58+
- { pkg-name: "pytorch", python-version: "3.12", pytorch-version: "2.9" }
6259

63-
# "oldest" versions tests, only on minimum Python
60+
# Test minimum supported versions (oldest)
6461
- { pkg-name: "pytorch", pytorch-version: "2.1", requires: "oldest" }
6562
timeout-minutes: 50
6663
env:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export PACKAGE_NAME=pytorch
1010

1111
# In Lightning Studio, the `lightning` package comes pre-installed.
1212
# Uninstall it first to ensure the editable install works correctly.
13-
setup:
13+
setup: update
1414
uv pip uninstall lightning pytorch-lightning lightning-fabric || true
1515
uv pip install -r requirements.txt \
1616
-r requirements/pytorch/base.txt \

docs/source-fabric/guide/callbacks.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,30 @@ The :meth:`~lightning.fabric.fabric.Fabric.call` calls the callback objects in t
8383
Not all objects registered via ``Fabric(callbacks=...)`` must implement a method with the given name.
8484
The ones that have a matching method name will get called.
8585

86+
The different callbacks can have different method signatures. Fabric automatically filters keyword arguments based on
87+
each callback's function signature, allowing callbacks with different signatures to work together seamlessly.
88+
89+
.. code-block:: python
90+
91+
class TrainingMetricsCallback:
92+
def on_train_epoch_end(self, train_loss):
93+
print(f"Training loss: {train_loss:.4f}")
94+
95+
class ValidationMetricsCallback:
96+
def on_train_epoch_end(self, val_accuracy):
97+
print(f"Validation accuracy: {val_accuracy:.4f}")
98+
99+
class ComprehensiveCallback:
100+
def on_train_epoch_end(self, epoch, **kwargs):
101+
print(f"Epoch {epoch} complete with metrics: {kwargs}")
102+
103+
fabric = Fabric(
104+
callbacks=[TrainingMetricsCallback(), ValidationMetricsCallback(), ComprehensiveCallback()]
105+
)
106+
107+
# Each callback receives only the arguments it can handle
108+
fabric.call("on_train_epoch_end", epoch=5, train_loss=0.1, val_accuracy=0.95, learning_rate=0.001)
109+
86110
87111
----
88112

docs/source-pytorch/community/governance.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ Role: All final decisions related to Lightning.
1919
Maintainers
2020
-----------
2121
- Luca Antiga (`lantiga <https://github.com/lantiga>`_)
22-
- Jirka Borovec (`Borda <https://github.com/Borda>`_)
22+
- Ethan Harris (`ethanwharris <https://github.com/ethanwharris>`_) (Torchbearer founder)
2323
- Justus Schock (`justusschock <https://github.com/justusschock>`_)
2424

2525

2626
Emeritus Maintainers
2727
--------------------
28-
- Ethan Harris (`ethanwharris <https://github.com/ethanwharris>`_) (Torchbearer founder)
2928
- Nicki Skafte (`SkafteNicki <https://github.com/SkafteNicki>`_)
3029
- Thomas Chaton (`tchaton <https://github.com/tchaton>`_)
30+
- Jirka Borovec (`Borda <https://github.com/Borda>`_)
3131

3232

3333
Alumni

requirements/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ myst-parser >=0.18.1, <5.0.0
33
nbsphinx >=0.8.5, <=0.9.7
44
nbconvert >7.14, <7.17
55
pandoc >=1.0, <=2.4
6-
docutils>=0.18.1,<=0.22.2
6+
docutils>=0.18.1,<=0.22.3
77
sphinxcontrib-fulltoc >=1.0, <=1.2.0
88
sphinxcontrib-mockautodoc
99
sphinx-autobuild

requirements/pytorch/docs.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-r ../docs.txt
22

33
nbformat # used for generate empty notebook
4-
ipython[notebook] <9.7.0
4+
ipython[notebook] <9.8.0
55
setuptools<81.0 # workaround for `error in ipython setup command: use_2to3 is invalid.`
66

77
onnxscript >= 0.2.2, < 0.6.0

requirements/pytorch/extra.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
matplotlib>3.1, <3.11.0
66
omegaconf >=2.2.3, <2.4.0
77
hydra-core >=1.2.0, <1.4.0
8-
jsonargparse[signatures,jsonnet] >=4.39.0, <4.43.0
9-
rich >=12.3.0, <14.2.0
8+
jsonargparse[signatures,jsonnet] >=4.39.0, <4.44.0
9+
rich >=12.3.0, <14.3.0
1010
tensorboardX >=2.2, <2.7.0 # min version is set by torch.onnx missing attribute
1111
bitsandbytes >=0.45.2,<0.47.0; platform_system != "Darwin"

0 commit comments

Comments
 (0)