Skip to content

Commit

Permalink
quick fix check_optim_state_in_sync
Browse files Browse the repository at this point in the history
  • Loading branch information
NouamaneTazi committed Nov 25, 2024
1 parent e694f6d commit 46956cf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nanotron/serialize/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def save(
tensor=tied_param, pg=group, msg=lambda err: f"Tied {tied_info.name} are not synced {err}"
)
if not optimizer.inherit_from(optim.ZeroDistributedOptimizer):
check_optim_state_in_sync(optimizer, parallel_context.dp_pg)
check_optim_state_in_sync(optimizer.state_dict(), parallel_context.dp_pg)

# SANITY CHECK: tied parameters have their optimizer states synchronized
# Compute a mapping from id_ to index in the optimizer sense
Expand Down

0 comments on commit 46956cf

Please sign in to comment.