Skip to content

Commit

Permalink
Update hf_auto_model_for_causal_lm.py
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Koumparoulis <[email protected]>
  • Loading branch information
akoumpa authored Feb 27, 2025
1 parent c69fdf6 commit e8bd0fa
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ def on_before_optimizer_step(self, optimizer) -> None:
mean_loss = torch.tensor([mean_loss], device=self.device).detach()
dist.all_reduce(mean_loss, group=group, op=dist.ReduceOp.AVG)
mean_loss = mean_loss.item()
tps = torch.tensor([tps], device=self.device, dtype=torch.int64)
tps = torch.tensor([tps], device=self.device, dtype=torch.int64).detach()
dist.all_reduce(tps, group=group, op=dist.ReduceOp.SUM)
tps = tps.item()

Expand Down

0 comments on commit e8bd0fa

Please sign in to comment.