From a8b6619f56c0d29d67c7068c514a81bad775a41d Mon Sep 17 00:00:00 2001 From: puhuk Date: Wed, 6 Apr 2022 23:44:19 +0900 Subject: [PATCH 1/4] Remove pytorch_lightning.core.memory.get_gpu_memory_map To resolve issue #12521 --- CHANGELOG.md | 2 +- pytorch_lightning/core/memory.py | 9 --------- tests/deprecated_api/test_remove_1-7.py | 6 ------ 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 400fe58b4eaee..d95df378e91e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `prepare_data_per_node` argument from the `Trainer` constructor ([#12536](https://github.com/PyTorchLightning/pytorch-lightning/pull/12536)) -- +- Removed the deprecated `pytorch_lightning.core.memory.get_gpu_memory_map` ([#11111](https://github.com/PyTorchLightning/pytorch-lightning/pull/12593)) - diff --git a/pytorch_lightning/core/memory.py b/pytorch_lightning/core/memory.py index d61164e6d88cb..454402e615d46 100644 --- a/pytorch_lightning/core/memory.py +++ b/pytorch_lightning/core/memory.py @@ -13,15 +13,6 @@ # limitations under the License. from pytorch_lightning.utilities import rank_zero_deprecation -rank_zero_deprecation( - "`pytorch_lightning.core.memory.get_memory_profile` and" - " `pytorch_lightning.core.memory.get_gpu_memory_map` have been moved" - " to `pytorch_lightning.utilities.memory` since v1.5 and will be removed in v1.7." -) - -# To support backward compatibility as get_memory_profile and get_gpu_memory_map have been moved -from pytorch_lightning.utilities.memory import get_gpu_memory_map, get_memory_profile # noqa: E402, F401 # isort: skip - rank_zero_deprecation( "`pytorch_lightning.core.memory.LayerSummary` and" " `pytorch_lightning.core.memory.ModelSummary` have been moved" diff --git a/tests/deprecated_api/test_remove_1-7.py b/tests/deprecated_api/test_remove_1-7.py index 167b3095d91b0..1be79ef2d6ef3 100644 --- a/tests/deprecated_api/test_remove_1-7.py +++ b/tests/deprecated_api/test_remove_1-7.py @@ -51,12 +51,6 @@ def test_v1_7_0_moved_model_summary_and_layer_summary(tmpdir): from pytorch_lightning.core.memory import LayerSummary, ModelSummary # noqa: F401 -def test_v1_7_0_moved_get_memory_profile_and_get_gpu_memory_map(tmpdir): - _soft_unimport_module("pytorch_lightning.core.memory") - with pytest.deprecated_call(match="to `pytorch_lightning.utilities.memory` since v1.5"): - from pytorch_lightning.core.memory import get_gpu_memory_map, get_memory_profile # noqa: F401 - - def test_v1_7_0_deprecated_model_size(): model = BoringModel() with pytest.deprecated_call( From a7b752315eb812b9a3facc3983197c4cbfe3643b Mon Sep 17 00:00:00 2001 From: puhuk Date: Wed, 6 Apr 2022 23:46:49 +0900 Subject: [PATCH 2/4] Change PR id --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d95df378e91e0..9ada4a85cde19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,7 +72,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `prepare_data_per_node` argument from the `Trainer` constructor ([#12536](https://github.com/PyTorchLightning/pytorch-lightning/pull/12536)) -- Removed the deprecated `pytorch_lightning.core.memory.get_gpu_memory_map` ([#11111](https://github.com/PyTorchLightning/pytorch-lightning/pull/12593)) +- Removed the deprecated `pytorch_lightning.core.memory.get_gpu_memory_map` ([#12644](https://github.com/PyTorchLightning/pytorch-lightning/pull/12644)) - From 994b318ef018cdc3f44b43664d70cff6e6686132 Mon Sep 17 00:00:00 2001 From: carmocca Date: Tue, 12 Apr 2022 04:11:18 +0200 Subject: [PATCH 3/4] Remove file --- pytorch_lightning/core/memory.py | 23 ----------------------- setup.cfg | 1 - 2 files changed, 24 deletions(-) delete mode 100644 pytorch_lightning/core/memory.py diff --git a/pytorch_lightning/core/memory.py b/pytorch_lightning/core/memory.py deleted file mode 100644 index 454402e615d46..0000000000000 --- a/pytorch_lightning/core/memory.py +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright The PyTorch Lightning team. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -from pytorch_lightning.utilities import rank_zero_deprecation - -rank_zero_deprecation( - "`pytorch_lightning.core.memory.LayerSummary` and" - " `pytorch_lightning.core.memory.ModelSummary` have been moved" - " to `pytorch_lightning.utilities.model_summary` since v1.5 and will be removed in v1.7." -) - -# To support backward compatibility as LayerSummary and ModelSummary have been moved -from pytorch_lightning.utilities.model_summary import LayerSummary, ModelSummary # noqa: E402, F401 # isort: skip diff --git a/setup.cfg b/setup.cfg index 9f908742c0110..95612febfae77 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,6 @@ filterwarnings = # warnings from deprecated modules on import # TODO: remove in 1.7 ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.decorators - ignore::pytorch_lightning.utilities.rank_zero.LightningDeprecationWarning:pytorch_lightning.core.memory xfail_strict = true junit_duration_report = call From 04520551612caed547a7e4efd0097a8cf03d576e Mon Sep 17 00:00:00 2001 From: carmocca Date: Tue, 12 Apr 2022 04:16:01 +0200 Subject: [PATCH 4/4] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31177dabc0932..2596afd672600 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Removed the deprecated `prepare_data_per_node` argument from the `Trainer` constructor ([#12536](https://github.com/PyTorchLightning/pytorch-lightning/pull/12536)) -- Removed the deprecated `pytorch_lightning.core.memory.get_gpu_memory_map` ([#12644](https://github.com/PyTorchLightning/pytorch-lightning/pull/12644)) +- Removed the deprecated `pytorch_lightning.core.memory.{get_gpu_memory_map,get_memory_profile}` ([#12659](https://github.com/PyTorchLightning/pytorch-lightning/pull/12659)) - Removed the deprecated `terminate_on_nan` argument from the `Trainer` constructor ([#12553](https://github.com/PyTorchLightning/pytorch-lightning/pull/12553))