Skip to main content
QUICK REVIEW

[论文解读] DELTA: Dynamically Optimizing GPU Memory beyond Tensor Recomputation

Yu Tang, Chenyu Wang|arXiv (Cornell University)|Mar 30, 2022
Tensor decomposition and applications被引用 6
一句话总结

DELTA 是一种新颖的动态 GPU 内存管理器,通过在运行时联合优化张量交换和重计算,消除手动调优并减轻内存压力。它使用过滤器、调度器和预取模块,智能地卸载张量,实现高达 70% 的内存节省和 2.25 倍更大的批量大小,同时训练延迟极低。

ABSTRACT

The further development of deep neural networks is hampered by the limited GPU memory resource. Therefore, the optimization of GPU memory resources is highly demanded. Swapping and recomputation are commonly applied to make better use of GPU memory in deep learning. However, as an emerging domain, several challenges remain:1)The efficiency of recomputation is limited for both static and dynamic methods. 2)Swapping requires offloading parameters manually, which incurs a great time cost. 3) There is no such dynamic and fine-grained method that involves tensor swapping together with tensor recomputation nowadays. To remedy the above issues, we propose a novel scheduler manager named DELTA(Dynamic tEnsor offLoad and recompuTAtion). To the best of our knowledge, we are the first to make a reasonable dynamic runtime scheduler on the combination of tensor swapping and tensor recomputation without user oversight. In DELTA, we propose a filter algorithm to select the optimal tensors to be released out of GPU memory and present a director algorithm to select a proper action for each of these tensors. Furthermore, prefetching and overlapping are deliberately considered to overcome the time cost caused by swapping and recomputing tensors. Experimental results show that DELTA not only saves 40%-70% of GPU memory, surpassing the state-of-the-art method to a great extent but also gets comparable convergence results as the baseline with acceptable time delay. Also, DELTA gains 2.04$ imes$ maximum batchsize when training ResNet-50 and 2.25$ imes$ when training ResNet-101 compared with the baseline. Besides, comparisons between the swapping cost and recomputation cost in our experiments demonstrate the importance of making a reasonable dynamic scheduler on tensor swapping and tensor recomputation, which refutes the arguments in some related work that swapping should be the first and best choice.

研究动机与目标

  • 通过超越静态重计算的内存使用优化,解决大规模深度神经网络训练中的 GPU 内存墙问题。
  • 克服现有方法依赖手动调优、静态检查点或低效交换的局限性。
  • 开发一种完全动态、用户透明的运行时内存管理器,结合张量交换和重计算。
  • 通过智能预取和计算-计算重叠,最小化内存卸载带来的训练时间开销。
  • 在 GPU 内存受限条件下,实现更大模型(如 ResNet-101)的训练,显著提升批量大小。

提出的方法

  • 提出一个三组件系统:过滤器(使用启发式函数选择释放的张量)、调度器(决定将张量卸载到 CPU 或重新计算)和预取器(将通信与计算重叠)。
  • 采用基础启发式过滤函数($h^{base}_{filter}$),在内存节省和减少数据移动之间取得平衡,在动态环境中优于 LRU 和贪婪替代方案。
  • 引入一种动态决策框架,实时评估每个张量的释放成本与收益,避免手动模型分析。
  • 使用预取和重叠技术隐藏 GPU 与 CPU 之间的通信延迟,减少卸载带来的时间开销。
  • 设计框架无关的架构,支持与 PyTorch、TensorFlow、MXNet 等深度学习框架集成。
  • 采用运行时管理器,持续监控内存压力,并在训练过程中动态调整张量释放策略。

实验结果

研究问题

  • RQ1一个动态、自动化的系统能否有效结合张量交换和重计算,在无需用户干预的情况下减少 GPU 内存使用?
  • RQ2在实践中,选择交换还是重计算如何影响训练时间和内存节省?
  • RQ3哪种张量选择启发式函数能在内存减少和运行时开销之间实现最佳权衡?
  • RQ4动态内存管理在 ResNet-50 和 ResNet-101 等大模型中,能在多大程度上提升批量大小?
  • RQ5结合预取和重叠是否能显著降低卸载张量的性能惩罚?

主要发现

  • DELTA 在 ResNet-50、ResNet-101 和 BERT 上将 GPU 内存消耗减少了 40% 至 70%,显著优于现有最先进方法。
  • 使用 DELTA 后,ResNet-50 的最大批量大小相比基线提升 2.04 倍,ResNet-101 提升 2.25 倍。
  • 基础启发式过滤函数($h^{base}_{filter}$)性能优于 LRU 和贪婪过滤器,尤其在内存预算较小时,因卸载频率更低且重叠效果更好。
  • 实验结果表明,重计算通常比交换更高效,这与认为交换应为默认策略的观点相矛盾。
  • DELTA 保持了与基线相当的收敛行为,表明尽管采用了激进的内存优化,对模型训练质量的影响极小。
  • 预取和重叠策略显著减少了时间延迟,使内存管理开销在实际应用中可接受。

更好的研究,从现在开始

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

无需绑定信用卡

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