Skip to content
Projects

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

NameDescription
build_chrome_trace_documentBuild one Chrome Trace Event document from a profiling run.
export_chrome_traceWrite Chrome Trace JSON files, one per input profiling run.
write_chrome_trace_fileWrite 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) -> dict

Build 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) -> Path

Write a Chrome Trace Event document to filepath.