Add ChromiumEventLogger, log FXGraphCache and AOTAutogradCache (#132864)
Summary:
This PR implements ChromiumEventLogger in all dynamo_timed events. For each dynamo timed call, we log:
- A start event before starting the function execution
- An end event after finishing the function execution
- An extra pair of start/end events for any phase names included in dynamo.
Separately, this also gives us the ability to log instant events. I use them to log cache hits/misses as a first step. The little arrows on the bottom of the UI are cache hits/misses, and you can look at cache details by clicking each triangle.
The outputted chromium trace events can be viewed in perfetto for a timeline of an execution. Here's what it looks like for a run of nanogpt:

And another with warm start:

Trace events are based around the JSON Event format: https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview
We may want to switch to the less deprecated Protobuf format later, but so far I don't see any features we care about supported there.
Internal FB employees can see a link to this in the tlparse output:
https://interncache-all.fbcdn.net/manifold/tlparse_reports/tree/logs/.tmpVi1FIl/dedicated_log_torch_trace_bb4zl_bc.log/index.html
I'll also work on logging these
X-link: https://github.com/pytorch/pytorch/pull/132864
Approved by: https://github.com/aorenste
Reviewed By: fbgheith
Differential Revision: D61069477
Pulled By: jamesjwu
fbshipit-source-id: d9249644d755a0aa4c4280ae8bdaf8163486ead8