Arm Vela is an ahead-of-time (AOT) neural network model compiler for the Ethos-U55, Ethos-U65, and Ethos-U85 NPUs. It converts a quantized TensorFlow Lite (.tflite) or TOSA (.tosa) ML model into command streams and encoded constant data for a selected Ethos-U configuration.
This chapter covers Vela 5.1 and later. Use vela --version to identify the installed version and consult its release notes for version-specific changes.
The Vela compiler performs the offline, target-specific part of an Ethos-U deployment:
Striping divides feature maps into smaller regions to reduce the active working set. Cascading feeds each region directly through a sequence of compatible operations, allowing Vela to use rolling buffers instead of storing complete intermediate feature maps.
For the normal deployment flow, see the system overview.
For TFLite output, supported regions become Ethos-U custom operators containing the NPU command stream and related data. Unsupported TFLite operators remain in the model for CPU execution, commonly using TensorFlow Lite Micro reference or CMSIS-NN kernels. Always review compiler warnings and --show-cpu-operations; a successful compilation does not imply that every operation runs on the NPU.
The Vela compiler's cycle and bandwidth figures are cost-model estimates. Use them to guide compiler decisions and compare like-for-like builds. Validate final performance on an FPGA or target silicon; an Arm Fixed Virtual Platform (FVP) can provide approximate behavior.
The Vela compiler runs on Linux, macOS, and Windows. The released package requires Python 3.10 or newer:
Plain pip install considers an already installed version satisfactory and does not necessarily install a newer release. Request an upgrade explicitly:
If PyPI reports a newer package but vela --version still shows the old version, the pip command and the vela executable usually belong to different Python environments. Locate both and compare them:
On Windows use where vela; on Linux or macOS use command -v vela. Activate the intended virtual environment, remove the stale executable from PATH, or upgrade through the Python interpreter associated with that executable. A clean reinstallation in the selected environment is the final fallback:
Use py -m pip ... instead of python -m pip ... on Windows when the Python launcher is how the intended interpreter is selected. Avoid pip without python -m: it is easier for that command to address a different environment.
PyPI supplies wheels for supported host combinations. If no matching wheel is available, pip builds from source and requires Python development headers, CMake, a C99 compiler, and a C++17 compiler. The package depends on FlatBuffers and NumPy 1.23 or newer.
The Vela compiler requires the selected Ethos-U variant and MAC configuration, plus a vela.ini configuration file. The vela.ini file contains System_Config sections that model device memory performance and Memory_Mode sections that define where model data is placed.
For an Edge AI MCU, a Device Family Pack (DFP), available from www.keil.arm.com/packs, can provide the Ethos-U configuration information, including the device-specific vela.ini file. CMSIS-Toolbox exports these resources for the selected device and build context through its MLOps information.
When the DFP does not provide this information, create the equivalent configuration manually as described in Create device-specific vela.ini file.
Only the input ML model file and accelerator configuration are needed for a basic build:
For meaningful scheduling and performance estimates, also select a platform configuration, memory mode, and optimization strategy:
| Option | Description |
|---|---|
| -h, --help | Show command help and exit. |
| --version | Show the installed Vela version and exit. |
| --api-version | Show the deprecated external-API version. Planned for removal. |
| --supported-ops-report | Write SUPPORTED_OPS.md for TFLite operator constraints and exit. |
| --list-config-files | List packaged vela.ini configuration files and exit. |
| --list-configs FILE | List system configurations and memory modes in a vela.ini file and exit. |
| --output-dir DIR | Output directory; defaults to output. |
| --output-format {tflite,raw} | Select the output format; defaults to tflite. Raw output is an .npz archive and requires complete NPU placement. |
| --enable-debug-db | Write an ML model debug database into the output directory. |
| --config FILE | Read a ConfigParser-format vela.ini file. May be supplied more than once; later files can extend or override earlier definitions. |
| --timing | Report time spent in compiler stages. |
| --force-symmetric-int-weights | Force signed integer weight zero-points to zero. |
Raw output holds command streams, weight data, and tensor quantization metadata for Ethos-U regions. It omits CPU regions and therefore is not a general TFLite-to-TOSA conversion format.
| Option | Description and values |
|---|---|
| --accelerator-config TARGET | Select Ethos-U hardware target: ethos-u55-{32,64,128,256}, ethos-u65-{256,512}, or ethos-u85-{128,256,512,1024,2048}. The suffix is the MACs-per-cycle configuration. |
| --system-config NAME | Select [System_Config.NAME] from the configuration files. The internal default provides functional defaults, but a platform-specific definition gives useful scheduling estimates. |
| --memory-mode NAME | Select [Memory_Mode.NAME], which maps constants, arena, and cache to the system's memory areas. |
| --tensor-allocator {LinearAlloc,Greedy,HillClimb} | Choose the tensor allocator; defaults to HillClimb. |
| --max-block-dependency {0,1,2,3} | Deprecated. Set the maximum block-dependency delay between NPU kernel operations; defaults to 3. A lower value can increase execution time. |
| --optimise {Performance,Size} | Performance is the default and minimizes inference time; Size minimizes peak SRAM and ignores the arena-cache size. |
| --arena-cache-size BYTES | Override the selected memory mode's cache capacity for Performance optimization. This is a byte count, not KiB. |
| --cpu-tensor-alignment BYTES | Alignment for CPU tensors, including custom-operator inputs and outputs; defaults to 16. Keep it consistent with the ML inference runtime allocation. |
| --recursion-limit COUNT | Python recursion limit used during compilation; defaults to 1000. |
| --hillclimb-max-iterations COUNT | Maximum HillClimb allocator iterations; defaults to 99999. |
| --cop-format {COP1,COP2} | Select the custom-operator payload metadata format; defaults to COP1. |
| --separate-io-regions | Place custom-operator inputs and outputs into separate logical regions. Requires --cop-format COP2. |
| --ignore-ops OP[,OP...] | Force named TFLite builtin operator types, such as ADD,ARGMAX, onto the CPU. Repeatable and ignored for TOSA. |
| Option | Description |
|---|---|
| --show-cpu-operations | List TFLite operations that were not placed on the NPU. |
| --show-subgraph-io-summary | Summarize every subgraph and its inputs and outputs. |
| --verbose-all | Enable all verbose reports. The resulting output can be very large. |
| --verbose-config | Show resolved system and memory configuration. |
| --verbose-graph | Trace graph rewrites. |
| --verbose-quantization | Show quantization processing. |
| --verbose-packing | Show operation/pass packing. |
| --verbose-performance | Show detailed performance estimates. |
| --verbose-tensor-purpose | Show tensor-purpose assignment. |
| --verbose-tensor-format | Show tensor-format assignment. |
| --verbose-schedule | Show the selected schedule. |
| --verbose-allocation | Show tensor allocation. |
| --verbose-high-level-command-stream | Print the high-level command stream. |
| --verbose-register-command-stream | Print the register command stream. |
| --verbose-operators | List operators. |
| --verbose-weights | Show weight information. |
| --verbose-cycle-estimate | Show cycle-estimation details. |
| --verbose-progress | Show compilation progress. |
Compiling an ML model requires three selections from the Ethos-U configuration:
| Option | Describes |
|---|---|
| --accelerator-config | NPU architecture and MAC configuration. The generated command stream is Ethos-U target-specific. |
| --system-config | Core clock, AXI port mapping, memory clock ratios, burst lengths, latencies, and outstanding transactions used by the cost model. |
| --memory-mode | Placement of constant, arena, and cache memory areas on the AXI-connected memories. |
When a DFP supplies device-specific Ethos-U configuration information and the CMSIS-Toolbox project includes MLOps information, CMSIS-Toolbox places the resolved configuration file in the .cmsis directory. List its available system configurations and memory modes with:
If the project does not provide a device configuration, the Vela installation includes the generic reference file Arm/vela.ini for evaluation, silicon-vendor development, and manual integration. Its parameters do not describe a specific production device. List the installed configuration files and their definitions with:
The generic Arm/vela.ini reference file includes these system configurations:
The reference configuration defines typically memory modes as shown below.
| Memory Mode | const _mem_area | arena _mem_area | cache _mem_area | Content |
|---|---|---|---|---|
| Sram_Only | Axi0 | Axi0 | Axi0 | All model storage uses the memory type selected for Axi0. |
| Shared_Sram | Axi1 | Axi0 | Axi0 | Constants remain in the memory selected for Axi1; arena and cache share the Axi0 memory. |
| Dedicated_Sram | Axi1 | Axi1 | Axi0 | The Axi0 memory is a fast staging cache for an arena in the writable memory selected for Axi1. |
Note that there can be memory mode variants such as Dedicated_Sram_256KB, _384KB, _512KB, and _1024KB that inherit Dedicated_Sram and set arena_cache_size.
The names Axi0 and Axi1 are logical aliases in vela.ini. Their physical memory types come from the selected system configuration.
Ethos-U85 can have up to six AXI port interfaces, which Vela maps to Axi0 and Axi1. The vela.ini parameter <Memory>_ports_used contains the number of physical AXI ports that map to a logical alias.
The vela.ini file, device interconnect, linker placement, MPU/SAU attributes, cache policy, driver region indices, and ML inference runtime tensor arena must agree. The Vela compiler cannot validate the complete firmware memory map.
cache_mem_area does not always create a separate cache allocation. When it resolves to the same memory type as arena_mem_area, the fast-scratch memory region is folded into arena_mem_area. cache_mem_area is a distinct area only when arena_mem_area is in a different memory type.
Ethos-U55 provides one read/write and one read-only AXI port and supports Sram_Only and Shared_Sram modes. Dedicated_Sram places the writable arena in the memory selected for Axi1 while reserving the Axi0 memory for fast staging. Both paths must be writable, so the Dedicated_Sram mode is available on Ethos-U65 and Ethos-U85.
To support a device manually, create a device-specific vela.ini file. Application developers normally obtain this file from the silicon vendor, either directly or from a DFP through CMSIS-Toolbox.
Creating an Ethos-U configuration requires these steps:
The vela.ini, linker, MPU/SAU, cache, and driver settings must describe the same finished device integration.
vela.ini uses Python ConfigParser syntax and is case-sensitive for section names, keys, and values. It contains two section types:
ConfigurationName and ModeName must not contain spaces. A file can define multiple sections of either type; select them with --system-config and --memory-mode. Every property is optional, when omitted it defaults to 1. It is recommended to define every property that affects the target system.
Any section can contain inherit=Part.Name to inherit the values of another section.
The system configuration maps the two logical aliases in vela.ini to memory types and supplies the performance model. axi0_port and axi1_port connect the aliases used by a memory mode to those types; they do not by themselves identify a physical memory or hardware port. Parameters for a memory type are needed only when axi0_port or axi1_port selects that type.
Derive the values from the device data sheet, interconnect description, and measured memory behavior:
These inputs form a scheduling cost model, not a cycle-accurate hardware model. Start with conservative values when the hardware documentation gives a range, then compare compiler estimates and hardware measurements for representative ML models.
| Parameter | Type or values | Description |
|---|---|---|
| core_clock | Float, Hz | Ethos-U core frequency. Scientific notation such as 500e6 is accepted. |
| axi0_port | Sram, Dram, OnChipFlash, OffChipFlash | Memory type assigned to the logical Axi0 alias. |
| axi1_port | Sram, Dram, OnChipFlash, OffChipFlash | Memory type assigned to the logical Axi1 alias. |
| <Memory>_clock_scale | Float, 0.0 to 1.0 | Memory clock/bandwidth scale relative to core_clock. <Memory> is Sram, Dram, OnChipFlash, or OffChipFlash. |
| <Memory>_ports_used | Integer | Number of ports used for memory (used for Sram, Dram, OnChipFlash) |
| <Memory>_burst_length | Integer, bytes | Minimum efficient transfer burst. |
| <Memory>_read_latency | Integer, cycles | Read latency used by the cost model. |
| <Memory>_write_latency | Integer, cycles | Write latency used by the cost model. Use 0 for a read-only memory when appropriate. |
| <Memory>_max_reads | Integer | Maximum outstanding reads. |
| <Memory>_max_writes | Integer | Maximum outstanding writes. Use 0 for a read-only memory when appropriate. |
The option reference lists the full metric set for Sram, Dram, and OffChipFlash, and lists OnChipFlash_clock_scale for on-chip Flash. Use --verbose-config with the installed Vela version to inspect the resolved properties supported by that version.
The values in vela.ini are used by the Vela compiler to optimize the ML model for the target and the output report. They can alter scheduling, buffering, DMA insertion, allocation sizes, and the generated command stream. core_clock is primarily used to convert cycle estimates to time.
| Parameter | Type or values | Description |
|---|---|---|
| const_mem_area | Axi0 or Axi1 | Location for read-only constants, including weights, scales, biases, and constant tensors. |
| arena_mem_area | Axi0 or Axi1 | Location for read/write feature maps, intermediate tensors, and Vela-managed working storage. |
| cache_mem_area | Axi0 or Axi1 | Staging or fast-scratch location. It is separate from the arena only when it resolves to a different memory type from arena_mem_area. |
| arena_cache_size | Integer, bytes | Scheduler's fast-memory budget: the arena target when arena and cache resolve to the same memory type, or the separate staging-cache size when they differ. The CLI --arena-cache-size overrides it for Performance optimization. |
| inherit | Part.Name | Parent section whose parameters are inherited. Child values take precedence. |
The memory-area mapping must be consistent with the Ethos-U driver, the ML inference runtime tensor arena, the linker script, and the physical memory system. These options guide compilation; they do not configure the hardware.
With --optimise Size, the Vela compiler minimizes SRAM use and does not use the arena-cache size. With --optimise Performance, it uses the configured or command-line arena-cache size. If neither is supplied, the compiler uses the maximum addressable size for the selected Ethos-U target.
The linker script places the generated model artifacts and runtime buffers in the physical memories represented by the selected System_Config and Memory_Mode. It does not use the logical names Axi0 and Axi1 directly. Instead, it provides sections or memory regions for the Ethos-U I/O resources.
The linker section names are device- and runtime-specific. The examples provided with this pack use the following section names.
| Vela area | Linker section in examples | Content | Access |
|---|---|---|---|
| const_mem_area | ethos_model | Compiled model, command stream, encoded weights, scales, and other constants | Read-only |
| arena_mem_area | ethos_arena | Input, output, intermediate activations, and scratch storage used by the ML inference runtime | Read-write |
| cache_mem_area | ethos_cache | Optional scratch-fast or staging buffer when it resolves to a different physical memory from arena_mem_area | Read-write |
Different section names can be used, the important property is their physical placement. If arena_mem_area and cache_mem_area resolve to the same memory type, a separate cache section is not required. If they resolve to different memory types, reserve the configured arena_cache_size in the fast memory used for cache_mem_area.
The linker script, MPU/SAU attributes, and CPU cache policy must make every generated region accessible to both the ML inference runtime and the NPU as required. When Cortex-M software and the NPU use different addresses for the same memory, the driver must provide the corresponding address translation. The driver's command-stream and region attributes must also select access paths that match the linker placement.
Validate a new linker configuration by checking:
The driver configuration must select NPU access paths that match the physical placement established by vela.ini and the linker script. For the common embedded output flow, verify these relationships:
| Generated content | Typical compiler memory area | Driver setting |
|---|---|---|
| Command stream | Placed with compiled model constants | NPU_QCONFIG |
| Base region 0: constants and encoded weights | const_mem_area | NPU_REGIONCFG_0 |
| Base region 1: activations and scratch | arena_mem_area | NPU_REGIONCFG_1 |
| Base region 2: optional scratch-fast storage | cache_mem_area | NPU_REGIONCFG_2 |
The numeric values of these driver settings are target-specific. Additional base regions can be present in specialized output flows, so use the generated command stream and the device integration information as the authority. Also configure address translation and cache maintenance when Cortex-M software and the NPU access the same physical memory through different addresses or cache policies.
See Integration for system validation, platform hooks, target-specific driver build configuration, cache maintenance, and address-remapping guidance.
Invoke it with:
Print the effective values while validating a new configuration:
A CMSIS Device Family Pack (DFP) can publish the NPU capabilities, vela.ini file, and matching linker scripts in its DFP description. The CMSIS-Toolbox can then select these resources for the device, processor, and toolchain used by a project.
Declare each integrated NPU with a device feature. The n attribute identifies the Ethos-U variant, m identifies its MAC configuration, and Pname associates it with a processor when the device contains more than one:
Publish the device-specific Vela configuration through the VELA environment:
Add linker scripts as component files. Conditions can select the script that matches a processor and toolchain:
Keep the NPU feature, Vela environment, My_vela.ini, linker scripts, and their conditions consistent. A project that selects a different processor or toolchain must resolve to the corresponding NPU configuration and linker script.
For the complete pack structure and element rules, see:
After compilation, Vela prints a summary report and writes a CSV file in the output directory. The report reflects the selected accelerator configuration, system configuration, memory mode, and optimization strategy.
| Report area | Meaning |
|---|---|
| Configuration | Selected accelerator, system and memory configurations, NPU clock, and design peak memory bandwidth. |
| Memory use | Required storage in each Vela memory type: Sram, Dram, OnChipFlash, or OffChipFlash. The selected system configuration and memory mode determine these memory types. |
| Operator placement | Number and percentage of operators assigned to the CPU and NPU. |
| Memory traffic | Estimated average bandwidth and bytes transferred for feature maps and weights. |
| MACs | Number of multiply-accumulate operations per batch. |
The CSV file uses weights_storage_area for the Vela memory type selected by const_mem_area and feature_map_storage_area for the type selected by arena_mem_area. It reports memory use as a total for each Vela memory type. In Dedicated_Sram_256KB, both data roles resolve to Dram, so dram_memory_used contains their combined requirement. total_npu_encoded_weights covers only encoded weights, not the complete constant area, so it cannot be used to derive the size of arena_mem_area.
Use --verbose-cycle-estimate to add estimated NPU and memory-access cycles, total cycles, inference time, and inferences per second. Use --verbose-performance to generate a per-layer CSV with memory use, cycle estimates, MAC utilization, and the contribution of each layer to the network. The summary report is normally sufficient for configuration comparison; use the per-layer report to investigate the reason for a difference.
Before selecting a device, use the Ethos-U reference systems in the generic Arm/vela.ini file for an initial comparison. They provide example system and memory configurations for estimating performance and memory use, but do not describe a specific production device. After selecting a device, repeat the comparison with its device-specific vela.ini file.
Use the same ML model to test each accelerator, system configuration, and memory mode.
The following example comparison uses the ad_large_int8.tflite MicroNet Large INT8 anomaly-detection model from the Arm ML Zoo and Vela 5.1.0. Other memory is OffChipFlash for the Ethos-U55 system and Dram for the Ethos-U85 system.
To optimize for memory size, compile with --optimise Size:
| Accelerator | System configuration | Memory mode | SRAM | Other memory | Estimated time |
|---|---|---|---|---|---|
| ethos-u55-128 | Ethos_U55_Deep_Embedded | Shared_Sram | 136.00 KiB | 425.36 KiB | 27.816 ms |
| ethos-u85-256 | Ethos_U85_SYS_DRAM_High | Shared_Sram | 136.00 KiB | 419.02 KiB | 1.158 ms |
To optimize for performance, compile with --optimise Performance:
| Accelerator | System configuration | Memory mode | SRAM | Other memory | Estimated time |
|---|---|---|---|---|---|
| ethos-u55-128 | Ethos_U55_Deep_Embedded | Shared_Sram | 390.61 KiB | 425.52 KiB | 5.806 ms |
| ethos-u85-256 | Ethos_U85_SYS_DRAM_High | Shared_Sram | 436.77 KiB | 419.11 KiB | 0.458 ms |
The output directory contains the optimized ML model person_detect_vela.tflite and a report. The optimized model is for deployment to the Edge AI MCU.
The console output shows several details including configuration parameters, memory usage, and with --verbose-cycle-estimate a rough estimation of the inference time.
Size scheduling favors tensor reuse and cascading. It can reread more weights and reduce throughput, so measure both memory and performance.
This supplies a 60 KiB cache budget. Reducing it may increase AXI1 traffic as weights or feature-map data are reread. The reported Total SRAM used covers the model's NPU-visible tensors and working buffers, not the RTOS, stacks, application allocations, CPU kernels, or other firmware state.
The resulting .npz contains the NPU command streams, constants, and quantization metadata required by an integration that consumes raw compiler output.
Start with focused reports. --verbose-all can produce impractically large logs for representative ML models.
On hosts that provide xxd, convert the Vela compiler output to a C array:
Place the generated data in the linker region that matches the memory configuration selected from vela.ini. Ensure that the ML inference runtime registers the Ethos-U custom operator and uses an Ethos-U driver compatible with the compiled command stream.
For the ExecuTorch Arm integration see the official PyTorch Arm Ethos-U backend documentation for the workflow and examples.
| Symptom | Check |
|---|---|
| Most operations run on the CPU | Confirm integer quantization, inspect --show-cpu-operations, and generate --supported-ops-report to check every operator constraint. |
| Compilation succeeds but estimates look unrealistic | Use a platform-specific System_Config; verify clocks, AXI mappings, latency, bandwidth, and memory mode. Compare only builds with the same configuration. |
| Runtime allocation fails | Check the Vela compiler's peak-memory report and add firmware overhead. Align linker regions and the tensor arena with cpu_tensor_alignment and the chosen memory mode. |
| Performance degrades after reducing SRAM | A smaller cache can cause more AXI1 reads. Inspect the performance CSV/report and hardware PMU counters. |
| A wheel is unavailable | Install Python development headers, CMake, and C99/C++17 build tools, or use a supported host/Python combination. |
| Output does not run on the target | Recompile for the exact Ethos-U architecture/MAC configuration and keep vela.ini, driver, linker, and memory-region configuration consistent. |