arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.04413cs.LGcs.AR
收藏

Deeploy:在异构微控制器上实现小型语言模型的节能部署

Deeploy: Enabling Energy-Efficient Deployment of Small Language Models On Heterogeneous Microcontrollers

ETH Zürich(苏黎世联邦理工学院);University of Bologna(博洛尼亚大学);Politecnico di Torino(都灵理工大学)

Moritz Scherer, Luka Macan, Victor Jung, Philip Wiese, Luca Bompani, Alessio Burrello, Francesco Conti, Luca Benini

AI总结:

本文提出Deeploy编译器,首次在无外部存储器的多核RISC-V MCU上实现小型语言模型端到端部署,通过自动探索内存与计算权衡,达到每Token 490微焦耳、每秒340 Token的领先能效。

摘要:

随着具身基础模型(EFMs)的兴起,尤其是小型语言模型(SLMs),将Transformer适配到边缘应用已成为一个非常活跃的研究领域。然而,在微控制器(MCU)级芯片上实现SLMs的端到端部署,且无需高带宽片外主存访问,仍然是一个未解决的挑战。在本文中,我们展示了在配备ML指令扩展和硬件神经处理单元(NPU)的多核RISC-V(RV32)MCU上实现高效端到端SLM部署。为了自动化探索在异构(多核+NPU)资源上激进部署SLM所涉及的受限、多维内存与计算权衡,我们引入了Deeploy,一种新颖的深度神经网络(DNN)编译器,它生成高度优化的C代码,仅需极少的运行时支持。我们证明Deeploy能够生成执行SLMs的端到端代码,充分利用RV32内核的指令扩展和NPU:对于一个在TinyStories数据集上训练的SLM,我们首次在无外部存储器的MCU级设备上运行,实现了领先的能耗和吞吐量,达到每Token 490微焦耳,每秒340 Token。

英文摘要:

With the rise of Embodied Foundation Models (EFMs), most notably Small Language Models (SLMs), adapting Transformers for edge applications has become a very active field of research. However, achieving end-to-end deployment of SLMs on microcontroller (MCU)-class chips without high-bandwidth off-chip main memory access is still an open challenge. In this paper, we demonstrate high-efficiency end-to-end SLM deployment on a multicore RISC-V (RV32) MCU augmented with ML instruction extensions and a hardware neural processing unit (NPU). To automate the exploration of the constrained, multi-dimensional memory vs. computation tradeoffs involved in aggressive SLM deployment on heterogeneous (multicore+NPU) resources, we introduce Deeploy, a novel Deep Neural Network (DNN) compiler, which generates highly-optimized C code requiring minimal runtime support. We demonstrate that Deeploy generates end-to-end code for executing SLMs, fully exploiting the RV32 cores' instruction extensions and the NPU: We achieve leading-edge energy and throughput of \SI{490}{\micro\joule \per Token}, at \SI{340}{Token \per \second} for an SLM trained on the TinyStories dataset, running for the first time on an MCU-class device without external memory.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑