Skip to main content

clika_runtime

clika-runtime: the Python package of the ClikaRT on-device inference runtime.

Importing this package loads the runtime library shipped in-package (under clika_runtime/lib/). Dependent packages (clika-modelverse) import this package first and resolve the runtime from here.

The top level publishes :class:Tensor, :class:Size, :class:Device, :class:Stream, the dtype objects (float32, bfloat16, ...), the tensor factories (tensor, zeros, randn, ...), every operator of :mod:clika_runtime.ops as a free function (clika_runtime.matmul(a, b)), the placement and execution scopes (device, stream, synchronous, tracing, eager, meta_init), eval / async_eval / synchronize, save / load / load_with_metadata, compile / trace, the device functions, and the exception classes. Modes are strings (approximate="tanh"); the typed enumerations stay under clika_runtime._core.ops. Models are built with :mod:clika_runtime.nn; :mod:clika_runtime.torch (imported on first use, never as a side effect) exchanges tensors and modules with PyTorch.

Execution is asynchronous by default: an operator returns at once and its work rides the calling thread's current lane on the input's device. A value settles when it is read (numpy(), item(), tolist(), print), when eval(*trees) or synchronize() is called, or inside a synchronous() region where every operator completes before it returns. tracing() records operations instead of running them until eval materializes them; eager() restores the default inside a tracing region. Reading the value of a traced or storage-free tensor raises :class:ClikaRTError.

NameKind
ClikaRTErrorclass
CompiledFunctionclass
CompiledModuleclass
Deviceclass
DevicePropertiesclass
InternalErrorclass
InvalidArgumentErrorclass
NotFoundErrorclass
OutOfMemoryErrorclass
QTensorclass
Sizeclass
Streamclass
Tensorclass
TensorSpecclass
TracedGraphclass
UnavailableErrorclass
UnsupportedErrorclass
dtypeclass
finfoclass
iinfoclass
functionsmodule functions