Remove the deprecated `pl.strategies.utils.on_colab_kaggle` function (#16437)

This commit is contained in:
Carlos Mocholí 2023-01-19 15:27:15 +01:00 committed by Luca Antiga
parent df795b45c0
commit 48a407cc86
3 changed files with 2 additions and 13 deletions

View File

@ -67,6 +67,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
* env_prefix
* env_parse
- Removed the deprecated `pl.strategies.utils.on_colab_kaggle` function ([#16437](https://github.com/Lightning-AI/lightning/pull/16437))
- Removed the deprecated code in `pl.core.mixins` ([#16424](https://github.com/Lightning-AI/lightning/pull/16424))
- Removed the deprecated code in `pl.utilities.distributed` ([#16390](https://github.com/Lightning-AI/lightning/pull/16390))

View File

@ -12,7 +12,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import importlib
import os
from inspect import getmembers, isclass
import torch
@ -23,12 +22,6 @@ from lightning_fabric.plugins.precision.utils import _convert_fp_tensor
from lightning_fabric.strategies import _StrategyRegistry
from lightning_fabric.utilities.registry import _is_register_method_overridden
from pytorch_lightning.strategies.strategy import Strategy
from pytorch_lightning.utilities.rank_zero import rank_zero_deprecation
def on_colab_kaggle() -> bool:
rank_zero_deprecation("The function `on_colab_kaggle` has been deprecated in v1.8.0 and will be removed in v2.0.0.")
return bool(os.getenv("COLAB_GPU") or os.getenv("KAGGLE_URL_BASE"))
def _call_register_strategies(registry: _StrategyRegistry, base_module: str) -> None:

View File

@ -18,17 +18,11 @@ from torch.utils.data import DataLoader
from pytorch_lightning.accelerators.cpu import CPUAccelerator
from pytorch_lightning.demos.boring_classes import RandomDataset
from pytorch_lightning.strategies.utils import on_colab_kaggle
from pytorch_lightning.utilities.cloud_io import atomic_save, get_filesystem, load
from pytorch_lightning.utilities.data import has_iterable_dataset, has_len
from pytorch_lightning.utilities.optimizer import optimizer_to_device, optimizers_to_device
def test_v1_10_deprecated_on_colab_kaggle_func():
with pytest.deprecated_call(match="The function `on_colab_kaggle` has been deprecated in v1.8.0"):
on_colab_kaggle()
def test_v1_10_deprecated_cloud_io_utilities(tmpdir):
with pytest.deprecated_call(match="cloud_io.atomic_save` has been deprecated in v1.8.0"):
atomic_save({}, tmpdir / "atomic_save.ckpt")