Documentation

Hesper.Profile.Trace

Chrome Tracing format export for GPU profiling.

Export GPU profiling data in Chrome Tracing JSON format for visualization.

Usage Pattern:

  1. Run profiled kernels and collect ProfileEvent list
  2. Convert to Chrome Tracing JSON
  3. Write to file
  4. 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:

A single event in Chrome Tracing format

Instances For
    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

        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.
                    Instances For