Chrome Tracing format export for GPU profiling.
Export GPU profiling data in Chrome Tracing JSON format for visualization.
Usage Pattern:
- Run profiled kernels and collect ProfileEvent list
- Convert to Chrome Tracing JSON
- Write to file
- Open in chrome://tracing
Chrome Tracing Format: { "traceEvents": [ { "name": "kernel_name", "cat": "gpu", "ph": "X", "ts": 1234567.890, "dur": 123.456, "pid": 1, "tid": 1 } ], "displayTimeUnit": "ns" }
Where:
- name: Event name
- cat: Category (always "gpu")
- ph: Phase ("X" for complete events with duration)
- ts: Timestamp in microseconds (start time)
- dur: Duration in microseconds
- pid: Process ID (always 1)
- tid: Thread ID (always 1 for sequential GPU operations)
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert to JSON object string
Equations
- One or more equations did not get rendered due to their size.
Instances For
Chrome Tracing document containing multiple events
- traceEvents : List ChromeTraceEvent
- displayTimeUnit : String
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert to JSON string
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert a ProfileEvent to ChromeTraceEvent.
GPU timestamps are in nanoseconds, Chrome Tracing expects microseconds
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert list of ProfileEvents to ChromeTrace.
Events are sorted by start time for better visualization
Equations
- One or more equations did not get rendered due to their size.
Instances For
Generate Chrome Tracing JSON from ProfileEvents
Equations
Instances For
Write Chrome Tracing JSON to file.
The resulting file can be loaded in chrome://tracing for visualization.
Example: events <- runProfiledKernels writeChromeTrace "gpu_profile.json" events -- Then open chrome://tracing and load gpu_profile.json
Equations
- One or more equations did not get rendered due to their size.