Skip to content

Commit

Permalink
[utils] update precision of speed metric (#2524)
Browse files Browse the repository at this point in the history
when `accum_grad` is large, say 16, `steps/sec` might be less than 0.1
  • Loading branch information
xingchensong authored May 12, 2024
1 parent f2372ae commit 704a5bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wenet/utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ def log_per_step(writer, info_dict, timer: Optional[StepTimer] = None):
if info_dict.get("cv_step", None) is not None:
timer_step = info_dict['cv_step']
steps_per_second = timer.steps_per_second(timer_step)
log_str += 'steps/sec {:.1f}| '.format(steps_per_second)
log_str += 'steps/sec {:.3f}| '.format(steps_per_second)
log_str += 'Batch {}/{} loss {:.6f} '.format(
epoch, batch_idx + 1 if 'save_interval' not in info_dict else
(step + 1) * accum_grad,
Expand Down

0 comments on commit 704a5bb

Please sign in to comment.