xlnstorch.benchmark.BenchResult

xlnstorch.benchmark.BenchResult#

class xlnstorch.benchmark.BenchResult(prof, wall_ms, p50, p90, p99, cpu_us=0.0, cpu_mem_mb=0.0, cuda_us=0.0, cuda_mem_mb=0.0)#

A container holding the aggregate numbers of a single benchmark run.

Parameters:
prof#

The profiler output, if profiling was enabled. Otherwise None.

Type:

Optional[torch.profiler.profile]

wall_ms#

Mean wall-clock latency in milliseconds.

Type:

float

p50 / p90 / p99

Percentiles (ms) of the wall-clock distribution.

Type:

float

cpu_us / cuda_us

Self CPU / CUDA time reported by torch.profiler in micro-seconds. Values are zero when profile=False or the respective device is unavailable.

Type:

float

cpu_mem_mb / cuda_mem_mb

Peak memory (mb) reported by torch.profiler. Same fallback rules as above apply.

Type:

float

__init__(prof, wall_ms, p50, p90, p99, cpu_us=0.0, cpu_mem_mb=0.0, cuda_us=0.0, cuda_mem_mb=0.0)#
Parameters:
Return type:

None

Methods

__init__(prof, wall_ms, p50, p90, p99[, ...])

print()

Nicely format the dataclass to stdout (monospaced columns).

save_full_profile(path[, group_by_stack_n, ...])

Attributes

cpu_mem_mb

cpu_us

cuda_mem_mb

cuda_us

prof

wall_ms

p50

p90

p99