Stonesjtu / pytorch_memlab

Profiling and inspecting memory in pytorch
MIT License
1.01k stars 37 forks source link

is PyTorch Profiler Used Internally? #39

Closed yzhao062 closed 3 years ago

yzhao062 commented 3 years ago

Great repository! Thanks for creating this :) Just have a quick question. Is pytorch_memlab tracking the memory usage by torch.autograd.profiler? thanks a lot! Just want to clarify this to see if I need to use both :)

yzhao062 commented 3 years ago

from the code I think it is using torch.cuda.memory_stats() Hope my understanding is correct!

Stonesjtu commented 3 years ago

It's not tracking torch.autograd.profiler. The profiling level of this tool is line of python code, while torch.autograd.profiler is torch operation level.

yzhao062 commented 3 years ago

Thanks a lot for the clarification!