You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to log throughput of my model in tokens per second using a metric. To this end, I had the following idea:
Register a callback.
This callback stores the start time of each batch in on_train_batch_start().
In on_train_batch_end(), we can compute the throughput for the local process.
Then, log the throughput using a MeanMetric, so that torchmetrics can take care of distributed communication.
However, what is unclear to me, is how to log the metric and how to ensure that it is properly reset. I want to log a value every Trainer.log_every_n_steps steps.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I want to log throughput of my model in tokens per second using a metric. To this end, I had the following idea:
on_train_batch_start()
.on_train_batch_end()
, we can compute the throughput for the local process.MeanMetric
, so that torchmetrics can take care of distributed communication.However, what is unclear to me, is how to log the metric and how to ensure that it is properly reset. I want to log a value every
Trainer.log_every_n_steps
steps.Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions