arXiv:2606.17249cs.ARcs.LG2026-06

将轻量GRNN模型部署到超低功耗单片机,实现毫秒级实时推理。

From Compression to Deployment: Real-Time and Energy-Efficient FastGRNN on Ultra-Constrained Microcontrollers

  • 通过权重分解、稀疏化与量化压缩模型至566字节。
  • 在8位/16位单片机上实现50Hz实时推理,精度达F1=0.918。
  • 适配无乘法器芯片,提供查表加速方案,节能96.7%。

现代机器学习普遍趋向于扩大模型规模与硬件资源,但全球半导体供应紧张及持续在线推理带来的高能耗和碳排放暴露了这一路径的脆弱性。本文提出反向思路:将AI算法重构以适配已大规模生产的微型控制器。我们实现了FastGRNN的端到端开源复现,部署于两个裸机平台:8位Arduino(ATmega328P)与16位MSP430(无硬件乘法器;16 KB Flash;512 B SRAM)。压缩流程结合低秩权重分解、迭代硬阈值稀疏化及每张量Q15后训练量化,并进行显式激活校准。部署后模型仅占566字节权重,在HAPT测试集上达到宏观F1=0.918(种子0;五种子均值0.853±0.107)。与PyTorch参考模型在3,399个测试窗口中实现100%预测一致(MCU种子0;五种子间99.91–100%等效一致性)。两平台均支持实时50 Hz流式推理(Arduino为9.21毫秒/样本,MSP430为13毫秒),其中256项的sigmoid/tanh查表使无乘法器的MSP430提速30.5倍。四项贡献扩展原论文:(i) 跨平台比特等价确定性推理;(ii) 循环预热延迟分析(中位74样本,1.48秒;最差125样本,2.50秒,100个测试窗口);(iii) 为无乘法器嵌入式设备提供可部署的查表方案;(iv) 硬件能效评估显示主动推理功率17.7 mW,空闲<0.09 mW,LUT使能效降低96.7%。

原文摘要 · Abstract (English)

The dominant trajectory of modern machine learning has been to scale up: larger models, larger accelerators, larger memory budgets. Yet a multi-year global semiconductor supply constraint and the growing energy and carbon cost of always-online inference expose the fragility of this trajectory and motivate the opposite direction: refactoring AI and ML algorithms to fit the small, ubiquitous microcontrollers already in mass production in wearables, sensors, and edge appliances. We present an end-to-end open-source reproduction of FastGRNN, a compact gated recurrent cell, deployed on two bare-metal targets: the 8-bit Arduino (ATmega328P) and the 16-bit MSP430 (no hardware multiplier; 16 KB Flash; 512 B SRAM). Our compression pipeline combines low-rank weight factorization, iterative hard-thresholding sparsity, and per-tensor Q15 post-training quantization with explicit activation calibration. The deployed model occupies 566 bytes of weights and achieves macro F1 = 0.918 (seed 0; five-seed Q15 mean 0.853+-0.107) on the HAPT test set. It matches a PyTorch reference at 100% prediction agreement across 3,399 test windows (MCU seed 0; 99.91-100% C-equivalent across five seeds). Both platforms sustain real-time 50 Hz streaming inference (9.21 ms per sample on Arduino; 13 ms on MSP430), where a 256-entry sigmoid/tanh look-up table delivers a 30.5x speedup on the multiplier-less MSP430. Four contributions extend the original FastGRNN paper: (i) cross-platform bit-equivalent deterministic inference; (ii) characterization of recurrent warm-up latency (median 74 samples, 1.48 s; worst-case 125 samples, 2.50 s over 100 test windows); (iii) a deployable look-up-table recipe for multiplier-less embedded targets; and (iv) hardware energy characterization showing 17.7 mW active inference power, <0.09 mW idle power, and 96.7% energy reduction with the LUT.

边缘计算轻量化模型嵌入式低功耗

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