@@ -61,6 +61,8 @@ def __init__(self, precision_plugin: PrecisionPlugin, training_type_plugin: Trai
6161 def connect (self , model : "pl.LightningModule" ) -> None :
6262 """Transfers ownership of the model to this plugin.
6363
64+ See deprecation warning below.
65+
6466 .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
6567 `training_type_plugin.connect` directly.
6668 """
@@ -73,18 +75,10 @@ def connect(self, model: "pl.LightningModule") -> None:
7375 def setup_environment (self ) -> None :
7476 """Setup any processes or distributed connections.
7577
76- .. deprecated:: v1.5
77- This method is deprecated in v1.5 and will be removed in v1.6.
78- Please call `training_type_plugin.setup_environment` directly.
79-
8078 This is called before the LightningModule/DataModule setup hook which allows the user to access the accelerator
8179 environment before setup is complete.
8280 """
83- rank_zero_deprecation (
84- "`Accelerator.setup_environment` is deprecated in v1.5 and will be removed in v1.6. "
85- "`setup_environment` logic is implemented directly in the `TrainingTypePlugin` implementations."
86- )
87- self .training_type_plugin .setup_environment ()
81+ self .accelerator .setup_environment ()
8882
8983 def setup (self , trainer : "pl.Trainer" ) -> None :
9084 """Setup plugins for the trainer fit and creates optimizers.
@@ -189,16 +183,8 @@ def root_device(self) -> torch.device:
189183 def teardown (self ) -> None :
190184 """This method is called to teardown the training process.
191185
192- .. deprecated:: v1.5
193- This method is deprecated in v1.5 and will be removed in v1.6.
194- Please call `training_type_plugin.teardown` directly.
195-
196186 It is the right place to release memory and free other resources.
197187 """
198- rank_zero_deprecation (
199- "`Accelerator.teardown` is deprecated in v1.5 and will be removed in v1.6. "
200- "`teardown` logic is implemented directly in the `TrainingTypePlugin` implementations."
201- )
202188 self .training_type_plugin .teardown ()
203189
204190 def batch_to_device (self , batch : Any , device : Optional [torch .device ] = None , dataloader_idx : int = 0 ) -> Any :
@@ -588,22 +574,17 @@ def get_device_stats(self, device: Union[str, torch.device]) -> Dict[str, Any]:
588574 raise NotImplementedError
589575
590576 def on_train_start (self ) -> None :
591- """Called when train begins.
592-
593- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
594- `training_type_plugin.on_train_start` directly.
595- """
596- rank_zero_deprecation (
597- "`Accelerator.on_train_start` is deprecated in v1.5 and will be removed in v1.6. "
598- "`on_train_start` logic is implemented directly in the `TrainingTypePlugin` implementations."
599- )
577+ """Called when train begins."""
600578 return self .training_type_plugin .on_train_start ()
601579
602580 def on_validation_start (self ) -> None :
603581 """Called when validation begins.
604582
605- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
606- `training_type_plugin.on_validation_start` directly.
583+ See deprecation warning below.
584+
585+ .. deprecated:: v1.5
586+ This method is deprecated in v1.5 and will be removed in v1.6.
587+ Please call `training_type_plugin.on_validation_start` directly.
607588 """
608589 rank_zero_deprecation (
609590 "`Accelerator.on_validation_start` is deprecated in v1.5 and will be removed in v1.6. "
@@ -614,8 +595,11 @@ def on_validation_start(self) -> None:
614595 def on_test_start (self ) -> None :
615596 """Called when test begins.
616597
617- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
618- `training_type_plugin.on_test_start` directly.
598+ See deprecation warning below.
599+
600+ .. deprecated:: v1.5
601+ This method is deprecated in v1.5 and will be removed in v1.6.
602+ Please call `training_type_plugin.on_test_start` directly.
619603 """
620604 rank_zero_deprecation (
621605 "`Accelerator.on_test_start` is deprecated in v1.5 and will be removed in v1.6. "
@@ -626,8 +610,11 @@ def on_test_start(self) -> None:
626610 def on_predict_start (self ) -> None :
627611 """Called when predict begins.
628612
629- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
630- `training_type_plugin.on_predict_start` directly.
613+ See deprecation warning below.
614+
615+ .. deprecated:: v1.5
616+ This method is deprecated in v1.5 and will be removed in v1.6.
617+ Please call `training_type_plugin.on_predict_start` directly.
631618 """
632619 rank_zero_deprecation (
633620 "`Accelerator.on_predict_start` is deprecated in v1.5 and will be removed in v1.6. "
@@ -638,8 +625,11 @@ def on_predict_start(self) -> None:
638625 def on_validation_end (self ) -> None :
639626 """Called when validation ends.
640627
641- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
642- `training_type_plugin.on_validation_end` directly.
628+ See deprecation warning below.
629+
630+ .. deprecated:: v1.5
631+ This method is deprecated in v1.5 and will be removed in v1.6.
632+ Please call `training_type_plugin.on_validation_end` directly.
643633 """
644634 rank_zero_deprecation (
645635 "`Accelerator.on_validation_end` is deprecated in v1.5 and will be removed in v1.6. "
@@ -650,8 +640,11 @@ def on_validation_end(self) -> None:
650640 def on_test_end (self ) -> None :
651641 """Called when test end.
652642
653- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
654- `training_type_plugin.on_test_end` directly.
643+ See deprecation warning below.
644+
645+ .. deprecated:: v1.5
646+ This method is deprecated in v1.5 and will be removed in v1.6.
647+ Please call `training_type_plugin.on_test_end` directly.
655648 """
656649 rank_zero_deprecation (
657650 "`Accelerator.on_test_end` is deprecated in v1.5 and will be removed in v1.6. "
@@ -662,8 +655,11 @@ def on_test_end(self) -> None:
662655 def on_predict_end (self ) -> None :
663656 """Called when predict ends.
664657
665- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
666- `training_type_plugin.on_predict_end` directly.
658+ See deprecation warning below.
659+
660+ .. deprecated:: v1.5
661+ This method is deprecated in v1.5 and will be removed in v1.6.
662+ Please call `training_type_plugin.on_predict_end` directly.
667663 """
668664 rank_zero_deprecation (
669665 "`Accelerator.on_predict_end` is deprecated in v1.5 and will be removed in v1.6. "
@@ -674,8 +670,11 @@ def on_predict_end(self) -> None:
674670 def on_train_end (self ) -> None :
675671 """Called when train ends.
676672
677- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
678- `training_type_plugin.on_train_end` directly.
673+ See deprecation warning below.
674+
675+ .. deprecated:: v1.5
676+ This method is deprecated in v1.5 and will be removed in v1.6.
677+ Please call `training_type_plugin.on_train_end` directly.
679678 """
680679 rank_zero_deprecation (
681680 "`Accelerator.on_train_end` is deprecated in v1.5 and will be removed in v1.6. "
@@ -687,8 +686,11 @@ def on_train_end(self) -> None:
687686 def on_train_batch_start (self , batch : Any , batch_idx : int , dataloader_idx : int = 0 ) -> None :
688687 """Called in the training loop before anything happens for that batch.
689688
690- .. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
691- `training_type_plugin.on_train_batch_start` directly.
689+ See deprecation warning below.
690+
691+ .. deprecated:: v1.5
692+ This method is deprecated in v1.5 and will be removed in v1.6.
693+ Please call `training_type_plugin.on_train_batch_start` directly.
692694 """
693695 rank_zero_deprecation (
694696 "`Accelerator.on_train_batch_start` is deprecated in v1.5 and will be removed in v1.6. "
0 commit comments