Skip to content

Commit d2f3035

Browse files
authored
Remove the deprecated code in pl.utilities.device_parser (#16412)
1 parent 365769a commit d2f3035

File tree

3 files changed

+2
-111
lines changed

3 files changed

+2
-111
lines changed

src/pytorch_lightning/CHANGELOG.md

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

5454
- Removed the deprecated code in `pl.utilities.xla_device` ([#16404](https://github.com/Lightning-AI/lightning/pull/16404))
5555

56+
- Removed the deprecated code in `pl.utilities.device_parser` ([#16412](https://github.com/Lightning-AI/lightning/pull/16412))
57+
5658
- Mark the `forward_module` argument as required ([#16386](https://github.com/Lightning-AI/lightning/pull/16386))
5759
* Removed the deprecated `pl_module` argument from the distributed module wrappers
5860
* Removed the deprecated `pytorch_lightning.overrides.base.unwrap_lightning_module` function

src/pytorch_lightning/utilities/device_parser.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

tests/tests_pytorch/deprecated_api/test_remove_2-0.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,6 @@
3333
)
3434
from pytorch_lightning.utilities.cloud_io import atomic_save, get_filesystem, load
3535
from pytorch_lightning.utilities.data import has_iterable_dataset, has_len
36-
from pytorch_lightning.utilities.device_parser import (
37-
determine_root_gpu_device,
38-
is_cuda_available,
39-
num_cuda_devices,
40-
parse_cpu_cores,
41-
parse_gpu_ids,
42-
parse_hpus,
43-
parse_tpu_cores,
44-
)
4536
from pytorch_lightning.utilities.optimizer import optimizer_to_device, optimizers_to_device
4637
from pytorch_lightning.utilities.seed import pl_worker_init_function, reset_seed, seed_everything
4738

@@ -104,29 +95,6 @@ def test_v1_10_deprecated_data_utilities():
10495
has_len(DataLoader(RandomDataset(2, 4)))
10596

10697

107-
def test_v1_10_deprecated_device_parser_utilities():
108-
with pytest.deprecated_call(match="device_parser.determine_root_gpu_device` has been deprecated in v1.8.0"):
109-
determine_root_gpu_device(None)
110-
111-
with pytest.deprecated_call(match="device_parser.is_cuda_available` has been deprecated in v1.8.0"):
112-
is_cuda_available()
113-
114-
with pytest.deprecated_call(match="device_parser.num_cuda_devices` has been deprecated in v1.8.0"):
115-
num_cuda_devices()
116-
117-
with pytest.deprecated_call(match="device_parser.parse_hpus` has been deprecated in v1.8.0"):
118-
parse_hpus(1)
119-
120-
with pytest.deprecated_call(match="device_parser.parse_cpu_cores` has been deprecated in v1.8.0"):
121-
parse_cpu_cores(1)
122-
123-
with pytest.deprecated_call(match="device_parser.parse_gpu_ids` has been deprecated in v1.8.0"):
124-
parse_gpu_ids(None)
125-
126-
with pytest.deprecated_call(match="device_parser.parse_tpu_cores` has been deprecated in v1.8.0"):
127-
parse_tpu_cores(None)
128-
129-
13098
def test_v1_10_deprecated_optimizer_utilities():
13199
with pytest.deprecated_call(match="optimizer.optimizers_to_device` has been deprecated in v1.8.0"):
132100
optimizers_to_device([torch.optim.Adam(torch.nn.Linear(1, 1).parameters())], "cpu")

0 commit comments

Comments
 (0)