Skip to content

Commit e130918

Browse files
jma127facebook-github-bot
authored andcommitted
Reset both WPS and UPS on first minibatch (facebookresearch#891)
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
1 parent 374f9e5 commit e130918

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

train.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@ def train(args, trainer, task, epoch_itr):
146146
stats[k] = extra_meters[k].avg
147147
progress.log(stats, tag='train', step=stats['num_updates'])
148148

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

153154
num_updates = trainer.get_num_updates()
154155
if (

0 commit comments

Comments
 (0)