[论文解读] FANN-on-MCU: An Open-Source Toolkit for Energy-Efficient Neural Network Inference at the Edge of the Internet of Things
FANN-on-MCU 是一个开源工具包,可在超低功耗微控制器(MCU)上实现能效高效的神经网络推理,目标平台为 ARM Cortex-M 和 RISC-V PULP 架构。该工具将训练好的 FANN 模型编译为针对 MCU 优化的 C 代码,在八核 RISC-V 平台上相比单核 ARM Cortex-M4 实现最高 22 倍的加速和 69% 的能耗降低,推理延迟在微秒量级,功耗低于 1 毫瓦。
The growing number of low-power smart devices in the Internet of Things is coupled with the concept of "Edge Computing", that is moving some of the intelligence, especially machine learning, towards the edge of the network. Enabling machine learning algorithms to run on resource-constrained hardware, typically on low-power smart devices, is challenging in terms of hardware (optimized and energy-efficient integrated circuits), algorithmic and firmware implementations. This paper presents FANN-on-MCU, an open-source toolkit built upon the Fast Artificial Neural Network (FANN) library to run lightweight and energy-efficient neural networks on microcontrollers based on both the ARM Cortex-M series and the novel RISC-V-based Parallel Ultra-Low-Power (PULP) platform. The toolkit takes multi-layer perceptrons trained with FANN and generates code targeted at execution on low-power microcontrollers either with a floating-point unit (i.e., ARM Cortex-M4F and M7F) or without (i.e., ARM Cortex M0-M3 or PULP-based processors). This paper also provides an architectural performance evaluation of neural networks on the most popular ARM Cortex-M family and the parallel RISC-V processor called Mr. Wolf. The evaluation includes experimental results for three different applications using a self-sustainable wearable multi-sensor bracelet. Experimental results show a measured latency in the order of only a few microseconds and a power consumption of few milliwatts while keeping the memory requirements below the limitations of the targeted microcontrollers. In particular, the parallel implementation on the octa-core RISC-V platform reaches a speedup of 22x and a 69% reduction in energy consumption with respect to a single-core implementation on Cortex-M4 for continuous real-time classification.
研究动机与目标
- 解决在计算和内存资源受限的电池供电物联网设备上部署能效神经网络的挑战。
- 实现在低功耗微控制器上对多层感知器的高效推理,涵盖 ARM Cortex-M 和基于 RISC-V 的 PULP 平台。
- 分析在多核超低功耗架构中并行化加速、能耗与内存开销之间的权衡。
- 提供一个实用的开源软件栈,将训练好的 FANN 模型与嵌入式 MCU 上的高效、实时推理相连接。
- 展示通过优化固件和硬件感知编译,可在边缘设备上以极低能耗和延迟运行复杂神经网络的可行性。
提出的方法
- 该工具将 FANN 库中的训练好的多层感知器模型编译为针对微控制器执行而手工优化的 C 代码。
- 支持 32 位 ARM Cortex-M4 和 32 位 RISC-V RI5CY 核心,包括带和不带浮点单元的变体。
- 该框架在 PULP 平台上实现了多核之间的并行推理策略,通过任务分发和内存访问管理最小化开销。
- 优化措施包括定点量化、循环展开和内存访问减少,以最小化能耗和延迟。
- 通过在真实硬件(包括 nRF52832 和 Mr. Wolf(PULP)平台)上进行端到端性能分析,收集运行时和功耗测量数据。
- 系统通过自供能可穿戴多传感器手环在三个真实应用场景中进行评估,以验证能效和实时性能。
实验结果
研究问题
- RQ1如何在内存和处理能力受限的超低功耗微控制器上高效地编译和执行轻量级神经网络框架?
- RQ2在多核 RISC-V 平台与单核 ARM Cortex-M4 上进行神经网络推理时,并行执行在性能和能耗方面有何权衡?
- RQ3FANN-on-MCU 在嵌入式 MCU 上保持模型准确性的前提下,能在多大程度上降低推理延迟和能耗?
- RQ4在多核嵌入式系统中,并行化开销和内存传输如何影响加速比和能效?
- RQ5该框架能否在电池供电的可穿戴设备上实现低功耗、持续的实时分类任务?
主要发现
- 在八核 RISC-V PULP 平台上,与单核 ARM Cortex-M4 实现相比,该并行实现实现了 22 倍加速和 69% 的能耗降低,适用于连续实时分类任务。
- 在 nRF52832(ARM Cortex-M4)上,推理耗时 17.6 ms,能耗为 183.74 µJ;而在 Mr. Wolf(8 核 RISC-V)上,相同任务耗时仅 0.8 ms,能耗为 49.43 µJ,实现 14 倍加速和 73% 能耗降低。
- 对于小型网络,RISC-V 多核实现相比 ARM Cortex-M4 基线实现实现 13.33 倍加速和 85.15% 能耗降低。
- 在所有评估的应用中,该框架实现了亚毫秒级推理延迟(最低达 0.004 ms),功耗低于 10 mW,且内存使用量在 MCU 限制范围内。
- 在 PULP 上的并行方法相比单核最高实现 7.1 倍加速,尽管随着核心数量增加,功耗也上升,凸显了动态核心激活策略的必要性。
- 该工具包证明,具有高达 103,800 次乘加操作的复杂神经网络,可在超低功耗 MCU 上以极低能耗和延迟高效执行。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。