Skip to content

Commit c059db4

Browse files
NeoKishpre-commit-ci[bot]otajcarmoccaakihironitta
authored
Remove the deprecated device_stats_monitor_prefix_keys (#14890)
* Remove the deprecated device_stats_monitor_prefix_keys * Added pr no to changelog.md * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: otaj <[email protected]> Co-authored-by: Carlos Mocholí <[email protected]> Co-authored-by: Akihiro Nitta <[email protected]>
1 parent c764221 commit c059db4

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

src/pytorch_lightning/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,16 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
274274

275275
- Removed the deprecated `Trainer.call_hook` in favor of `Trainer._call_callback_hooks`, `Trainer._call_lightning_module_hook`, `Trainer._call_ttp_hook`, and `Trainer._call_accelerator_hook` ([#14869](https://github.com/Lightning-AI/lightning/pull/14869))
276276

277+
277278
- Removed the deprecated `Trainer.{validated,tested,predicted}_ckpt_path` ([#14897](https://github.com/Lightning-AI/lightning/pull/14897))
278279

280+
281+
- Removed the deprecated `device_stats_monitor_prefix_metric_keys` ([#14890](https://github.com/Lightning-AI/lightning/pull/14890))
282+
283+
279284
- Removed the deprecated `LightningDataModule.on_save/load_checkpoint` hooks ([#14909](https://github.com/Lightning-AI/lightning/pull/14909))
280285

286+
281287
### Fixed
282288

283289
- Fixed an issue with `LightningLite.setup()` not setting the `.device` attribute correctly on the returned wrapper ([#14822](https://github.com/Lightning-AI/lightning/pull/14822))

src/pytorch_lightning/callbacks/device_stats_monitor.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from pytorch_lightning.callbacks.callback import Callback
2525
from pytorch_lightning.utilities.exceptions import MisconfigurationException
2626
from pytorch_lightning.utilities.imports import _PSUTIL_AVAILABLE
27-
from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation, rank_zero_warn
27+
from pytorch_lightning.utilities.rank_zero import rank_zero_warn
2828
from pytorch_lightning.utilities.types import STEP_OUTPUT
2929

3030

@@ -112,12 +112,3 @@ def on_train_batch_end(
112112

113113
def _prefix_metric_keys(metrics_dict: Dict[str, float], prefix: str, separator: str) -> Dict[str, float]:
114114
return {prefix + separator + k: v for k, v in metrics_dict.items()}
115-
116-
117-
def prefix_metric_keys(metrics_dict: Dict[str, float], prefix: str) -> Dict[str, float]:
118-
rank_zero_deprecation(
119-
"`pytorch_lightning.callbacks.device_stats_monitor.prefix_metrics`"
120-
" is deprecated in v1.6 and will be removed in v1.8."
121-
)
122-
sep = ""
123-
return _prefix_metric_keys(metrics_dict, prefix, sep)

tests/tests_pytorch/deprecated_api/test_remove_1-8.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@
2121
from pytorch_lightning.demos.boring_classes import BoringModel
2222

2323

24-
def test_v_1_8_0_deprecated_device_stats_monitor_prefix_metric_keys():
25-
from pytorch_lightning.callbacks.device_stats_monitor import prefix_metric_keys
26-
27-
with pytest.deprecated_call(match="in v1.6 and will be removed in v1.8"):
28-
prefix_metric_keys({"foo": 1.0}, "bar")
29-
30-
3124
def test_v1_8_0_remove_on_batch_start_end(tmpdir):
3225
class TestCallback(Callback):
3326
def on_batch_start(self, *args, **kwargs):

0 commit comments

Comments
 (0)