arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2409.11902cs.LG
收藏

更少内存意味着更小的GPU:基于压缩激活值的反向传播

Less Memory Means smaller GPUs: Backpropagation with Compressed Activations

Heidelberg University(海德堡大学)

Daniel Barley, Holger Fröning

AI总结:

针对深度神经网络训练中激活值内存占用过高的问题,提出用池化压缩反向传播用的激活图、前向计算保持未压缩的方法,在ResNet上验证可降29%峰值内存且精度无损。

摘要:

深度神经网络(DNN)规模的持续增长导致其计算资源需求同样快速攀升。近年来许多架构,最突出的是大语言模型,都必须借助配备数千个加速器(如GPU或TPU)的超级计算机进行训练。除了海量的浮点运算外,DNN的内存占用也在急剧膨胀。与之相对的是,GPU架构历来内存不足。即使是规模相对较小的架构,例如部分EfficientNet变体,也无法在单张消费级GPU上以合理的小批量大小完成训练。训练过程中,中间输入激活值必须被存储下来,直到反向传播阶段用于计算梯度,这些激活值占据了内存占用的绝大部分。因此,在本研究中,我们考虑使用池化操作对用于反向传播的激活图进行压缩,这一方法既能降低内存占用,也能减少数据移动量。前向计算过程则保持未压缩状态。我们以常用的视觉架构ResNet为例,通过实验验证了该方法的收敛性,并研究了其对特征检测的影响。采用这一方法后,我们能够将峰值内存消耗降低29%,代价是训练周期更长,但与未压缩的基线相比,预测精度得以保持。

英文摘要:

The ever-growing scale of deep neural networks (DNNs) has lead to an equally rapid growth in computational resource requirements. Many recent architectures, most prominently Large Language Models, have to be trained using supercomputers with thousands of accelerators, such as GPUs or TPUs. Next to the vast number of floating point operations the memory footprint of DNNs is also exploding. In contrast, GPU architectures are notoriously short on memory. Even comparatively small architectures like some EfficientNet variants cannot be trained on a single consumer-grade GPU at reasonable mini-batch sizes. During training, intermediate input activations have to be stored until backpropagation for gradient calculation. These make up the vast majority of the memory footprint. In this work we therefore consider compressing activation maps for the backward pass using pooling, which can reduce both the memory footprint and amount of data movement. The forward computation remains uncompressed. We empirically show convergence and study effects on feature detection at the example of the common vision architecture ResNet. With this approach we are able to reduce the peak memory consumption by 29% at the cost of a longer training schedule, while maintaining prediction accuracy compared to an uncompressed baseline.

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

↑