Skip to content

Commit dd81f52

Browse files
committed
Fix
1 parent 4f82068 commit dd81f52

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/lightning/fabric/loggers/logger.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def rank_zero_experiment(fn: Callable) -> Callable:
9999
"""Returns the real experiment on rank 0 and otherwise the _DummyExperiment."""
100100

101101
@wraps(fn)
102-
def experiment(self) -> Union[Any, _DummyExperiment]: # type: ignore[no-untyped-def]
102+
def experiment(self: Logger) -> Union[Any, _DummyExperiment]:
103103
"""
104104
Note:
105105
``self`` is a custom logger instance. The loggers typically wrap an ``experiment`` method
@@ -109,12 +109,9 @@ def experiment(self) -> Union[Any, _DummyExperiment]: # type: ignore[no-untyped
109109
types that are specific to the custom logger. The return type here can be considered as
110110
``Union[return type of logger.experiment, _DummyExperiment]``.
111111
"""
112-
113-
@rank_zero_only
114-
def get_experiment() -> Callable:
115-
return fn(self)
116-
117-
return get_experiment() or _DummyExperiment()
112+
if rank_zero_only.rank > 0:
113+
return _DummyExperiment()
114+
return fn(self)
118115

119116
return experiment
120117

src/lightning/pytorch/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
4949
- Fixed the availability check for `rich` that prevented Lightning to be imported in Google Colab ([#17156](https://github.com/Lightning-AI/lightning/pull/17156))
5050

5151

52+
- Fixed issue where `torch.compile` would fail when logging to WandB ([#17216](https://github.com/Lightning-AI/lightning/pull/17216))
53+
54+
5255

5356
## [2.0.0] - 2023-03-15
5457

0 commit comments

Comments
 (0)