Skip to content

Commit

Permalink
Fix indent for 2 lines in ZeRO1 (shard.grad = grad_shard, index += 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhataws committed Mar 19, 2024
1 parent ae348b2 commit 8586370
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions torch_xla/distributed/zero_redundancy_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ def step(self, closure=None, **kwargs):

if grad_shard.dtype != self.optimizer_dtype:
grad_shard = grad_shard.to(dtype=self.optimizer_dtype)
shard.grad = grad_shard
index += 1
shard.grad = grad_shard
index += 1

if self.grad_clipping:
# Update unscale/clip with sub partitions
Expand Down

0 comments on commit 8586370

Please sign in to comment.