benchmark
7ec6d1a8 - Make compilation events visible in profiler (#174191)

Commit
6 days ago
Make compilation events visible in profiler (#174191) Summary: This PR adds RecordFunction support to ChromiumEventLogger so that compilation events (compiled_autograd, dynamo, inductor, etc.) appear in the stock PyTorch profiler traces alongside regular operator calls. Previously, compilation events were only visible through tlparse on structured traces, which wasn't accessible for users doing local profiling. Now users can see compilation phases in their profiler output directly. The implementation hooks into the existing log_event_start/log_event_end flow: when the profiler is enabled, we create a **_RecordFunctionFast** context that mirrors the lifetime of each compilation event. The record functions are stored per-thread and properly cleaned up in both normal exit paths and during reset. <img width="1402" height="752" alt="image" src="https://github.com/user-attachments/assets/6e806b23-2f2d-4164-a7cc-003b5fa41219" /> <img width="1289" height="1269" alt="image" src="https://github.com/user-attachments/assets/641602f5-dfb0-41a3-a63f-68eb06043e85" /> <img width="1525" height="517" alt="image" src="https://github.com/user-attachments/assets/90c78d15-85a1-4b9a-873b-ee9813d283f6" /> Fixes #171220 X-link: https://github.com/pytorch/pytorch/pull/174191 Approved by: https://github.com/Lucaskabela Reviewed By: seemethere Differential Revision: D92903672 fbshipit-source-id: 5f9030e5768ebe6cff30b2ab8a05430059031f67
Author
generatedunixname499836121
Committer
Parents
Loading