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 theTrainer
.The cyclic window skips the first
skip_first
+resumption_batch_idx
batches in every epoch.resumption_batch_idx
is accessed from state.profiler. It is thestate.timestamp.batch_in_epoch
when resuming training. Then, it performs a cycle of skippingwait
batches, warming up forwarmup
batches, and recordingactive
batches. It repeats this cycle up torepeat
times per epoch (or for the entire epoch, ifrepeat
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 to1
.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 to1
.
- Returns
(State -> ProfilerAction) โ A
prof_schedule
for theTrainer
.