OpEvent
OpEvent(impl: _C_engine.OpEvent)A single recorded operation event captured by the profiler.
Each OpEvent corresponds to one C++ engine op invocation: name,
wall-clock duration, output tensor 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)
>>> for ev in prof.events():
... print(ev.name, ev.time_us)Methods (9)
__init__
→None__init__(impl: _C_engine.OpEvent)Initialise the instance. See the class docstring for parameter semantics.
name
→strname: strOperation name (e.g. 'matmul', 'add').
time_ns
→inttime_ns: intWall-clock duration of the operation in nanoseconds.
time_us
→floattime_us: floatWall-clock duration in microseconds.
time_ms
→floattime_ms: floatWall-clock duration in milliseconds.
shape
→list[int]shape: list[int]Output tensor shape.
flops
→intflops: intEstimated FLOPs for this operation.
memory_delta_bytes
→intmemory_delta_bytes: intNet memory allocated by this operation in bytes.
__repr__
→str__repr__()Return a developer-facing string representation of the instance.