activation_runtime
Shared activation runtime helpers.
This module centralizes small activation kernels that would otherwise be re-emitted once per node. Two activation families currently use it:
-
Quantized LUT activations (
LOGISTIC,TANH,HARD_SWISHin their int8 form), all of which reduce to the same elementwise gather::output[i] = lut[input[i] + offset] -
Int16
LOGISTIC/TANHwrappers, which are thin boilerplate aroundarm_logistic_s16/arm_tanh_s16with per-node size and quant params.
The helpers here collapse those repeated bodies into a single shared runtime function per distinct kernel, so per-node code shrinks to a thin call wrapper while the hot loop or CMSIS call site is compiled exactly once.
Functions
activation_lut_helper
Return the shared LUT-helper descriptor for dtype.
Parameters:
-
(dtypedtype) –The numpy dtype of the activation's input/output/LUT elements.
Returns:
activation_s16_helper
Return the shared int16 helper descriptor for op_name.
Parameters:
-
(op_namestr) –Activation family name (currently
logisticortanh).
Returns:
collect_activation_helpers
Collect the distinct shared activation helpers required by operators.
Parameters:
-
(operatorslist) –The resolved :class:
AotOperatorinstances for the model.
Returns: