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,
...     train_dataloader=train_dataloader,
...     eval_dataloader=eval_dataloader,
...     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

time/remaining_estimate

Estimated time to completion

time/remaining_estimate_unit

Unit of time specified by user (seconds, minutes, hours, days)

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 time logging. Can be one of โ€˜secondsโ€™, โ€˜minutesโ€™, โ€˜hoursโ€™, or โ€˜daysโ€™. Defaults to โ€˜hoursโ€™.