Toward Attention-Based TinyML: A Heterogeneous Accelerated Architecture and Automated Deployment Flow

Philip Wiese, Gamze Islamoglu, Moritz Scherer, Luka Macan, Victor Jean-Baptiste Jung, Alessio Burrello, Francesco Conti, Luca Benini

TL;DR

This paper introduces a hardware-software co-design that brings power-hungry Transformer models to the extreme edge. By coupling a cluster of latency-tolerant RISC-V cores with a specialized Integer Transformer Accelerator (ITA) through a shared-memory architecture and an automated compiler flow, the researchers achieved a massive 102× improvement in energy efficiency compared to CPU-only execution, hitting a peak of 2960 GOp/J.

What Problem Does This Paper Address?

The "TinyML" revolution has successfully brought Convolutional Neural Networks (CNNs) to microcontrollers (MCUs) for tasks like keyword spotting and anomaly detection. However, the AI world has moved on to Attention-based models (Transformers), which are significantly harder to squeeze into the milliwatt power envelopes of edge devices.

Transformers present two major hurdles for TinyML:

  1. Compute Intensity: They require massive amounts of General Matrix Multiplication (GEMM).
  2. Dataflow Complexity: Operations like Softmax, while mathematically simple, create huge latency bottlenecks because they require frequent data movement and non-linear calculations that standard accelerators aren't built for.

Existing solutions often force a choice between "too general" (slow CPUs) or "too specialized" (rigid accelerators that break when a model changes slightly). This paper seeks a "Goldilocks" middle ground: a flexible, heterogeneous architecture that is easy to program and incredibly efficient.

Methods

The authors propose a two-pronged solution involving a novel hardware template and an automated software deployment flow.

1. The Hardware: Heterogeneous Snitch Cluster

The architecture (shown in Figure 1) centers on a cluster of eight Snitch RISC-V cores. These cores are tiny and "latency-tolerant," meaning they can keep working while waiting for data from memory.

Overview of the Hardware-Software Architecture Template

The secret sauce is how the hardware is connected. Instead of using slow instruction extensions or rigid private memories, they use a Tightly-Coupled Data Memory (TCDM). This allows the CPU cores and the hardware accelerator to share the same 128KB L1 memory pool, enabling seamless collaboration without expensive data copying.

2. The Accelerator: ITA (Integer Transformer Accelerator)

The ITA is a specialized engine designed specifically for 8-bit quantized Transformers. Its standout feature is ITAMax, a streaming Softmax unit.

Architecture of the Integer Transformer Accelerator (ITA)

As shown in Figure 2, ITAMax calculates Softmax "on the fly" as data streams through, avoiding the need to store large intermediate tensors in memory. This eliminates the traditional Softmax bottleneck.

3. The Software: Deeploy Compiler

To make this hardware usable, the team extended Deeploy, a bottom-up DNN compiler. It automatically handles the "tiling" (breaking big tensors into small chunks that fit in L1 memory), schedules tasks between the CPUs and the accelerator, and generates the necessary C code.

Datasets and Workloads

The researchers evaluated their system using three heavy-hitting Transformer-based models:

  • MobileBERT: A compact version of the famous BERT model for natural language tasks.
  • DINOv2-Small: A state-of-the-art vision Transformer.
  • Whisper-Tiny Encoder: The encoder portion of OpenAI's speech-to-text model.

These models were quantized to 8-bit integers to fit the TinyML constraints.

Key Insights and Ideas

  • Shared Memory is Key: By coupling the accelerator and CPUs via a shared L1 TCDM, the system allows the CPUs to handle "messy" auxiliary operations (like layer norms) while the accelerator handles the heavy lifting (GEMM/Attention) without moving data between memory levels.
  • Streaming Softmax: The ITAMax unit proves that you don't need high arithmetic complexity to cause a bottleneck; data movement is the real enemy. Solving Softmax in a streaming fashion is what enables the high utilization (up to 85.1%).
  • Collaborative Execution: The architecture doesn't just offload to the accelerator; it enables the CPUs and accelerator to work in parallel. While the accelerator processes one "tile" of data, the CPUs can prepare the next one or handle final accumulations.

Key Results

The system was implemented in 22nm FD-SOI technology and showed dominant performance across the board:

  • Peak Efficiency: Achieved up to 2960 GOp/J and a throughput of 154 GOp/s at 0.65V.
  • Massive Speedups: Compared to running on the multi-core cluster alone, the ITA accelerator improved throughput by up to 208× and energy efficiency by 102×.
  • Competitive Edge: As shown in the results table (Figure 5), this architecture achieves at least 3.4× more throughput and 5.3× higher energy efficiency than commercial state-of-the-art TinyML devices like the GreenWaves GAP9 or AlifSemi E3.
End-to-End Network Performance Metrics

Limitations and Future Work

While the results are impressive, the authors note a few areas for growth:

  • Sequential Attention: Currently, the ITA processes Multi-Head Attention (MHA) one head at a time. Future iterations could explore parallelizing this further.
  • Model Scope: The current implementation focuses on encoder-only models. Expanding this to full encoder-decoder architectures (like the full Whisper model) would be a logical next step.
  • Hardware Overhead: The HWPE (Hardware Processing Engine) subsystem occupies about 39.3% of the total cluster area, a significant but justified investment for the performance gains.

Summary updated

BibTeX
@article{wiese2025toward,
  author = {Philip Wiese and Gamze Islamoglu and Moritz Scherer and Luka Macan and Victor Jean-Baptiste Jung and Alessio Burrello and Francesco Conti and Luca Benini},
  title = {{Toward Attention-Based TinyML: A Heterogeneous Accelerated Architecture and Automated Deployment Flow}},
  journal = {IEEE Des. Test},
  year = {2025},
  doi = {10.1109/mdat.2025.3527371},
}
Figure