clika_runtime.profiler
Profile ClikaRT compute work and export the results::
import clika_runtime as crt
with crt.profiler.profile("decode") as prof:
y = (x @ w).relu()
prof.export_chrome_trace("decode_trace.json")
print(prof.summary())
While a capture is active, every op dispatched on the capturing thread (and on the streams it drives) is timed automatically; no per-call instrumentation is needed. Two timing notes:
- Async work a capture covered may finish after the block ends; its spans still record into the session. Synchronize before reading or saving so those late spans are included.
crt.traceruns a callable once on data-free stand-ins (no kernels execute), so profiling around a trace call times the capture itself. Profile aroundgraph.run(...)or a compiled call instead; those execute real ops.
The raw session/capture types are available as
:class:~clika_runtime.profiler.ProfileSession and
:class:~clika_runtime.profiler.CaptureScope for multi-capture flows.
| Name | Kind |
|---|---|
CaptureScope | class |
ProfileSession | class |
profile | class |