Abstract
The deployment of Deep Learning models on the "extreme edge" of the Internet of Things (IoT) is constrained by severe power budgets. Quantized Neural Networks (QNNs) reduce memory and computational requirements by using sub-byte precision (e.g., 2-bit or 4-bit). However, traditional microcontrollers (MCUs) lack native support for these formats, leading to significant overhead. This paper presents XpulpNN, a set of RISC-V ISA extensions and hardware units designed to accelerate sub-byte QNNs. By integrating multi-precision SIMD units and a fused "Mac&Load" paradigm, XpulpNN achieves up to 2.22 TOPs/s/W, providing two to three orders of magnitude better energy efficiency than commercial ARM Cortex-M microcontrollers.
Introduction
The "extreme edge" of the IoT—encompassing wearable health monitors and smart sensors—requires sophisticated AI capabilities within a razor-thin power budget. To fit Deep Learning models onto tiny microcontrollers (MCUs), researchers employ quantization, shrinking 32-bit weights down to 8, 4 ("nibbles"), or 2 bits ("crumbs").
However, most modern MCUs, such as the ARM Cortex-M series, do not natively support sub-byte arithmetic. Processing these data types typically requires "unpacking" them into larger registers, creating a massive computational tax that wastes cycles and energy on data manipulation. XpulpNN addresses this by introducing hardware that treats sub-byte data types as first-class citizens.
Architecture and Methods
The researchers extended the open-source RI5CY RISC-V core and integrated it into a Parallel Ultra-Low-Power (PULP) cluster of eight cores. The overall system architecture consists of a state-of-the-art (SoA) MCU system connected to the PULP cluster via an AXI interface.
The XpulpNN approach consists of three main pillars:
- Multi-precision Dot-Product (Dotp) Unit: A custom hardware block capable of performing Single Instruction Multiple Data (SIMD) operations. It can handle vectors of two 16-bit, four 8-bit, eight 4-bit, or sixteen 2-bit elements in a single clock cycle.
- XpulpNN ISA Extensions: A new set of instructions added to the RISC-V architecture specifically for 4-bit and 2-bit arithmetic, including additions, subtractions, comparisons, and dot products.
- The "Mac&Load" Paradigm: To overcome the von Neumann bottleneck, the authors introduced fused instructions. The
nnsdotpinstruction performs a dot product while simultaneously triggering a load for the next data element into a dedicated Neural Network Register File (NN-RF).
Experimental Evaluation
The architecture was evaluated using convolution kernels representative of real-world QNN workloads, specifically 3x3 convolutions on 16x16x32 and 32x32x32 input tensors. Performance was benchmarked against the STM32L4 (ARM Cortex-M4) and STM32H7 (ARM Cortex-M7) using the CMSIS-NN library.
Key Results
- Throughput Scaling: By supporting sub-byte SIMD, the system achieves near-linear speedup as precision decreases. Convolution kernels ran 6x faster for 4-bit and 8x faster for 2-bit data compared to a baseline cluster supporting only 8-bit SIMD.
- Operation Efficiency (OPEF): In standard setups, only about 33% of instructions are arithmetic. The "Mac&Load" instructions pushed this efficiency to 0.94, meaning the hardware performs useful math 94% of the time.
- Energy Efficiency: The system achieved a peak efficiency of 2.22 TOPs/s/W, which is two to three orders of magnitude better than high-end ARM Cortex-M7 microcontrollers.
- Area Overhead: Adding support for 2-bit and 4-bit math only increased the core area by 17.5%, a negligible cost given the performance gains.
Discussion and Future Work
XpulpNN demonstrates that software-programmable MCUs can achieve efficiency levels previously reserved for dedicated, inflexible hardware accelerators (ASICs). However, some limitations remain. The dedicated Neural Network Register File (NN-RF) is relatively small, which can limit complex data reuse patterns. Furthermore, while these instructions are currently invoked via C "built-ins," future work aims to improve the GCC toolchain to automatically lower standard math code into specialized XpulpNN instructions.
Summary updated