@@ -61,6 +61,8 @@ def __init__(self, precision_plugin: PrecisionPlugin, training_type_plugin: Trai
61
61
def connect (self , model : "pl.LightningModule" ) -> None :
62
62
"""Transfers ownership of the model to this plugin.
63
63
64
+ See deprecation warning below.
65
+
64
66
.. deprecated:: v1.5 This method is deprecated in v1.5 and will be removed in v1.6. Please call
65
67
`training_type_plugin.connect` directly.
66
68
"""
@@ -73,17 +75,9 @@ def connect(self, model: "pl.LightningModule") -> None:
73
75
def setup_environment (self ) -> None :
74
76
"""Setup any processes or distributed connections.
75
77
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
-
80
78
This is called before the LightningModule/DataModule setup hook which allows the user to access the accelerator
81
79
environment before setup is complete.
82
80
"""
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
81
self .training_type_plugin .setup_environment ()
88
82
89
83
def setup (self , trainer : "pl.Trainer" ) -> None :
@@ -189,16 +183,8 @@ def root_device(self) -> torch.device:
189
183
def teardown (self ) -> None :
190
184
"""This method is called to teardown the training process.
191
185
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
-
196
186
It is the right place to release memory and free other resources.
197
187
"""
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
- )
202
188
self .training_type_plugin .teardown ()
203
189
204
190
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]:
588
574
raise NotImplementedError
589
575
590
576
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."""
600
578
return self .training_type_plugin .on_train_start ()
601
579
602
580
def on_validation_start (self ) -> None :
603
581
"""Called when validation begins.
604
582
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.
607
588
"""
608
589
rank_zero_deprecation (
609
590
"`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:
614
595
def on_test_start (self ) -> None :
615
596
"""Called when test begins.
616
597
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.
619
603
"""
620
604
rank_zero_deprecation (
621
605
"`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:
626
610
def on_predict_start (self ) -> None :
627
611
"""Called when predict begins.
628
612
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.
631
618
"""
632
619
rank_zero_deprecation (
633
620
"`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:
638
625
def on_validation_end (self ) -> None :
639
626
"""Called when validation ends.
640
627
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.
643
633
"""
644
634
rank_zero_deprecation (
645
635
"`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:
650
640
def on_test_end (self ) -> None :
651
641
"""Called when test end.
652
642
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.
655
648
"""
656
649
rank_zero_deprecation (
657
650
"`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:
662
655
def on_predict_end (self ) -> None :
663
656
"""Called when predict ends.
664
657
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.
667
663
"""
668
664
rank_zero_deprecation (
669
665
"`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:
674
670
def on_train_end (self ) -> None :
675
671
"""Called when train ends.
676
672
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.
679
678
"""
680
679
rank_zero_deprecation (
681
680
"`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:
687
686
def on_train_batch_start (self , batch : Any , batch_idx : int , dataloader_idx : int = 0 ) -> None :
688
687
"""Called in the training loop before anything happens for that batch.
689
688
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.
692
694
"""
693
695
rank_zero_deprecation (
694
696
"`Accelerator.on_train_batch_start` is deprecated in v1.5 and will be removed in v1.6. "
0 commit comments