Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
loadams committed Jan 14, 2025
1 parent 8ff83e2 commit b4066f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deepspeed/runtime/zero/stage_1_and_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1692,7 +1692,7 @@ def get_grad_norm_direct(self, gradients, params, norm_type=2):
if is_model_parallel_parameter(p) or (self.model_parallel_rank == 0):
all_norms.append(
torch.linalg.vector_norm(g.data.double().detach(),
ord=norm_type).to(get_accelerator().current_device_name()))
ord=norm_type).to(get_accelerator().current_device_name()))
if len(all_norms) > 0:
total_norm = torch.stack(all_norms).square().sum().float()
else:
Expand Down

0 comments on commit b4066f5

Please sign in to comment.