A single recorded event captured by the profiler.
An OpEvent is one op the engine dispatched, or backward work: a
whole backward pass ("backward") or one node of it, named after the
node ("MulBackward", "AccumulateGrad") — which backward
tells apart. Each carries a name, wall-clock duration, shape, an FLOP
estimate and the net memory delta. Profilers expose lists of these
events so that per-op cost can be aggregated, exported, and visualised.
Parameters
implobjectOpEvent handle returned from the C++
profiler.Notes
Durations are reported in nanoseconds at the source; helper properties expose the same value in microseconds and milliseconds for convenience.
Examples
>>> import lucid
>>> with lucid.profiler.profile() as prof:
... y = lucid.randn(64, 64) @ lucid.randn(64, 64)
>>> [ev.name for ev in prof.events()]
['randn', 'randn', 'matmul']
>>> all(ev.time_us >= 0.0 for ev in prof.events()) # timings vary run to run
TrueUsed by 1
Constructors
1Properties
8Whether the event is backward work — a backward pass or one node of it — rather than a dispatched op. A node's shape is its gradient's element count: an eager gradient carries no shape of its own.
Estimated FLOPs for this operation.
Net memory allocated by this operation in bytes.
Operation name (e.g. 'matmul', 'add').
Output tensor shape.
Wall-clock duration in milliseconds.
Wall-clock duration of the operation in nanoseconds.
Wall-clock duration in microseconds.