Update DDPStrategy to use optimizers property from within class (#11777)

This commit is contained in:
ananthsub 2022-02-07 04:28:37 -08:00 committed by GitHub
parent 7ec1e66e17
commit 0ba25d3cac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -304,7 +304,7 @@ class DDPStrategy(ParallelStrategy):
def _reinit_optimizers_with_post_localSGD(self, warmup_steps: int):
log.detail(f"{self.__class__.__name__}: reinitializing optimizers with post localSGD")
optimizers = self.lightning_module.trainer.optimizers
optimizers = self.optimizers
if self._model_averaging_period is None:
raise ValueError(
"Post-localSGD algorithm is used, but model averaging period is not provided to DDP strategy."