composer.profiler.dataloader_profiler#

Profiler to measure the time it takes the data loader to return a batch.

Classes

DataLoaderProfiler

Records the time it takes the data loader to return a batch.

class composer.profiler.dataloader_profiler.DataLoaderProfiler[source]#

Bases: composer.core.callback.Callback

Records the time it takes the data loader to return a batch.

When used with the Composer Trainer, the data loader profiler is enabled if profiling is enabled.

Works by wrapping the original training and evaluation data loaders and uses the Marker API to record the latency of the wrapped data loader.

The profiler is implemented as a Callback and accesses the training and evaluation data loaders through State.

Note

The Composer Trainer creates an instance of TorchProfiler when tensorboard_trace_handler_dir is provided. The user should not create and directly register an instance of TorchProfiler when using the Composer Trainer.