Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix order of loss resets. #259

Merged
merged 2 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions open_lm/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@ def train_one_epoch(
# resetting batch / data time meters per log window
batch_time_m.reset()
data_time_m.reset()
# reset all average meters
losses_m.reset()
if averagers is not None and args.log_avg_model_training_loss:
for k in averagers.avgs_dict.keys():
losses_avg_m[k].reset()

if math.isnan(losses_m.val):
# case where loss goes to nan, we see this sometimes with bad nodes.
Expand All @@ -339,6 +334,12 @@ def train_one_epoch(
# training on restarts.
return False, step

# reset all average meters
losses_m.reset()
if averagers is not None and args.log_avg_model_training_loss:
for k in averagers.avgs_dict.keys():
losses_avg_m[k].reset()

# end for
if tb_writer is not None:
tb_writer.flush()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def _read_reqs(relpath):

setuptools.setup(
name="open_lm",
version="0.0.33",
version="0.0.34",
author=[
"Suchin Gururangan*",
"Mitchell Wortsman*",
Expand Down
Loading