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
_autograd.pyi
_cpu.pyi Extend vectorization with SVE(ARM) with Torch Compile (Inductor) (#134672) 2024-10-10 13:20:40 +00:00
_cudnn.pyi
_cusparselt.pyi
_distributed_autograd.pyi
_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.pyi
_distributed_rpc_testing.pyi
_functions.pyi
_functorch.pyi
_instruction_counter.pyi
_itt.pyi
_lazy.pyi
_lazy_ts_backend.pyi
_monitor.pyi
_nn.pyi.in
_nvtx.pyi
_onnx.pyi
_profiler.pyi [Profiler] Create Auto-Trace Frontend for Trace ID (#139310) 2024-10-31 19:02:57 +00:00
_VariableFunctions.pyi.in
_verbose.pyi
build.bzl
return_types.pyi.in