class
ProfileSummary
ProfileSummary(name: str, events: list[OpEvent])Aggregated timing summary for a single op name across many calls.
Produced by Profiler.key_averages, which buckets the recorded
OpEvent list by op name and exposes total time, average
time, call count, and cumulative FLOP estimate. This is the natural
object for a "top-k by self-time" performance report.
Parameters
namestrOp name shared by all events in the summary.
eventslist of OpEventRecorded events bucketed under
name.Notes
The average is computed as
where is the call count and is the per-call duration in microseconds.
Examples
>>> import lucid
>>> with lucid.profiler.profile() as prof:
... for _ in range(10):
... y = lucid.randn(64, 64) @ lucid.randn(64, 64)
>>> for summary in prof.key_averages()[:3]:
... print(summary)Methods (6)
dunder
__init__
→None__init__(name: str, events: list[OpEvent])Initialise the instance. See the class docstring for parameter semantics.
prop
count
→intcount: intNumber of times this operation was called.
prop
total_time_us
→floattotal_time_us: floatTotal time in microseconds across all calls.
prop
avg_time_us
→floatavg_time_us: floatAverage time in microseconds per call.
prop
total_flops
→inttotal_flops: intTotal FLOPs across all calls.
dunder
__repr__
→str__repr__()Return a developer-facing string representation of the instance.