Skip to content

Commit

Permalink
fix lint bug in optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
yingtongxiong committed Sep 5, 2023
1 parent e8df22e commit 6ad317e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internlm/solver/optimizer/hybrid_zero_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ def step(self, closure=None):
total_norms[group_name] = self._compute_norm_with_stage(
group_id=group_id,
last_bucket=True,
last_stage=True,
previous_norm=groups_norms[group_id],
)

Expand Down Expand Up @@ -620,9 +619,7 @@ def _step(self, closure=None, norms=None):

# the following operations are performed only on the rank to which parameters are assigned.
if len(single_grad_partition_groups) != 0 and self._clip_grad_norm > 0:
self._unscale_and_clip_grads(
single_grad_partition_groups, list(global_norm_groups.values()), loss_scale
)
self._unscale_and_clip_grads(single_grad_partition_groups, list(global_norm_groups.values()), loss_scale)

# update the parameters
timer("step").start()
Expand Down

0 comments on commit 6ad317e

Please sign in to comment.