arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2406.06542cs.ARcs.LG
收藏

vMCU:面向MCU上DNN推理的协同内存管理与内核优化

vMCU: Coordinated Memory Management and Kernel Optimization for DNN Inference on MCUs

School of Computer Science, Peking University(北京大学计算机学院);School of Computer Science & Engineering, University of Washington(华盛顿大学计算机科学与工程学院);OctoAI(OctoAI公司)

Size Zheng, Renze Chen, Meng Li, Zihao Ye, Luis Ceze, Yun Liang

AI总结:

本文提出vMCU,通过将MCU有限内存虚拟化为内存池并进行段级细粒度协同管理,显著降低DNN推理的RAM占用与能耗,缓解低端MCU的内存瓶颈。

摘要:

基于微控制器单元(MCU)的物联网设备为近传感器深度学习模型(DNN)提供了超低功耗和无处不在的计算能力。然而,MCU的内存通常比移动设备小2到3个数量级,这使得将DNN映射到MCU上具有挑战性。以往的工作将MCU的内存管理与内核实现分离,并依赖粗粒度内存管理技术(如原地更新)来减少内存消耗。本文提出在MCU上协同进行DNN推理的内存管理与内核优化,以实现细粒度内存管理。其核心思想是将MCU有限的内存虚拟化为一个大的内存池。每个内核将内存池划分为内核专属的段,并在计算DNN层时处理段的加载和存储。由于采用细粒度的段级内存控制,我们可以在不同张量的内存占用之间进行重叠,而无需同时将其物化,从而降低内存消耗。遵循这一思想,我们实现了用于MCU上DNN推理的vMCU。在ARM Cortex-M4和Cortex-M7处理器上对单层的评估表明,与最先进的工作相比,vMCU可以将RAM使用量降低12.0%至49.5%,并将能耗降低20.6%至53.0%。对于完整DNN的评估,vMCU可以将内存瓶颈降低61.5%,使更多模型能够部署在低端MCU上。

英文摘要:

IoT devices based on microcontroller units (MCU) provide ultra-low power consumption and ubiquitous computation for near-sensor deep learning models (DNN). However, the memory of MCU is usually 2-3 orders of magnitude smaller than mobile devices, which makes it challenging to map DNNs onto MCUs. Previous work separates memory management and kernel implementation for MCU and relies on coarse-grained memory management techniques such as inplace update to reduce memory consumption. In this paper, we propose to coordinate memory management and kernel optimization for DNN inference on MCUs to enable fine-grained memory management. The key idea is to virtualize the limited memory of MCU as a large memory pool. Each kernel divides the memory pool into kernel-specific segments and handles segment load and store while computing DNN layers. Memory consumption can be reduced because using the fine-grained segment-level memory control, we can overlap the memory footprint of different tensors without the need to materialize them at the same time. Following this idea, we implement \ours{} for DNN inference on MCU. Evaluation for single layers on ARM Cortex-M4 and Cortex-M7 processors shows that \ours{} can reduce from $12.0\%$ to $49.5\%$ RAM usage and from $20.6\%$ to $53.0\%$ energy consumption compared to state-of-the-art work. For full DNN evaluation, \ours{} can reduce the memory bottleneck by $61.5\%$, enabling more models to be deployed on low-end MCUs.

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

↑