Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
DuYicong515 committed Feb 25, 2022
1 parent 857127d commit 71adddb
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
8 changes: 2 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,11 +434,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Deprecated `LightningLoggerBase.agg_and_log_metrics` in favor of `LightningLoggerBase.log_metrics` ([#11832](https://github.com/PyTorchLightning/pytorch-lightning/pull/11832))


<<<<<<< HEAD
- Deprecated `BaseProfiler.profile_iterable` ([#12102](https://github.com/PyTorchLightning/pytorch-lightning/pull/12102))
=======


- Deprecated `Trainer.data_parallel_device_ids` ([#12072](https://github.com/PyTorchLightning/pytorch-lightning/pull/12072))
>>>>>>> a4741e264 (rebase)


### Removed
Expand Down Expand Up @@ -606,9 +605,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Removed the `AcceleratorConnector.device_type` property ([#12081](https://github.com/PyTorchLightning/pytorch-lightning/pull/12081))


- Removed deprecated `AcceleratorConnector.parallel_device_ids` property ([#12072](https://github.com/PyTorchLightning/pytorch-lightning/pull/12072))


- Removed `AcceleratorConnector.parallel_device_ids` property ([#12072](https://github.com/PyTorchLightning/pytorch-lightning/pull/12072))


Expand Down
8 changes: 6 additions & 2 deletions tests/callbacks/test_gpu_stats_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_gpu_stats_monitor(tmpdir):
logger=logger,
)

with pytest.deprecated_call(match="`Trainer.data_parallel_device_ids` was deprecated in v1.6."):
with pytest.deprecated_call(
match="Trainer.data_parallel_device_ids` was deprecated in v1.6 and will be removed in v1.8."
):
trainer.fit(model)
assert trainer.state.finished, f"Training failed with {trainer.state}"

Expand Down Expand Up @@ -87,7 +89,9 @@ def test_gpu_stats_monitor_no_queries(tmpdir):
)
with mock.patch(
"pytorch_lightning.loggers.tensorboard.TensorBoardLogger.log_metrics"
) as log_metrics_mock, pytest.deprecated_call(match="`Trainer.data_parallel_device_ids` was deprecated in v1.6."):
) as log_metrics_mock, pytest.deprecated_call(
match="Trainer.data_parallel_device_ids` was deprecated in v1.6 and will be removed in v1.8."
):
trainer.fit(model)

assert log_metrics_mock.mock_calls[1:] == [
Expand Down
6 changes: 4 additions & 2 deletions tests/models/test_gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,12 @@ def test_torchelastic_gpu_parsing(mocked_device_count, mocked_is_available, gpus
assert isinstance(trainer._accelerator_connector.cluster_environment, TorchElasticEnvironment)
assert trainer.gpus == gpus
if rank_zero_only.rank == 0:
with pytest.deprecated_call(match="`Trainer.data_parallel_device_ids` was deprecated in v1.6."):
with pytest.deprecated_call(
match="Trainer.data_parallel_device_ids` was deprecated in v1.6 and will be removed in v1.8."
):
assert (trainer.data_parallel_device_ids or None) == device_parser.parse_gpu_ids(gpus)
else:
assert trainer.data_parallel_device_ids == device_parser.parse_gpu_ids(gpus)
assert (trainer.data_parallel_device_ids or None) == device_parser.parse_gpu_ids(gpus)


@RunIf(min_gpus=1)
Expand Down
4 changes: 3 additions & 1 deletion tests/trainer/test_trainer_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,9 @@ def test_argparse_args_parsing_devices(cli_args, expected_parsed, expected_devic

assert args.devices == expected_parsed
trainer = Trainer.from_argparse_args(args)
with pytest.deprecated_call(match="`Trainer.data_parallel_device_ids` was deprecated in v1.6."):
with pytest.deprecated_call(
match="Trainer.data_parallel_device_ids` was deprecated in v1.6 and will be removed in v1.8."
):
assert trainer.data_parallel_device_ids == expected_device_ids


Expand Down
4 changes: 3 additions & 1 deletion tests/utilities/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ def test_parse_args_parsing_gpus(monkeypatch, cli_args, expected_gpu):
args = parser.parse_args()

trainer = Trainer.from_argparse_args(args)
with pytest.deprecated_call(match="`Trainer.data_parallel_device_ids` was deprecated in v1.6."):
with pytest.deprecated_call(
match="Trainer.data_parallel_device_ids` was deprecated in v1.6 and will be removed in v1.8."
):
assert trainer.data_parallel_device_ids == expected_gpu


Expand Down

0 comments on commit 71adddb

Please sign in to comment.