Skip to content

Commit 13e64e6

Browse files
authored
Remove deprecated functions from accelerator.py (#9019)
1 parent 92e4979 commit 13e64e6

File tree

2 files changed

+4
-27
lines changed

2 files changed

+4
-27
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
157157
- Removed deprecated `GradInformation` module in favor of `pytorch_lightning.utilities.grads` ([#8831](https://github.com/PyTorchLightning/pytorch-lightning/pull/8831/))
158158

159159

160+
- Removed deprecated `connect_precision_plugin` and `connect_training_type_plugin` from `Accelerator` ([#9019](https://github.com/PyTorchLightning/pytorch-lightning/pull/9019))
161+
162+
160163
### Fixed
161164

162165
- Ensure the existence of `DDPPlugin._sync_dir` in `reconciliate_processes` ([#8939](https://github.com/PyTorchLightning/pytorch-lightning/pull/8939))

pytorch_lightning/accelerators/accelerator.py

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from pytorch_lightning.plugins.precision import ApexMixedPrecisionPlugin, NativeMixedPrecisionPlugin, PrecisionPlugin
2626
from pytorch_lightning.plugins.training_type import TrainingTypePlugin
2727
from pytorch_lightning.trainer.states import TrainerFn
28-
from pytorch_lightning.utilities import _NATIVE_AMP_AVAILABLE, rank_zero_warn
28+
from pytorch_lightning.utilities import _NATIVE_AMP_AVAILABLE
2929
from pytorch_lightning.utilities.apply_func import apply_to_collection, move_data_to_device
3030
from pytorch_lightning.utilities.enums import AMPType, GradClipAlgorithmType, LightningEnum
3131
from pytorch_lightning.utilities.types import STEP_OUTPUT
@@ -429,32 +429,6 @@ def model_sharded_context(self) -> Generator[None, None, None]:
429429
with self.training_type_plugin.model_sharded_context():
430430
yield
431431

432-
# todo: remove in v1.5
433-
def connect_training_type_plugin(self, plugin: TrainingTypePlugin, model: "pl.LightningModule") -> None:
434-
"""
435-
Attaches the training type plugin to the accelerator.
436-
Also transfers ownership of the model to this plugin
437-
438-
.. deprecated::v1.3
439-
Will be removed in v1.5.0.
440-
"""
441-
rank_zero_warn(
442-
"Accelerator method `connect_training_type_plugin` was deprecated in v1.3. It will be removed in v1.5."
443-
)
444-
self.setup_training_type_plugin()
445-
446-
# todo: remove in v1.5
447-
def connect_precision_plugin(self, plugin: PrecisionPlugin) -> None:
448-
"""Attaches the precision plugin to the accelerator
449-
450-
.. deprecated::v1.3
451-
Will be removed in v1.5.0.
452-
"""
453-
rank_zero_warn(
454-
"Accelerator method `connect_precision_plugin` was deprecated in v1.3. It will be removed in v1.5."
455-
)
456-
self.setup_precision_plugin()
457-
458432
def save_checkpoint(self, checkpoint: Dict[str, Any], filepath: str) -> None:
459433
"""Save model/training states as a checkpoint file through state-dump and file-write.
460434

0 commit comments

Comments
 (0)