Skip to content
heliaAOT
Guides
HELIA HUB

Operator contracts

Most operators need no more than their catalog row. The ones below have a contract worth reading before you rely on them: which inputs they take, what the generated code calls, and where the result can differ from LiteRT. Boolean operators have their own page.

The INT32 and floating-point routes call heliaCORE directly, with the dependency described in the installation guide. The Ethos-U fence is an identity copy and calls no kernel.

EQUAL, NOT_EQUAL, GREATER, GREATER_EQUAL, LESS and LESS_EQUAL take unquantized INT32 inputs and produce Boolean outputs. Scalar through rank-four operands use singleton broadcasting, and the broadcast output count must fit INT32_MAX / 4.

SELECT_V2 takes a Boolean condition and INT32 x and y tensors with singleton broadcasting through rank eight. All dimensions must be positive and each tensor’s byte count must fit INT32_MAX. Comparisons preserve full-width signed values; selection copies values exactly. Neither path needs float support or scratch. The INT8 and INT16 routes keep their quantized behavior.

GREATER compares FP32 inputs from scalars through rank four using singleton broadcasting. Its Boolean mask takes one byte per result. NaNs compare false, both zero signs compare equal, and subnormal values retain their order. SELECT_V2 broadcasts its Boolean mask and both FP32 payloads independently through rank eight. A scalar is represented by a one-element kernel shape. Legacy LiteRT SELECT is admitted only for an equal-shaped mask, payloads and output. Selection copies the chosen FP32 bits, including signed zero and NaN payloads. Both kernels need positive static dimensions, output storage disjoint from every input, and zero caller scratch.

Modules using either entry require a CORE build with FP32 enabled and ARM_NN_HAS_PREDICATES_F32. These entries require CORE v7.49.0 or later.

For FP32 and FP16 CONV_2D, the group count is the input channel count divided by the OHWI filter depth. Both the input channels and output channels must divide evenly across the groups. Each group reads its own contiguous input channels and writes its own output channels. The batch counts must match and the filter must have one row per output channel.

A grouped layer keeps its standard OHWI weights and needs zero kernel scratch for any supported stride, dilation and padding. The generated module calls arm_convolve_f32 or arm_convolve_f16; CORE selects its eligible FP16 small-kernel and channel-multiplier-one implementations. A graph containing a grouped float layer requires CORE grouped convolution support with that precision enabled. Ordinary single-group convolutions retain their existing kernel and packing choices.

DIV lowers FP32 and FP16 operands to heliaCORE’s direct division kernels. Equal layouts use a flat call; scalar through rank-four broadcasting uses compact, left-padded NHWC operands without scratch or expanded tensors. Operand order is preserved, including a scalar numerator. Integer DIV is not supported.

  • Both operands and the output share a dtype and have positive static extents; each tensor’s byte count fits INT32_MAX. FP16 needs an M55-class target.
  • NONE, RELU, RELU_N1_TO_1 and RELU6 use the same dtype-specific activation bounds as float ADD and MUL; unbounded ends are finite dtype limits. NaNs propagate through the clamp. FP16 rounds the quotient to half storage before the activation. No reciprocal-multiply approximation is emitted.
  • The heliaCORE FP16 clamp turns negative zero into positive zero under RELU and RELU6, where LiteRT’s FP32 reference keeps the sign, so fused FP16 division does not promise bitwise parity for signed zero. LiteRT does not run native FP16 DIV; finite FP16 reference checks widen the inputs to FP32 and round the reference output to half precision.
  • heliaCORE’s CMake integration passes -fno-fast-math for the DIV sources under Clang and Armclang; a manual heliaCORE build must keep it.

NEG takes FP32 and FP16 tensors of any rank, scalars included, with identical input and output shapes and positive static dimensions. Tensor byte counts must fit INT32_MAX; FP16 needs a Cortex-M55-class target. The generated layer calls heliaCORE directly, without scratch or arithmetic loops.

Negation toggles the IEEE sign bit: subnormal values and NaN payloads are preserved, and positive and negative zero exchange. Integer NEG is not supported.

SQUARED_DIFFERENCE takes FP32 and FP16 operands with positive static dimensions, scalars included. Equal layouts use the flat entry. Leading singleton axes can differ through rank four. Higher ranks require identical shapes.

Singleton broadcasting through rank four uses the CORE NHWC broadcast entry for the selected precision. The output shape must match the broadcast result and its storage must be disjoint from both inputs. The generated layer uses the original operands directly. This path requires ARM_NN_HAS_SQUARED_DIFFERENCE_BROADCAST_FLOAT from CORE v7.49.0 or later. The flat entry keeps its existing CORE requirement.

  • heliaCORE computes a rounded subtraction followed by a rounded multiplication at the selected precision. NaN payloads are unspecified.
  • Explicit MVE uses its architectural flushing of subnormals, which can differ from scalar gradual underflow. From heliaCORE 7.47.0 the FP32 entry redoes on the scalar FPU each lane whose square MVE flushed, so at round-to-nearest it gives the scalar result, subnormal squares included; releases below the 7.47.0 minimum flush them.
  • FP16 needs a Cortex-M55-class platform. Each tensor’s byte count fits INT32_MAX. The generated layer calls heliaCORE without scratch or activation clamp.

A Vela-compiled model may contain ETHOS_U_STREAM_SPLIT version 1 between ethos-u operators. heliaAOT keeps the marker as an identity-copy operator: each surrounding Ethos-U operator issues its own driver invocation, and the fence runs between them. Identity pruning does not remove it.

  • The fence takes matching nonempty input and output lists; each pair has the same shape, dtype and quantization, and pairs may differ from each other.
  • Internal pairs may carry per-axis metadata; model inputs and outputs need per-tensor quantization, because the I/O descriptors expose one scale and zero point.
  • Each pair independently preserves its eligibility to carry a zero scale from a constant through internal scratch tensors; model I/O and multiple-writer tensors keep the usual safeguards.
  • Version 1 supports int8, uint8, int16, int32, int64, FP16, FP32 and bool. Byte counts come from tensor metadata; packed INT4 and variable-length storage are unsupported.
  • Distinct buffers are copied; an exact alias within a pair is a no-op. Partial overlap, or a destination overlapping another pair, returns an error before any copying. The marker has no options and issues no NPU command.
  • Insert the markers before compiling with Vela, then pass the compiled .tflite to heliaAOT for direct conversion. Execution stays sequential; interleaving another model or yielding to an RTOS needs application or driver scheduling.
  • The producer’s version-1 contract defines the wire format. Splitting can change scheduling, memory use and latency, so measure the resulting model.

RESIZE_BILINEAR selects the CORE FP32 or native FP16 entry from the activation dtype. A model with FP16 weights and FP32 resize activations uses FP32. Both paths use disjoint NHWC input and output buffers, zero caller scratch, and a constant output size. Supported coordinate modes are default, aligned corners and half-pixel centers. Native FP16 requires a target with FP16 support.

The default LiteRT frontend pairs live builtin SIN and COS nodes in the same subgraph when they read the same tensor. Both outputs keep their original tensor IDs and consumers. The paired call runs at the earlier node, so an intervening consumer can use its result. State-changing operators, control flow and custom operators prevent movement across them. Registering a Python parser for either SIN or COS preserves separate parser dispatch for both.

FP32 uses arm_nn_sincos_f32. Native binary16 input and outputs use arm_nn_sincos_f16 on a half-capable target. The input and both outputs must have identical positive static shapes and precision, with at most INT32_MAX bytes each. The generated layer uses three disjoint tensor ranges and zero caller scratch. Explicit casts retain their graph position. An unpaired SIN or COS has no standalone lowering.

These calls require the corresponding ARM_NN_HAS_SINCOS_F32 or ARM_NN_HAS_SINCOS_F16 feature and enabled precision. Both entries require CORE v7.49.0 or later.

The MediaPipe Universal Sentence Encoder float32 v1 timing-signal extract contains COS then SIN on a runtime grid of 192 positions by 50 frequencies. Its rank-two CONCATENATION writes 50 sines then 50 cosines per row. The FP16 qualification uses a separate native FLOAT16 FlatBuffer with the same graph and half-rounded input grid. For this fixture the reference evaluates each exact half input in binary64 and rounds each output to half.

Generated extract Corstone-300 FVP warm SysTick cycles Peak generated DTCM arena Linked image flash bytes
FP32 277,752 153,600 38,308
Native FP16 172,540 76,800 36,176

The measurements cover one generated model run with the paired layer and concatenation on the Cortex-M55 simulator. They exclude angle construction and model initialization. Three warm runs agreed at each precision with SysTick using the processor clock. Linked flash counts GNU size text plus initialized data for the complete firmware, including startup, UART and the measurement harness. The build used Arm GNU 15.3, Cortex-M55 hard-float, -O3 -ffp-contract=fast -fno-math-errno, section garbage collection and CORE revision e32a33a. The source model SHA-256 is 89ad3c74175dd8caa398cc22b657296d94302d20c525c12b58b29420f7249749. For separate physical-board kernel timings see the CORE qualification.

L2_NORMALIZATION normalizes each row along the last dimension. Its FP32 input and output have the same positive, static shape of rank 1–4 and use fused activation NONE. A tensor can occupy at most INT32_MAX bytes. The denominator is the larger of the row’s Euclidean norm and 1e-6, so an all-zero row stays zero.

The generated module calls arm_nn_l2_normalization_f32 with zero caller scratch. Input and output can occupy disjoint buffers or exactly the same scratch slot. An in-place call overwrites the input. Use separate slots if a later operator or graph output needs the original value. When forcing in-place storage in AIR, give later results fresh tensor IDs. AOT requires the input ID’s last use to be the L2 call. A reshape can share that slot before or after normalization when every later reader of the slot wants the normalized value. The output must also preserve other live tensors, such as bias used by a later layer. Partial input/output overlap is rejected.

Build with FP32 enabled and ARM_NN_HAS_L2_NORMALIZATION_F32. The first supported release is CORE v7.49.0.