# RuntimeEstimator#

class composer.callbacks.RuntimeEstimator(skip_batches=1, time_unit='hours')[source]#

Estimates total training time.

The training time is computed by taking the time elapsed for the current duration and multiplying out to the full extended length of the training run.

This callback provides a best attempt estimate. This estimate may be inaccurate if throughput changes through training or other significant changes are made to the model or dataloader.

Example

>>> from composer import Trainer
>>> from composer.callbacks import RuntimeEstimator
>>> # constructing trainer object with this callback
>>> trainer = Trainer(
...     model=model,
...     optimizers=optimizer,
...     max_duration='1ep',
...     callbacks=[RuntimeEstimator()],
... )


The runtime estimate is logged by the Logger to the following key as described below.

Key

Logged data

wall_clock/remaining_estimate

Estimated time to completion

Parameters
• skip_batches (int, optional) – Number of batches to skip before starting clock to estimate remaining time. Typically, the first few batches are slower due to dataloader, cache warming, and other reasons. Defaults to 1.

• time_unit (str, optional) – Time unit to use for wall_clock logging. Can be one of ‘seconds’, ‘minutes’, ‘hours’, or ‘days’. Defaults to ‘hours’.