add docs for profiling PyTorch with py-spy (#30166)
Summary:
This adds developer documentation for profiling PyTorch using py-spy. In my work on `__torch_function__` I found its ability to profile native code and dump flame graphs extremely useful. I'm not aware of another Python sampling profiler with similar functionality.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/30166
Differential Revision: D18625133
Pulled By: ezyang
fbshipit-source-id: cf1b851564a07c9f12fcf1338ac4527f4a3c61c0