Skip to content

Commit

Permalink
Reset both WPS and UPS on first minibatch (facebookresearch#891)
Browse files Browse the repository at this point in the history
Summary:
Makes more sense to reset either both meters or neither of them.
Pull Request resolved: fairinternal/fairseq-py#891

Differential Revision: D18109027

Pulled By: jma127

fbshipit-source-id: f63baed9a6b928a6f591a76e69ef6e9c524e4398
  • Loading branch information
jma127 authored and facebook-github-bot committed Oct 24, 2019
1 parent 374f9e5 commit e130918
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion train.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,10 @@ def train(args, trainer, task, epoch_itr):
stats[k] = extra_meters[k].avg
progress.log(stats, tag='train', step=stats['num_updates'])

# ignore the first mini-batch in words-per-second calculation
# ignore the first mini-batch in words-per-second and updates-per-second calculation
if i == 0:
trainer.get_meter('wps').reset()
trainer.get_meter('ups').reset()

num_updates = trainer.get_num_updates()
if (
Expand Down

0 comments on commit e130918

Please sign in to comment.