tristandeleu / pytorch-meta

A collection of extensions and data-loaders for few-shot learning & meta-learning in PyTorch
https://tristandeleu.github.io/pytorch-meta/
MIT License
1.98k stars 256 forks source link

Profiling torchmeta #103

Open brando90 opened 3 years ago

brando90 commented 3 years ago

I wanted to help profile torchmeta.

I was wondering what is the recommended too (to be able to figure out if it's the models or the dataloader that is causing the slow down + have it work even if GPUs are present).

I know only of:

https://pytorch.org/tutorials/recipes/recipes/profiler.html

python -m cProfile -s cumtime main.py > profile.txt

Are these the tools to use for profiling full pytorch code?

sevro commented 3 years ago

I am not familiar with the PyTorch profiler but Nvidia Nsight Systems would probably be useful. This article is focused on model serving but covers how to use it: https://paulbridger.com/posts/video-analytics-pipeline-tuning/

tristandeleu commented 3 years ago

Profiling the code of Torchmeta is a great idea! I don't have much experience with this (other than using pyinstrument occasionally), so any input on that is welcome!