pytorch/torch/_C
Shivam Raikundalia ac7acfb894 [Profiler] Create Auto-Trace Frontend for Trace ID (#139310)
Summary:
This PR adds Auto-Trace implementation for Trace ID. By default, the python side will generate a uuid in the same format as the one set in the backend by kineto. Upon running an auto-trace, the python generated trace id will overwrite the one set in kineto using the Config variable. Since we don't expect users to generate on-demand traces after an auto-trace we can simply keep overwriting the backend trace id whenever autotrace is ran. If we one day want to eventually do something like this, we simply have to add a call in kineto on the backend to generate a new ID upon start of profiling.

We also implement a custom callback in the frontend such that users can generate their own trace ids if they wish to. This works similarly as the default, only difference being that they have to manually set this callback after a profiler is generated. We use a specific call to set this rather then putting it in the frontend initializer in case users want to change the trace_id for different repeats.

Test Plan: Tested both default and custom callbacks using the verbose prints added. Trace ids on the frontend and the prints on the backend for the manifold upload matched.

Differential Revision: D65178308

Pull Request resolved: https://github.com/pytorch/pytorch/pull/139310
Approved by: https://github.com/shengfukevin
2024-10-31 19:02:57 +00:00
..
_dynamo Back out "[compiled autograd] tls access helpers (#138061)" and Back out "[compiled autograd] Compiled autograd configs in TLS (#137821)" (#139086) 2024-10-28 23:37:05 +00:00
__init__.pyi.in [real tensor prop] Add some asserts for custom ops (#139212) 2024-10-30 19:29:11 +00:00
_aoti.pyi [aoti] Add cpp loader (#135374) 2024-09-11 03:00:01 +00:00
_autograd.pyi [Profiler] Add API for Dynamic Activity Toggling [2/n] (#133035) 2024-08-09 21:54:54 +00:00
_cpu.pyi Extend vectorization with SVE(ARM) with Torch Compile (Inductor) (#134672) 2024-10-10 13:20:40 +00:00
_cudnn.pyi
_cusparselt.pyi [sparse] Add cuSPARSELt as a backend (#128534) 2024-08-21 22:06:07 +00:00
_distributed_autograd.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_distributed_c10d.pyi [c10d][Partial-Graph Overlap] Support calling .wait_tensor() on output tensor of eager async_op=True collective if under allow_inflight_collective_as_graph_input_ctx() context manager (#137763) 2024-10-29 03:31:19 +00:00
_distributed_rpc_testing.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_distributed_rpc.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_functions.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_functorch.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_instruction_counter.pyi Add compile time instruction count metric (#133834) 2024-08-27 23:29:02 +00:00
_itt.pyi
_lazy_ts_backend.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_lazy.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_monitor.pyi Use Generic TypeAlias (PEP 585) and Union Type (PEP 604) in .pyi stub files (#129419) 2024-06-29 09:23:39 +00:00
_nn.pyi.in Add padding_side to pad_sequence with "left" and "right" options ("right" as default) (#131884) 2024-08-07 15:53:07 +00:00
_nvtx.pyi Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
_onnx.pyi [1/N] [Caffe2] Remove caffe2_aten_fallback code (#128675) 2024-06-17 21:25:59 +00:00
_profiler.pyi [Profiler] Create Auto-Trace Frontend for Trace ID (#139310) 2024-10-31 19:02:57 +00:00
_VariableFunctions.pyi.in Flip default value for mypy disallow_untyped_defs [1/11] (#127838) 2024-06-08 18:16:33 +00:00
_verbose.pyi
build.bzl
return_types.pyi.in [torchgen] reference generated comment to actual location of the generator and template (#130020) 2024-07-05 21:47:14 +00:00