Skip to content

Commit

Permalink
small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ttompa committed Dec 24, 2024
1 parent be846c0 commit eba347a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions mace/tools/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,9 @@ def closure():
torch.distributed.barrier()
return total_loss

if torch.distributed.get_rank() == 0:
loss = optimizer.step(closure)
for param in model.parameters():
torch.distributed.broadcast(param.data, src=0)
loss = optimizer.step(closure)
for param in model.parameters():
torch.distributed.broadcast(param.data, src=0)

if ema is not None:
ema.update()
Expand Down

0 comments on commit eba347a

Please sign in to comment.