TL;DR
MLonMCU is an open-source benchmarking framework that automates the complex, end-to-end process of deploying and evaluating machine learning models on microcontrollers. By providing a unified interface for multiple frameworks (like TFLite Micro and TVM) and hardware targets (ARM, RISC-V, Xtensa), it allows researchers to generate hundreds of performance comparisons in under an hour, significantly accelerating the TinyML design cycle.
What Problem Does This Paper Address?
Deploying machine learning on microcontrollers—often called TinyML—is a balancing act. These "extreme edge" devices have tiny memory footprints (often <512 KB RAM) and strict power budgets. Developers must choose between different optimization frameworks (e.g., TensorFlow Lite for Microcontrollers vs. Apache TVM), various model architectures, and a wide array of hardware targets.
Currently, benchmarking these combinations is a manual, fragmented, and time-consuming process. Most existing tools are locked into a specific framework or hardware ecosystem, making fair "apples-to-apples" comparisons nearly impossible. The authors introduce MLonMCU to bridge this gap, providing a framework-independent tool that automates everything from model loading to hardware execution and report generation.
Methods
The authors designed MLonMCU around four core principles: Isolation (using virtual environments), Reproducibility (saving all intermediate artifacts), Parallelism (leveraging multi-core CPUs for builds), and Extensibility.
The tool follows a modular pipeline, as shown in the figure below:

- Load: Frontends import models (e.g.,
.tflitefiles). - Tune: Optional stage for framework-specific optimizations like AutoTVM.
- Build: Backends (like
tflmcortvmaot) convert models into C code. - Compile: Cross-compilers generate binaries for specific ISAs (Instruction Set Architectures).
- Run: The binary is executed on either a simulator (like ETISS for RISC-V) or real hardware via platforms like the Zephyr RTOS.
- Post-process/Evaluate: Results are collected into reports and visualizations.
Datasets
The study utilizes the MLPerf Tiny benchmark suite, which represents common real-world TinyML tasks. The models were evaluated in their 8-bit quantized integer variants to suit resource-constrained hardware.
The hardware targets included a mix of RISC-V (esp32c3), ARM Cortex-M4/M7 (stm32f4/f7), and Xtensa LX6 (esp32) architectures.
Key Insights and Ideas
- Interpreter vs. Compiler: The paper highlights the massive overhead of runtime interpreters. Using a code-generation backend like
tflmc(TFLite Micro Compiler) instead of the standard interpreter (tflmi) can reduce ROM usage by 15–30 kB and significantly lower RAM overhead. - Data Layout is Critical: In TVM, switching from the standard "Channels-Last" (NHWC) layout to "Channels-First" (NCHW) had a dramatic impact on performance, sometimes doubling the speed on certain targets due to better spatial locality in memory.
- The TVM vs. TFLM Trade-off: TVM generally offers superior inference latency thanks to its auto-generated kernels. However, TFLM often wins on memory efficiency for complex models because TVM’s current "legalization" pass upcasts 8-bit tensors to 16-bit, doubling memory usage—a major drawback for tiny devices.
- The Cost of Auto-Tuning: While AutoTVM can significantly speed up models, it requires flashing the microcontroller for every single tuning iteration. This is not only slow but can actually degrade the physical lifetime of the device's flash memory.
Key Results
The authors demonstrated the tool's efficiency by generating 118 end-to-end comparisons in less than 60 minutes on a standard quad-core workstation.
Quantitative highlights from the backend comparisons (Table IV) include:
- Latency: TVM's Ahead-of-Time (
tvmaot) backend achieved the lowest instruction counts across all models. For theawwmodel, it required only ~30 million instructions compared to ~153 million for TFLM backends. - Memory: TFLM's
tflmcbackend was the most memory-efficient for thevwwmodel, using only 342 kB of ROM and 274 kB of RAM, whereas TVM backends often exceeded 500 kB of ROM.
Limitations and Future Work
The authors acknowledge several areas for growth:
- Memory Bloat: TVM’s 16-bit upcasting needs to be addressed to make it more competitive for memory-constrained targets.
- Hardware Accelerators: Future versions should support custom kernel libraries (like CMSIS-NN) and specialized hardware accelerators.
- Power Metrics: While the tool tracks cycles and memory, it does not yet provide direct power consumption measurements, which is a critical metric for battery-operated TinyML devices.
- NAS Integration: The infrastructure could be used to drive Neural Architecture Search (NAS) by providing real-world deployment metrics as feedback to the search algorithm.
Summary updated