Skip to main content
QUICK REVIEW

[论文解读] Measuring what Really Matters: Optimizing Neural Networks for TinyML

Lennart Heim, Andreas Biri|arXiv (Cornell University)|Apr 21, 2021
Advanced Numerical Analysis Techniques被引用 26
一句话总结

该论文表明在 MCUs 上感知指标(延迟、能耗)并不可靠地由 MACC/FLOPs 等代理指标预测,并引入一个面向实现的工具链,在 ARM Cortex‑M 设备上直接为 TinyML 应用基准测试和优化神经网络。

ABSTRACT

With the surge of inexpensive computational and memory resources, neural networks (NNs) have experienced an unprecedented growth in architectural and computational complexity. Introducing NNs to resource-constrained devices enables cost-efficient deployments, widespread availability, and the preservation of sensitive data. This work addresses the challenges of bringing Machine Learning to MCUs, where we focus on the ubiquitous ARM Cortex-M architecture. The detailed effects and trade-offs that optimization methods, software frameworks, and MCU hardware architecture have on key performance metrics such as inference latency and energy consumption have not been previously studied in depth for state-of-the-art frameworks such as TensorFlow Lite Micro. We find that empirical investigations which measure the perceptible metrics - performance as experienced by the user - are indispensable, as the impact of specialized instructions and layer types can be subtle. To this end, we propose an implementation-aware design as a cost-effective method for verification and benchmarking. Employing our developed toolchain, we demonstrate how existing NN deployments on resource-constrained devices can be improved by systematically optimizing NNs to their targeted application scenario.

研究动机与目标

  • 在内存和能耗受限的微控制器上激活边缘计算神经网络的需求动机。
  • 研究优化方法、软件框架和 MCU 硬件架构如何影响感知指标(如延迟和能耗)。
  • 开发一个完整的硬件/软件工具链,在 MCU 上对神经网络进行逐层粒度的测量与优化。
  • 通过将感知指标与架构特征相关联,提供实现硬件感知 TinyML 的设计指南。

提出的方法

  • 开发一个面向实现的基准测试工具链,将神经网络部署到 MCU 上以测量层级延迟和能耗。
  • 量化感知指标与优化技术(量化、CMSIS-NN)在 ARM Cortex-M MCU 上的关系。
  • 比较主机端(TensorFlow/TFLite)与设备端执行,以评估精度损失和内存占用。
  • 使用每次操作延迟 delta = t_m / c_e 来跨体系结构和超参数比较层效率。
  • 分析层类型、内核参数和硬件特性如何影响吞吐量和能耗。
  • 演示在感知指标约束下,硬件感知的神经网络设计如何提升准确性。

实验结果

研究问题

  • RQ1常见的代理指标(例如操作数量)与 Cortex-M MCU 上的实际设备端延迟和能耗的相关性有多强?
  • RQ28 位量化和 CMSIS-NN 对不同网络结构的推理延迟和能耗有何影响?
  • RQ3层类型和超参数如何与 MCU 架构特征互动,以影响感知指标?
  • RQ4实现感知工具链能否可靠地指导 TinyML 部署的 NAS 和神经网络设计?
  • RQ5对于给定网络,哪些硬件目标(MCU 型号)在延迟和能耗之间提供 Pareto 最优权衡?

主要发现

  • 量化在某些情况下将内存占用降低多达 73%,仅有 0.05% 的精度损失。
  • 在设备端使用 CMSIS-NN 加速并结合 8 位量化,取决于层,最高可比启用 FPU 的浮点模型快约 4 倍。
  • 优化在不同层和体系结构上产生非均匀加速;较大的网络(如 ResNet)可实现 29x–35x 的加速,而较小的网络则为 12.9x–16x。
  • 每次操作的延迟随层类型而异,并不能仅靠总操作数来可靠预测;全连接层和卷积层在硬件感知优化中显示显著收益,而深度卷积的收益较小。
  • 在优化和 MCU 之间,延迟和能耗几乎呈完全线性相关(r ≈ 0.995),但最佳硬件选择取决于给定部署的 Pareto 权衡。
  • MCU 的选择可以是 Pareto-efficient(如 F4),单靠代理不足;需要经验性的硬件感知测试。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。