HTVM: Efficient Neural Network Deployment On Heterogeneous TinyML Platforms

Josse Van Delm, Maarten Vandersteegen, Alessio Burrello, Giuseppe Maria Sarda, Francesco Conti, Daniele Jahier Pagliari, Luca Benini, Marian Verhelst

Introduction

The TinyML revolution seeks to deploy deep learning models on battery-powered edge devices for long-term sensing applications. To meet stringent energy efficiency requirements, hardware designers are increasingly adopting heterogeneous Systems-on-Chips (SoCs) that combine general-purpose CPUs with specialized digital accelerators and Analog-in-Memory Computing (AiMC) blocks. However, deploying neural networks on such complex hardware is challenging due to the need for manual memory management (L1 caches) and data orchestration (tiling).

HTVM addresses this challenge by bridging the gap between high-level compilers and specialized TinyML hardware. It is a hybrid compiler that merges the flexibility of Apache TVM with the memory-optimizing capabilities of DORY. By intelligently dispatching tasks across heterogeneous cores, HTVM achieves significant performance gains—up to 120x—over standard TVM deployments.

Methods

The HTVM toolchain integrates several components to automate and optimize the deployment process:

  1. TVM Front-end: The system ingests models from standard formats like ONNX or TFLite, applying high-level graph optimizations such as constant folding.
  2. Rule-Based Dispatching: A pattern matcher identifies network segments suitable for hardware acceleration. For instance, 8-bit convolutions are offloaded to digital accelerators, while ternary-weight layers are directed to analog cores. Operations not supported by accelerators fall back to TVM-generated CPU kernels.
  3. DORY Backend Integration: For accelerator-eligible layers, HTVM utilizes DORY to solve a constraint programming problem for optimal "tiling." This process breaks large tensors into smaller chunks that fit within the chip's limited L1 memory.
  4. Hardware-Aware Tiling Heuristics: HTVM employs heuristics tailored to the target hardware (e.g., the DIANA SoC). It optimizes tile sizes to maximize the utilization of Processing Element (PE) arrays and DMA throughput.
HTVM Toolchain Architecture

Experimental Setup

The researchers evaluated HTVM using the MLPerf™ Tiny benchmark suite (v1.0), which includes representative edge AI workloads:

  • DS-CNN: Keyword spotting for audio applications.
  • MobileNet V1: Visual wake words for person detection.
  • ResNet: Image classification on the CIFAR-10 dataset.
  • ToyAdmos: Anomaly detection for industrial monitoring.

Key Insights

  • Hardware-Aware Tiling: Selecting tile sizes that align with physical hardware dimensions (e.g., 16x16 PE arrays) yielded up to a 6.2x speedup compared to hardware-agnostic tiling strategies.
  • Mixed-Mode Execution: HTVM enables the simultaneous use of multiple accelerators within a single network. Offloading different layers to digital and analog cores reduced latency by 8x compared to single-accelerator configurations.
  • Binary Size Efficiency: By generating coarse-grained accelerator instructions instead of verbose CPU code, HTVM reduced final binary sizes by up to 12.3%, preserving precious flash memory.

Key Results

Benchmarking on the DIANA SoC revealed substantial improvements over baseline deployments:

  • Massive Speedups: HTVM on DIANA outperformed plain TVM CPU deployments by 120x on ResNet and was 150x faster than optimized ARM CMSIS-NN kernels on an STM32 microcontroller.
  • Near-Peak Performance: Convolutional layers reached within 5.19% and 15.52% of the theoretical peak throughput for analog and digital accelerators, respectively.
  • Low Latency: The DS-CNN keyword spotting task achieved a latency of just 1.69 ms in a mixed-mode configuration.
Performance of Analog and Digital Accelerators

Limitations and Future Work

Despite its efficiency, HTVM has areas for further development. The DIANA SoC's lack of optimization for Depthwise (DW) convolutions results in lower performance for models like MobileNet compared to specialized platforms like GAP9. Additionally, while HTVM automates much of the flow, manually-tuned commercial platforms still hold an edge in some scenarios. Future work includes expanding the Bring Your Own Codegen (BYOC) interface for custom CPU kernels and deepening TVM IR integration for native ternary weight support.

Summary updated

BibTeX
@inproceedings{delm2023htvm,
  author = {Josse Van Delm and Maarten Vandersteegen and Alessio Burrello and Giuseppe Maria Sarda and Francesco Conti and Daniele Jahier Pagliari and Luca Benini and Marian Verhelst},
  title = {{HTVM: Efficient Neural Network Deployment On Heterogeneous TinyML Platforms}},
  booktitle = {DAC},
  year = {2023},
}
Figure