arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2203.15980cs.LG
收藏

DELTA:动态优化GPU内存,超越张量重算

DELTA: Dynamically Optimizing GPU Memory beyond Tensor Recomputation

Science and Technology on Parallel and Distributed Processing Laboratory(并行与分布处理国防科技重点实验室);SenseTime Research(商汤科技研究院);Shanghai Artificial Intelligence Laboratory(上海人工智能实验室)

Yu Tang, Chenyu Wang, Yufan Zhang, Yuliang Liu, Xingcheng Zhang, Linbo Qiao, Zhiquan Lai, Dongsheng Li

摘要:

GPU有限的内存资源阻碍了深度神经网络的进一步发展。因此,对GPU内存资源的优化要求很高。交换和重新计算通常用于在深度学习中更好地利用GPU内存。然而,作为一个新兴的领域,一些挑战仍然存在:1)重新计算的效率是有限的静态和动态方法。2)交换需要手动卸载参数,这会带来很大的时间成本。3)目前还没有一种动态的、细粒度的方法将张量交换和张量重计算结合起来。为了解决上述问题,我们提出了一种新的调度管理器名为DELTA(动态tEnsor卸载和recomputATtion)。据我们所知,我们是第一个在没有用户监督的情况下,结合张量交换和张量重新计算来制作合理的动态运行时调度器的人。在DELTA中,我们提出了一个过滤器算法来选择要从GPU内存中释放的最佳张量,并提出了一个导演算法来为每个张量选择适当的动作。此外,预取和重叠的故意考虑,以克服交换和重新计算张量所造成的时间成本。实验结果表明,DELTA算法不仅节省了40%-70%的GPU内存,在很大程度上超过了现有算法,而且在可接受的时间延迟下,收敛效果与基线相当。此外,与基线相比,DELTA在训练ResNet-50时获得2.04 $\times$最大批量,在训练ResNet-101时获得2.25 $\times$最大批量。此外,通过对交换代价和重计算代价的比较,证明了合理的动态调度器对张量交换和重计算的重要性,反驳了相关研究中认为交换是最优选择的观点.

英文摘要:

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$\times$ maximum batchsize when training ResNet-50 and 2.25$\times$ 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.

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

↑