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

Tempo:通过减少内存占用加速基于Transformer的模型训练

Tempo: Accelerating Transformer-Based Model Training through Memory Footprint Reduction

University of Toronto(多伦多大学);Shanghai Jiao Tong University(上海交通大学);Vector Institute(向量研究所)

Muralidhar Andoorveedu, Zhanda Zhu, Bojian Zheng, Gennady Pekhimenko

摘要:

训练深度学习模型在计算上可能是昂贵的。先前的工作已经表明,增加批量大小可能会导致更好的整体吞吐量。然而,由于为训练反向传递存储的激活/特征图,批量大小经常受到加速器存储器容量的限制,因为较大的批量大小需要存储较大的特征图。基于transformer的模型,由于其良好的性能和对各种任务的适用性,最近受到了广泛的欢迎,也有类似的问题。为了解决这个问题,我们提出了Tempo,一种有效使用加速器的新方法(例如,GPU)内存资源,用于训练基于transformer的模型。我们的方法为GELU,LayerNorm和Attention层提供了直接替代品,减少了内存使用,最终实现了更有效的训练。我们实现了Tempo并评估了BERT Large预训练任务的吞吐量、内存使用和准确性/损失。我们证明了Tempo能够在最先进的基线上实现高达2倍的批量大小和16%的训练吞吐量。我们还在GPT 2和RoBERTa模型上评估了Tempo,分别比基线加速了19%和26%。

英文摘要:

Training deep learning models can be computationally expensive. Prior works have shown that increasing the batch size can potentially lead to better overall throughput. However, the batch size is frequently limited by the accelerator memory capacity due to the activations/feature maps stored for the training backward pass, as larger batch sizes require larger feature maps to be stored. Transformer-based models, which have recently seen a surge in popularity due to their good performance and applicability to a variety of tasks, have a similar problem. To remedy this issue, we propose Tempo, a new approach to efficiently use accelerator (e.g., GPU) memory resources for training Transformer-based models. Our approach provides drop-in replacements for the GELU, LayerNorm, and Attention layers, reducing the memory usage and ultimately leading to more efficient training. We implement Tempo and evaluate the throughput, memory usage, and accuracy/loss on the BERT Large pre-training task. We demonstrate that Tempo enables up to 2x higher batch sizes and 16% higher training throughput over the state-of-the-art baseline. We also evaluate Tempo on GPT2 and RoBERTa models, showing 19% and 26% speedup over the baseline.

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

↑