From 81ac28f52c2b830cac469682073e53b7f3d48964 Mon Sep 17 00:00:00 2001 From: Weilong Wu Date: Thu, 23 Feb 2023 18:55:57 +0800 Subject: [PATCH] Revert "fixoptminizer _set_auxiliary_var bug (#50335)" This reverts commit c44005f0f83ca8ba4dda60f15424ac01a80a449f. --- .../fleet/meta_optimizers/ascend/ascend_optimizer.py | 4 ---- .../distributed/fleet/meta_optimizers/meta_optimizer_base.py | 4 ---- .../meta_parallel/sharding/group_sharded_optimizer_stage2.py | 4 ---- python/paddle/incubate/optimizer/lookahead.py | 4 ---- 4 files changed, 16 deletions(-) diff --git a/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_optimizer.py b/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_optimizer.py index b7d22882c82..6db42eb47be 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_optimizer.py +++ b/python/paddle/distributed/fleet/meta_optimizers/ascend/ascend_optimizer.py @@ -236,10 +236,6 @@ class AscendOptimizer(Optimizer): ret_list.append(var) return ret_list - def _set_auxiliary_var(self, key, val): - super()._set_auxiliary_var(key, val) - self.inner_opt._set_auxiliary_var(key, val) - def minimize( self, loss, diff --git a/python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py b/python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py index 9a7660ebd7d..87085a322c3 100644 --- a/python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py +++ b/python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py @@ -25,10 +25,6 @@ class MetaOptimizerBase(Optimizer): self.meta_optimizers_white_list = [] self.meta_optimizers_black_list = [] - def _set_auxiliary_var(self, key, val): - super()._set_auxiliary_var(key, val) - self.inner_opt._set_auxiliary_var(key, val) - def _set_basic_info( self, loss, role_maker, user_defined_optimizer, user_defined_strategy ): diff --git a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py index 639bdf79ac9..00ec12a523f 100644 --- a/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py +++ b/python/paddle/distributed/fleet/meta_parallel/sharding/group_sharded_optimizer_stage2.py @@ -203,10 +203,6 @@ class GroupShardedOptimizerStage2(Optimizer): # Update optimizer parameters and adjust parameter storage and use according to rank. self._update_opt_status() - def _set_auxiliary_var(self, key, val): - super()._set_auxiliary_var(key, val) - self._optim._set_auxiliary_var(key, val) - @paddle.autograd.no_grad() def _sync_params_and_buffers(self): """ diff --git a/python/paddle/incubate/optimizer/lookahead.py b/python/paddle/incubate/optimizer/lookahead.py index bfa08c40556..b1ad5f3ecb0 100644 --- a/python/paddle/incubate/optimizer/lookahead.py +++ b/python/paddle/incubate/optimizer/lookahead.py @@ -144,10 +144,6 @@ class LookAhead(Optimizer): self._global_step_var = None self._k_var = None - def _set_auxiliary_var(self, key, val): - super()._set_auxiliary_var(key, val) - self.inner_optimizer._set_auxiliary_var(key, val) - @framework.dygraph_only @imperative_base.no_grad def step(self): -- GitLab