Skip to content

Commit

Permalink
fix grad norm fsdp
Browse files Browse the repository at this point in the history
  • Loading branch information
samsja committed Jul 19, 2024
1 parent 1531aa5 commit e4e4f86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion open_diloco/train_fsdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ def scheduler_fn(opt):
else:
scaler.unscale_(optimizer=optimizer)

torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) # gradient clipping
model.clip_grad_norm_(1.0) # gradient clipping

if world_messenger_hv:
optimizer.step(scaler=scaler)
Expand Down

0 comments on commit e4e4f86

Please sign in to comment.