SwapNet: Efficient Swapping for DNN Inference on Edge AI Devices Beyond the Memory Budget

📄 arXiv: 2401.16757v1 📥 PDF

作者: Kun Wang, Jiani Cao, Zimu Zhou, Zhenjiang Li

分类: cs.LG, cs.AI, cs.DC

发布日期: 2024-01-30

备注: 14 pages, 19 figures, accepted by IEEE Transactions on Mobile Computing

DOI: 10.1109/TMC.2024.3355764


💡 一句话要点

提出SwapNet以解决边缘AI设备内存预算不足问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 深度神经网络 边缘计算 内存管理 块交换 人工智能 高效推理 多DNN调度

📋 核心要点

  1. 现有方法如模型压缩和云卸载在降低内存占用的同时,往往导致模型精度或自主性下降。
  2. 本文提出SwapNet,通过将DNN划分为块并高效交换,解决了边缘AI设备内存预算不足的问题。
  3. 实验结果表明,SwapNet在内存需求超出预算的情况下,延迟几乎与内存充足时相同,显示出显著的性能提升。

📝 摘要(中文)

在边缘人工智能设备上执行深度神经网络(DNN)使得各种自主移动计算应用成为可能。然而,边缘AI设备的内存预算限制了可用于这些应用的DNN数量和复杂性。现有解决方案如模型压缩或云卸载虽然减少了DNN推理的内存占用,但往往以降低模型精度或自主性为代价。为避免这些缺陷,本文将DNN划分为多个块并按顺序进行交换,使得大型DNN能够在小内存预算内执行。为此,本文开发了SwapNet,一个高效的DNN块交换中间件,系统性地消除了在块交换过程中不必要的内存操作,同时与深度学习框架、GPU后端和边缘AI设备的硬件架构兼容。通过多DNN调度方案,SwapNet在三种应用中的十一项DNN推理任务评估中显示出几乎与充足内存情况下相同的延迟,即使DNN需求超出可用预算2.32倍至5.81倍。

🔬 方法详解

问题定义:本文旨在解决在边缘AI设备上执行大型深度神经网络(DNN)时,由于内存预算限制而导致的性能瓶颈。现有方法如模型压缩和云卸载虽然能减少内存占用,但常常伴随精度下降或自主性降低的问题。

核心思路:SwapNet的核心思路是将DNN划分为多个可独立交换的块,通过高效的块交换机制,允许在有限内存下执行大型DNN。此设计旨在减少冗余内存操作,从而降低延迟,同时保持与现有深度学习框架的兼容性。

技术框架:SwapNet的整体架构包括块划分模块、块交换调度模块和内存管理模块。块划分模块负责将DNN分割为多个块,块交换调度模块根据内存状态动态调度块的加载与卸载,而内存管理模块则优化内存操作以减少延迟。

关键创新:SwapNet的主要创新在于其高效的块交换机制,系统性地消除了不必要的内存操作。这种设计使得在内存不足的情况下,DNN的推理延迟几乎与内存充足时相同,显著提升了边缘AI设备的性能。

关键设计:SwapNet在设计中采用了动态内存管理策略,优化了块的加载顺序,并通过与深度学习框架的兼容性设计,确保了在不同硬件架构上的有效性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果显示,SwapNet在处理内存需求超出预算2.32倍至5.81倍的情况下,延迟几乎与内存充足时相同,表明其在边缘AI设备上的高效性和实用性。这一成果为未来在边缘设备上部署大型语言模型提供了新的思路。

🎯 应用场景

SwapNet的研究成果具有广泛的应用潜力,特别是在需要高效推理的边缘计算场景中,如自动驾驶、智能监控和物联网设备等。通过优化内存使用,SwapNet能够支持更复杂的深度学习模型在资源受限的环境中运行,推动边缘AI技术的发展。

📄 摘要(原文)

Executing deep neural networks (DNNs) on edge artificial intelligence (AI) devices enables various autonomous mobile computing applications. However, the memory budget of edge AI devices restricts the number and complexity of DNNs allowed in such applications. Existing solutions, such as model compression or cloud offloading, reduce the memory footprint of DNN inference at the cost of decreased model accuracy or autonomy. To avoid these drawbacks, we divide DNN into blocks and swap them in and out in order, such that large DNNs can execute within a small memory budget. Nevertheless, naive swapping on edge AI devices induces significant delays due to the redundant memory operations in the DNN development ecosystem for edge AI devices. To this end, we develop SwapNet, an efficient DNN block swapping middleware for edge AI devices. We systematically eliminate the unnecessary memory operations during block swapping while retaining compatible with the deep learning frameworks, GPU backends, and hardware architectures of edge AI devices. We further showcase the utility of SwapNet via a multi-DNN scheduling scheme. Evaluations on eleven DNN inference tasks in three applications demonstrate that SwapNet achieves almost the same latency as the case with sufficient memory even when DNNs demand 2.32x to 5.81x memory beyond the available budget. The design of SwapNet also provides novel and feasible insights for deploying large language models (LLMs) on edge AI devices in the future.