megatron.timers.Timer#
- class megatron.timers.Timer(name)#
Bases:
TimerBase
Comment on using barrier: If this flag is passed, then all the caller processes will wait till all reach the timing routine. It is up to the user to make sure all the ranks in barrier_group call it otherwise, it will result in a hang. Comment on barrier_group: By default it is set to None which in torch distributed land, it will result in the global communicator.
- elapsed(reset=True, barrier=False)#
Calculate the elapsed time.
- reset()#
Reset timer.
- start(barrier=False)#
Start the timer.
- stop(barrier=False)#
Stop the timer.