- class composer.callbacks.RuntimeEstimator(skip_batches=1, time_unit='hours')#
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.
>>> 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
Loggerto the following key as described below.
Estimated time to completion
Unit of time specified by user (seconds, minutes, hours, days)
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’.