HELIA Kernel SPEED vs SIZE
The HELIA backend has a build-time kernel profile that selects between
latency-oriented and footprint-oriented implementations for selected kernels.
This is separate from the overall build flavor (debug, release_with_logs,
or release) and separate from compiler flags such as -O2 or -Os.
The Two Profiles
| Profile | Optimizes for | Effect |
|---|---|---|
| SPEED | Minimum inference latency | Enables speed paths in HELIA kernels |
| SIZE | Smaller HELIA kernel code paths | Trades runtime for footprint where the kernel offers both paths |
The default is SPEED, matching the historical Makefile/prebuilt behavior.
Trade-Offs
quadrantChart
title SPEED vs SIZE
x-axis "Smaller code" --> "Faster inference"
y-axis "Lower power" --> "Higher throughput"
SIZE: [0.25, 0.35]
SPEED: [0.75, 0.75]
| Metric | SPEED | SIZE |
|---|---|---|
| Inference latency | ▼ Lower | ▲ Higher |
| Flash usage | ▲ Larger | ▼ Smaller |
| RAM usage | Kernel-dependent | Kernel-dependent |
| Best for | Real-time audio, always-on wake-word | Battery-first, Flash-constrained |
How to Select
HELIA_RT_GLOBAL_KERNEL_OPTIMIZE accepts SPEED or SIZE.
Advanced source builds can override specific HELIA kernel families:
# SPEED
make ... OPTIMIZED_KERNEL_DIR=helia GLOBAL_KERNEL_OPTIMIZE=SPEED microlite
# SIZE
make ... OPTIMIZED_KERNEL_DIR=helia GLOBAL_KERNEL_OPTIMIZE=SIZE microlite
Per-family overrides are available through CONV_OPT and FC_OPT.
The HELIA backend is selected by default. Choose the kernel profile in
prj.conf:
Current prebuilt release bundles select archives by CPU, toolchain, and
build flavor (debug, release_with_logs, or release). They do not
publish a separate SPEED/SIZE kernel-profile axis. Use the source module
path when you need to choose the HELIA kernel profile explicitly.
Kernel-Level Knobs
The HELIA backend exposes per-kernel optimization overrides in source builds:
This lets you optimize latency-critical operators for SPEED while keeping less critical ones optimized for SIZE.
Next Steps
- Static vs Source — distribution format details
- Toolchains — toolchain choice also affects code size and speed