mlsanityData to 14 Oct 2026

Optimizing the Deployment of Tiny Transformers on Low-Power MCUs

arXiv 2404.02945 ↗First posted 3 Apr 2024cs.LG cs.AI cs.DCcited by 8

Not on the map. Why?

Abstract (arXiv)

Transformer networks are rapidly becoming SotA in many fields, such as NLP and CV. Similarly to CNN, there is a strong push for deploying Transformer models at the extreme edge, ultimately fitting the tiny power budget and memory footprint of MCUs. However, the early approaches in this direction are mostly ad-hoc, platform, and model-specific. This work aims to enable and optimize the flexible, multi-platform deployment of encoder Tiny Transformers on commercial MCUs. We propose a complete framework to perform end-to-end deployment of Transformer models onto single and multi-core MCUs. Our framework provides an optimized library of kernels to maximize data reuse and avoid unnecessary data marshaling operations into the crucial attention block. A novel MHSA inference schedule, named Fused-Weight Self-Attention, is introduced, fusing the linear projection weights offline to further reduce the number of operations and parameters. Furthermore, to mitigate the memory peak reached by the computation of the attention map, we present a Depth-First Tiling scheme for MHSA. We evaluate our framework on three different MCU classes exploiting ARM and RISC-V ISA, namely the STM32H7, the STM32L4, and GAP9 (RV32IMC-XpulpV2). We reach an average of 4.79x and 2.0x lower latency compared to SotA libraries CMSIS-NN (ARM) and PULP-NN (RISC-V), respectively. Moreover, we show that our MHSA depth-first tiling scheme reduces the memory peak by up to 6.19x, while the fused-weight attention can reduce the runtime by 1.53x, and number of parameters by 25%. We report significant improvements across several Tiny Transformers: for instance, when executing a transformer block for the task of radar-based hand-gesture recognition on GAP9, we achieve a latency of 0.14ms and energy consumption of 4.92 micro-joules, 2.32x lower than the SotA PULP-NN library on the same platform.

Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 35 of its 46 references that are in the map. First posted on arXiv 3 Apr 2024.

Builds on

35 of 46 references.

References · 35

  1. 2017Attention Is All You Needcited by 60,361
  2. 2015Deep Residual Learning for Image Recognitioncited by 52,096
  3. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,399
  4. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 30,186
  5. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,599
  6. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  7. 2022Hierarchical Text-Conditional Image Generation with CLIP Latentscited by 6,585
  8. 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
  9. 2017MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applicationscited by 3,845
  10. 2016Gaussian Error Linear Units (GELUs)cited by 3,502
  11. 2015SSD: Single Shot MultiBox Detectorcited by 3,130
  12. 2023FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioningcited by 2,598
23 more
  1. 2015Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Codingcited by 2,329
  2. 2020Transformers are RNNs: Fast Autoregressive Transformers with Linear Attentioncited by 2,022
  3. 2020Rethinking Attention with Performerscited by 1,601
  4. 2020Linformer: Self-Attention with Linear Complexitycited by 1,474
  5. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,346
  6. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
  7. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 717
  8. 2022Efficiently Scaling Transformer Inferencecited by 539
  9. 2021A Survey of Transformerscited by 401
  10. 2020MCUNet: Tiny Deep Learning on IoT Devicescited by 273
  11. 2018Online normalizer calculation for softmaxcited by 162
  12. 2018CMSIS-NN: Efficient Neural Network Kernels for Arm Cortex-M CPUscited by 121
  13. 2020Data Movement Is All You Need: A Case Study on Optimizing Transformerscited by 108
  14. 2022The Devil in Linear Transformercited by 98
  15. 2020Benchmarking TinyML Systems: Challenges and Directioncited by 91
  16. 2019Trained Quantization Thresholds for Accurate and Efficient Fixed-Point Inference of Deep Neural Networkscited by 90
  17. 2020DORY: Automatic End-to-End Deployment of Real-World DNNs on Low-Cost IoT MCUscited by 58
  18. 2022Hydra Attention: Efficient Attention with Many Headscited by 55
  19. 2019PULP-NN: Accelerating Quantized Neural Networks on Parallel Ultra-Low-Power RISC-V Processorscited by 35
  20. 2020VecQ: Minimal Loss DNN Model Compression With Vectorized Weight Quantizationcited by 15
  21. 2022DeFiNES: Enabling Fast Exploration of the Depth-first Scheduling Space for DNN Accelerators through Analytical Modelingcited by 12
  22. 2020Automatic Kernel Generation for Volta Tensor Corescited by 8
  23. 2024A Tiny Transformer for Low-Power Arrhythmia Classification on Microcontrollerscited by 6

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2024: 2; 2025: 3; 2026: 3.

8 papers.