scope_profiler.chrome_trace_export
Export profiling runs to the Chrome Trace Event format.
The format is understood by chrome://tracing and Perfetto. Each rank is a
process and each recorded thread or asyncio task is a lane in that process.
Functions
| Name | Description |
|---|---|
build_chrome_trace_document | Build one Chrome Trace Event document from a profiling run. |
export_chrome_trace | Write Chrome Trace JSON files, one per input profiling run. |
write_chrome_trace_file | Write a Chrome Trace Event document to filepath. |
build_chrome_trace_documentfunction#
def build_chrome_trace_document(run: ProfilingResults, label: str | None = None, ranks: list[int] | int | None = None, include: list[str] | str | None = None, exclude: list[str] | str | None = None) -> dictBuild one Chrome Trace Event document from a profiling run.
Region durations are emitted in microseconds, as required by the Chrome Trace Event format. GPU and await measurements are preserved in event arguments. Aggregate perf counters are emitted as counter events at the end of their rank timeline.
export_chrome_tracefunction#
def export_chrome_trace(profiling_data: ProfilingResults | Sequence[ProfilingResults], filepath: str | Path, ranks: list[int] | int | None = None, include: list[str] | str | None = None, exclude: list[str] | str | None = None, verbose: bool = True) -> list[Path]Write Chrome Trace JSON files, one per input profiling run.
write_chrome_trace_filefunction#
def write_chrome_trace_file(filepath: str | Path, document: dict) -> PathWrite a Chrome Trace Event document to filepath.