pytorch/test/cpp
Kimish Patel 1b04d99f55 [Pytorch Profiler] Introduce scopes to enableProfiler (#62417)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/62417

This diff adds an option to make enableProfiler enable callbacks only
for certain RecordScopes.
Why?
Profiling has some overhead when we repeatedly execute callbacks for
alls copes. On mobile side when we often have small quantized models
this overhead can be large. We observed that by only profiling top level
op and skipping profiling of other atend ops called within we can limit
this overhead. For example, instead of profling at::conv2d -> at::convolution ->
at::convolution_ and further more if ops like transpose etc. are called,
skipping profiling of those. Of course this limits the visibility, but
at the least this way we get a choice.

Test Plan: Imported from OSS

Reviewed By: ilia-cher

Differential Revision: D29993659

fbshipit-source-id: 852d3ae7822f0d94dc6e507bd4019b60d488ef69
2021-08-13 21:40:15 -07:00
..
api Revert D30279364: [codemod][lint][fbcode/c*] Enable BLACK by default 2021-08-12 11:45:01 -07:00
c10d [Pytorch Profiler] Add support for adding module hierarchy to (#61792) 2021-08-13 21:39:10 -07:00
common
dist_autograd Fix distributed autograd gradients synchronization (#57792) 2021-05-09 17:32:59 -07:00
jit [Pytorch Profiler] Introduce scopes to enableProfiler (#62417) 2021-08-13 21:40:15 -07:00
lite_interpreter_runtime [Pytorch Delegated Backend] Save function name in debug info (#57481) 2021-05-25 13:19:02 -07:00
rpc Remove process_group_agent and faulty_process_group_agent files (#62985) 2021-08-10 15:57:39 -07:00
tensorexpr [nnc] Removed const from all fields in IR. (#62336) 2021-08-03 11:44:36 -07:00
__init__.py remediation of S205607 2020-07-17 17:19:47 -07:00