pytorch/test
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
..
backward_compatibility [static runtime] Remove ops in static from backwards compatibility checks (#45354) 2020-09-25 14:46:42 -07:00
bottleneck_test
cpp Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
cpp_api_parity Support tuple inputs in NN Module test (#44853) 2020-09-28 22:05:05 -07:00
cpp_extensions Add barrier() at the end of init_process_group and new_group. (#45181) 2020-09-25 15:46:59 -07:00
custom_backend [JIT] Modify to_backend API so that it accepts wrapped modules (#43612) 2020-09-28 17:17:01 -07:00
custom_operator
distributed [Distributed] Adding Python tests for the TCPStore getNumKeys and deleteKey (#45402) 2020-09-28 15:35:24 -07:00
error_messages
expect
fx [resubmit][FX] s/get_param/get_attr/ (#45147) 2020-09-22 17:06:18 -07:00
jit [JIT] Enable @unused syntax for ignoring properties (#45261) 2020-09-29 10:24:25 -07:00
mobile
namespace_b torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
onnx Makes rdiv consistent with div (#45407) 2020-09-29 08:34:01 -07:00
optim
package_a torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
quantization [quant] Add quant APIs to save/load observer state_dict (#44846) 2020-09-29 01:52:42 -07:00
scripts
test_img
type_hint_tests
HowToWriteTestsUsingFileCheck.md
module_a.py torch.package - a way to package models and code (#45015) 2020-09-22 21:21:21 -07:00
print_test_stats.py add circle ci job name dimension to report test stats (#45457) 2020-09-28 20:51:58 -07:00
run_test.py ROCm {emoji:2764} TensorExpr (#45506) 2020-09-29 16:52:16 -07:00
simulate_nccl_errors.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_autograd.py Update backward formula for torch.dot and add backward definition for torch.vdot (#45074) 2020-09-29 12:52:03 -07:00
test_bundled_images.py
test_bundled_inputs.py
test_complex.py
test_cpp_api_parity.py Always use NewModuleTest instead of ModuleTest. (#44745) 2020-09-17 07:36:39 -07:00
test_cpp_extensions_aot.py Fix exception chaining in test/ (#44193) 2020-09-14 14:20:16 -07:00
test_cpp_extensions_jit.py
test_cuda.py Run pytorch_core CUDA tests on GPU using TPX 2020-09-24 12:12:23 -07:00
test_cuda_primary_ctx.py
test_dataloader.py Fix exception chaining in test/ (#44193) 2020-09-14 14:20:16 -07:00
test_determination.py
test_dispatch.py Align casing in test_dispatch with dispatch keys. (#44933) 2020-09-22 10:50:08 -07:00
test_distributions.py Fix exception chaining in test/ (#44193) 2020-09-14 14:20:16 -07:00
test_expecttest.py
test_foreach.py Enable binary ops with Scalar Lists with for foreach APIs (#45298) 2020-09-25 12:58:34 -07:00
test_function_schema.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_functional_autograd_benchmark.py
test_futures.py
test_fx.py Create experimental FX graph manipulation library (#44775) 2020-09-29 15:32:41 -07:00
test_indexing.py
test_jit.py Disable a few tests in preparation to enabling PE+TE (#44815) 2020-09-28 12:55:12 -07:00
test_jit_cuda_fuser.py Disable a few tests in preparation to enabling PE+TE (#44815) 2020-09-28 12:55:12 -07:00
test_jit_cuda_fuser_legacy.py [nvFuser] Latency improvements for pointwise + reduction fusion (#45218) 2020-09-24 23:17:20 -07:00
test_jit_cuda_fuser_profiling.py [nvFuser] Latency improvements for pointwise + reduction fusion (#45218) 2020-09-24 23:17:20 -07:00
test_jit_disabled.py
test_jit_fuser.py Adjust TF32 tests (#44240) 2020-09-24 10:25:58 -07:00
test_jit_fuser_legacy.py
test_jit_fuser_te.py Build shape expressions and remove outputs that are only used by aten::sizes (#45080) 2020-09-28 10:45:56 -07:00
test_jit_legacy.py
test_jit_profiling.py
test_jit_py3.py [JIT] Enable @unused syntax for ignoring properties (#45261) 2020-09-29 10:24:25 -07:00
test_jit_simple.py
test_jit_string.py
test_linalg.py Updates linalg warning + docs (#45415) 2020-09-28 05:28:42 -07:00
test_logging.py
test_mkldnn.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_mobile_optimizer.py Add mobile_optimized tag to optimized model. (#45479) 2020-09-29 10:06:57 -07:00
test_multiprocessing.py
test_multiprocessing_spawn.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_namedtensor.py Fix exception chaining in test/ (#44193) 2020-09-14 14:20:16 -07:00
test_namedtuple_return_api.py
test_native_functions.py Revert D23753711: [pytorch][PR] Add foreach APIs for binary ops with ScalarList 2020-09-24 11:55:49 -07:00
test_nn.py Support tuple inputs in NN Module test (#44853) 2020-09-28 22:05:05 -07:00
test_numba_integration.py
test_op_aliases.py Migrate addr from the TH to Aten (CPU) (#44364) 2020-09-25 01:18:09 -07:00
test_openmp.py
test_ops.py Missing tests about torch.xxx(out=...) (#44465) 2020-09-29 04:54:46 -07:00
test_optim.py Disable multi tensor tesnor tests on rocm (#45535) 2020-09-29 15:49:21 -07:00
test_overrides.py Complex gradcheck logic (#43208) 2020-09-20 22:05:04 -07:00
test_package.py [package] Add dependency viz (#45214) 2020-09-28 15:38:41 -07:00
test_profiler.py Source code level attribution in profiler (#43898) 2020-09-30 00:57:35 -07:00
test_pruning_op.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_quantization.py
test_serialization.py
test_show_pickle.py
test_sparse.py Sparse softmax support (CUDA) (#42307) 2020-09-24 00:07:30 -07:00
test_spectral_ops.py torch.fft: Multi-dimensional transforms (#44550) 2020-09-23 22:09:58 -07:00
test_static_runtime.py [static runtime] Split out graph preparation from runtime (#44131) 2020-09-28 13:01:23 -07:00
test_tensor_creation_ops.py Enable bfloat16 random kernels on Windows (#44918) 2020-09-18 15:55:32 -07:00
test_tensorboard.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_tensorexpr.py
test_throughput_benchmark.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_torch.py Enable transposed tensor copy for complex types (#45487) 2020-09-29 19:22:05 -07:00
test_type_hints.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00
test_type_info.py
test_type_promotion.py [fix] type promotion atan2 (#43466) 2020-09-23 22:23:05 -07:00
test_unary_ufuncs.py Moves some of TestTorchMathOps to OpInfos (#44277) 2020-09-10 17:31:50 -07:00
test_utils.py Fix D23995953 import. 2020-09-29 19:30:23 -07:00
test_vmap.py Add batching rule for "is_complex", "conj" (#44649) 2020-09-16 12:19:46 -07:00
test_vulkan.py
test_xnnpack_integration.py Remove py2 compatible future imports (#44735) 2020-09-16 12:55:57 -07:00