cyclic_schedule#

composer.profiler.cyclic_schedule(skip_first=0, wait=0, warmup=1, active=4, repeat=1)[source]#

Profiler schedule function for a cyclic profiling window.

This function returns a schedule function that uses a cyclic profiling window. The resulting function can be passed as the prof_schedule argument to the Trainer.

The cyclic window skips the first skip_first batches in every epoch. Then, it performs a cycle of skipping wait batches, warming up for warmup batches, and recording active batches. It repeats this cycle up to repeat times per epoch (or for the entire epoch, if repeat is 0). This logic repeats every epoch.

Parameters
  • skip_first (int, optional) โ€“ Number of batches to skip profiling at epoch start. Defaults to 0.

  • wait (int, optional) โ€“ For each profiling cycle, number of batches to skip at the beginning of the cycle. Defaults to 0.

  • warmup (int, optional) โ€“ For each profiling cycle, number of batches to be in the warmup state after skipping wait batches. Defaults to 1.

  • active (int, optional) โ€“ For each profiling cycle, number of batches to record after warming up. Defaults to 4.

  • repeat (int, optional) โ€“ Number of profiling cycles to perform per epoch. Set to 0 to record the entire epoch. Defaults to 1.

Returns

(State -> ProfilerAction) โ€“ A prof_schedule for the Trainer.