arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2206.15472cs.CV
收藏

256KB内存下的设备端训练

On-Device Training Under 256KB Memory

MIT(麻省理工学院);MIT-IBM Watson AI Lab(麻省理工学院-IBM沃森人工智能实验室)

Ji Lin, Ligeng Zhu, Wei-Ming Chen, Wei-Chen Wang, Chuang Gan, Song Han

AI总结:

本文提出算法-系统协同设计框架,结合Quantization-Aware Scaling与Sparse Update,并由Tiny Training Engine支持,使CNN在256KB内存内完成设备端训练且准确率相当。

摘要:

设备端训练通过微调预训练模型,使模型能够适应从传感器收集的新数据。用户无需将数据传输到云端即可受益于定制化AI模型,从而保护隐私。然而,对于内存资源极少的IoT设备而言,训练内存消耗高得令人却步。我们提出一种算法-系统协同设计框架,仅用256KB内存即可实现设备端训练。设备端训练面临两个独特挑战:(1)由于低位精度且缺乏归一化,神经网络的量化图难以优化;(2)有限的硬件资源不允许完整反向传播。为应对优化困难,我们提出量化感知缩放(Quantization-Aware Scaling),以校准梯度尺度并稳定8比特量化训练。为减少内存占用,我们提出稀疏更新(Sparse Update),跳过不太重要的层和子张量的梯度计算。该算法创新由轻量级训练系统Tiny Training Engine实现,它会修剪反向计算图以支持稀疏更新,并将运行时自动微分卸载到编译时。我们的框架是首个在256KB SRAM和1MB Flash以下、且无辅助内存的情况下实现卷积神经网络微型设备端训练的解决方案,其内存使用不到PyTorch和TensorFlow的1/1000,同时在tinyML应用VWW上保持相当的准确率。我们的研究使IoT设备不仅能够执行推理,还能持续适应新数据,以实现设备端终身学习。视频演示可在此处查看:https://youtu.be/0pUFZYdoMY8。

英文摘要:

On-device training enables the model to adapt to new data collected from the sensors by fine-tuning a pre-trained model. Users can benefit from customized AI models without having to transfer the data to the cloud, protecting the privacy. However, the training memory consumption is prohibitive for IoT devices that have tiny memory resources. We propose an algorithm-system co-design framework to make on-device training possible with only 256KB of memory. On-device training faces two unique challenges: (1) the quantized graphs of neural networks are hard to optimize due to low bit-precision and the lack of normalization; (2) the limited hardware resource does not allow full back-propagation. To cope with the optimization difficulty, we propose Quantization-Aware Scaling to calibrate the gradient scales and stabilize 8-bit quantized training. To reduce the memory footprint, we propose Sparse Update to skip the gradient computation of less important layers and sub-tensors. The algorithm innovation is implemented by a lightweight training system, Tiny Training Engine, which prunes the backward computation graph to support sparse updates and offload the runtime auto-differentiation to compile time. Our framework is the first solution to enable tiny on-device training of convolutional neural networks under 256KB SRAM and 1MB Flash without auxiliary memory, using less than 1/1000 of the memory of PyTorch and TensorFlow while matching the accuracy on tinyML application VWW. Our study enables IoT devices not only to perform inference but also to continuously adapt to new data for on-device lifelong learning. A video demo can be found here: https://youtu.be/0pUFZYdoMY8.

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

↑