arXiv:2603.04134cs.LG2026-03被引 1

用指令级时钟周期精准预测模型在单片机上的能耗与延迟

InstMeter: An Instruction-Level Method to Predict Energy and Latency of DL Model Inference on MCUs

  • 基于单片机时钟周期构建预测模型,直接反映实际运行开销
  • 相比现有方法,能耗误差降低3倍,延迟误差降低6.5倍,数据需求少100倍
  • 适用于NAS优化,支持多种芯片、编译选项和运行环境

深度学习模型现已可在微控制器(MCU)上运行。通过神经架构搜索(NAS),可找到满足MCU约束的模型。其中,推理过程的能耗与延迟是关键指标。现有研究多依赖乘累加(MACs)或参数量等粗略代理指标,常导致预测不准或需大量数据采集。本文提出InstMeter,一种基于MCU时钟周期的预测方法,能准确估算能耗与延迟。时钟周期是反映MCU操作的基本度量,直接决定能耗与延迟。此外,该方法具有强线性特性,结构简单且高效。我们在不同场景、MCU及软件配置下全面评估了InstMeter。相比现有最优方法,其能耗预测误差降低3倍,延迟误差降低6.5倍,训练数据需求减少100倍和10倍。在NAS场景中,可充分挖掘能耗预算,识别出精度更高的最优模型。我们还通过三款ARM MCU(Cortex-M4, M7, M33)和一款RISC-V MCU(ESP32-C3),结合不同编译选项(-Os, -O2)、GCC版本(v7.3, v10.3)、应用场景(关键词识别、图像识别)、动态电压频率调节、温度(21°C, 43°C)及软件设置(TFLMv2.4, TFLMvCI)验证其泛化能力。代码与基准数据集将开源。

原文摘要 · Abstract (English)

Deep learning (DL) models can now run on microcontrollers (MCUs). Through neural architecture search (NAS), we can search DL models that meet the constraints of MCUs. Among various constraints, energy and latency costs of the model inference are critical metrics. To predict them, existing research relies on coarse proxies such as multiply-accumulations (MACs) and model's input parameters, often resulting in inaccurate predictions or requiring extensive data collection. In this paper, we propose InstMeter, a predictor leveraging MCUs' clock cycles to accurately estimate the energy and latency of DL models. Clock cycles are fundamental metrics reflecting MCU operations, directly determining energy and latency costs. Furthermore, a unique property of our predictor is its strong linearity, allowing it to be simple and accurate. We thoroughly evaluate InstMeter under different scenarios, MCUs, and software settings. Compared with state-of-the-art studies, InstMeter can reduce the energy and latency prediction errors by $3\times$ and $6.5\times$, respectively, while requiring $100\times$ and $10\times$ less training data. In the NAS scenario, InstMeter can fully exploit the energy budget, identifying optimal DL models with higher inference accuracy. We also evaluate InstMeter's generalization performance through various experiments on three ARM MCUs (Cortex-M4, M7, M33) and one RISC-V-based MCU (ESP32-C3), different compilation options (-Os, -O2), GCC versions (v7.3, v10.3), application scenarios (keyword spotting, image recognition), dynamic voltage and frequency scaling, temperatures (21°C, 43°C), and software settings (TFLMv2.4, TFLMvCI). We will open our source codes and the MCU-specific benchmark datasets.

能耗预测单片机神经架构搜索模型推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。