KinetoStepTracker
- class torch.autograd.profiler.KinetoStepTracker
Provides an abstraction for incrementing the step count globally.
Previously, we only had one place to mark that a step() has occurred in the program via pytorch profiler step(). We will now add step hooks in the Optimizer class pytorch/pytorch#88446
This could mean programs that already call profiler.step() every iteration can end up double incrementing step count.
If a model uses multiple optimizers we can also have double or more counting of the step.
We fix this by adding a layer of abstraction before calling step() to the kineto library. The idea is to maintain steps per requester in a dict: