ROAM:通过优化算子执行顺序与内存布局实现内存高效的大规模深度神经网络训练
ROAM: memory-efficient large DNN training via optimized operator ordering and memory layout
AI总结:
ROAM在计算图层面通过优化算子执行顺序和张量内存布局,结合树搜索自动划分任务,实现大规模DNN训练的内存高效,相比PyTorch等最高降低35.7%内存并加速53.7倍。
摘要:
随着深度学习模型规模持续增大,训练所需的内存需求急剧上升。虽然卸载、重计算和压缩等高层技术可以缓解内存压力,但它们也会引入额外开销。然而,一个包含合理算子执行顺序和张量内存布局的内存高效执行计划,能够显著提升模型的内存效率,并降低高层技术带来的开销。本文提出ROAM,它在计算图层面工作,为模型推导具有优化算子顺序和张量内存布局的内存高效执行计划。我们首先提出精细的理论,仔细考虑模型结构和训练内存负载,以支持对过去尚未得到良好支持的大型复杂图进行优化。进一步提出一种高效的基于树的算法,自动搜索任务划分,同时提供高性能和有效性以解决该问题。实验表明,与PyTorch以及两种最先进的方法相比,ROAM分别实现了35.7%、13.3%和27.2%的显著内存降低,并提供了53.7倍的显著加速。在大型GPT2-XL上进行的评估进一步验证了ROAM的可扩展性。
英文摘要:
As deep learning models continue to increase in size, the memory requirements for training have surged. While high-level techniques like offloading, recomputation, and compression can alleviate memory pressure, they also introduce overheads. However, a memory-efficient execution plan that includes a reasonable operator execution order and tensor memory layout can significantly increase the models' memory efficiency and reduce overheads from high-level techniques. In this paper, we propose ROAM which operates on computation graph level to derive memory-efficient execution plan with optimized operator order and tensor memory layout for models. We first propose sophisticated theories that carefully consider model structure and training memory load to support optimization for large complex graphs that have not been well supported in the past. An efficient tree-based algorithm is further proposed to search task divisions automatically, along with delivering high performance and effectiveness to solve the problem. Experiments show that ROAM achieves a substantial memory reduction of 35.7%, 13.3%, and 27.2% compared to Pytorch and two state-of-the-art methods and offers a remarkable 53.7x speedup. The evaluation conducted on the expansive GPT2-XL further validates ROAM's scalability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。