pytorch/torch/csrc/jit/python
Ilia Cherniavskii f5c95d5cf1 Source code level attribution in profiler (#43898)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/43898

Adding with_source parameter to enable tracking source code
(filename and line) in profiler for eager, torchscript and autograd
modes

Test Plan:
python test/test_profiler.py
```
Name                                 Self CPU total %  Self CPU total   CPU total %      CPU total        CPU time avg     Number of Calls  Source Location
-----------------------------------  ---------------  ---------------  ---------------  ---------------  ---------------  ---------------  --------------------------------------------
ts_method_1                          10.43%           235.364us        36.46%           822.920us        822.920us        1                test/test_profiler.py(70): test_source
aten::add                            7.52%            169.833us        8.88%            200.439us        200.439us        1                test/test_profiler.py(69): test_source
aten::normal_                        6.26%            141.380us        6.26%            141.380us        141.380us        1                test/test_profiler.py(67): test_source
aten::add                            5.80%            130.830us        8.41%            189.800us        63.267us         3                test/test_profiler.py(72): test_source
aten::sum                            5.02%            113.340us        8.39%            189.475us        189.475us        1                test/test_profiler.py(64): ts_method_1
aten::add                            4.58%            103.346us        6.33%            142.847us        142.847us        1                test/test_profiler.py(62): ts_method_1
aten::mul                            4.05%            91.498us         9.62%            217.113us        217.113us        1                test/test_profiler.py(71): test_source
aten::add                            4.03%            90.880us         5.60%            126.405us        126.405us        1                test/test_profiler.py(58): ts_method_2
aten::empty                          3.49%            78.735us         3.49%            78.735us         19.684us         4                test/test_profiler.py(72): test_source
```

Reviewed By: ngimel

Differential Revision: D23432664

Pulled By: ilia-cher

fbshipit-source-id: 83ad7ebe0c2502494d3b48c4e687802db9c77615
2020-09-30 00:57:35 -07:00
..
init.cpp [quant][graphmode][jit][api] Expose preserved_attrs from finalize to convert_jit (#44490) 2020-09-22 19:37:25 -07:00
init.h
module_python.h
pybind_utils.h Fix Windows build failure after DDP PR merged (#45335) 2020-09-25 12:37:50 -07:00
pybind.h
python_arg_flatten.cpp
python_arg_flatten.h Move torch/csrc/utils/hash.h to c10/util/hash.h. (#42503) 2020-08-29 17:47:00 -07:00
python_custom_class.cpp s/torch::jit::class_/torch::class_/ (#40795) 2020-07-06 15:53:33 -07:00
python_custom_class.h
python_interpreter.cpp Unify boxed function signature between jit and c10 (#37034) 2020-06-29 19:24:26 -07:00
python_ir.cpp [ONNX] Optimize export_onnx api to reduce string and model proto exchange (#44332) 2020-09-27 16:29:08 -07:00
python_ir.h
python_ivalue.h Explicitly decref py::object in ConcretePyObjectHolder and PythonFunctionGuard (#38364) 2020-05-12 20:55:53 -07:00
python_sugared_value.cpp Fix Windows build failure after DDP PR merged (#45335) 2020-09-25 12:37:50 -07:00
python_sugared_value.h Improve sugared value's error message (#42889) 2020-09-18 11:01:40 -07:00
python_tracer.cpp Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
python_tracer.h Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
python_tree_views.cpp [JIT] Add property support for ScriptModules (#42390) 2020-09-14 18:49:21 -07:00
python_tree_views.h
script_init.cpp [JIT] Add default arguments for class types (#45098) 2020-09-22 18:37:44 -07:00
script_init.h
update_graph_executor_opt.cpp
update_graph_executor_opt.h