arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2106.06998cs.LGcs.NAmath.NA
收藏

XConv: 卷积层的低内存随机反向传播

XConv: Low-memory stochastic backpropagation for convolutional layers

University of Central Florida(中央佛罗里达大学);Rice University(里士满大学);DevitoCodes Ltd(DevitoCodes有限公司);Michigan State University(密歇根州立大学);Georgia Institute of Technology(佐治亚理工学院)

Anirudh Thatipelli, Jeffrey Sam, Mathias Louboutin, Ali Siahkoohi, Rongrong Wang, Felix J. Herrmann

AI总结:

提出XConv方法,通过存储激活的压缩投影并利用多通道随机迹估计近似梯度,在不增加计算、不约束架构、不大量修改代码的情况下,大幅降低卷积层反向传播的内存需求。

摘要:

大规模训练卷积神经网络需要大量内存,主要是因为中间激活必须存储用于反向传播。现有的解决方案(检查点、可逆架构或梯度近似方法如随机自动微分)要么增加大量计算,要么施加架构约束,要么需要非平凡的代码更改。我们提出XConv,一种标准2D和3D卷积层的近乎即插即用的替代方案,它解决了所有三个问题:它保留了标准反向传播,不施加架构约束,并且以最小的更改集成到现有代码库中。XConv利用卷积权重梯度的代数结构,存储激活的高度压缩投影而不是完整张量,并通过多通道随机迹估计近似梯度。探测向量的数量设置了内存-精度权衡,并在极限情况下恢复精确梯度。我们为估计器建立了收敛保证和误差界,表明其梯度误差方差与随机梯度下降相当。实验上,XConv在分类、生成建模、超分辨率、修复和分割任务中与精确梯度方法匹配,随着探测向量数量的增加,差距缩小,同时在卷积激活占主导时将激活内存减少两倍或更多,并且在较大批量大小下与优化的卷积核保持计算竞争力。在半精度下,梯度近似误差降至舍入下限,因此XConv除了低精度算术的误差外几乎没有增加额外误差。在激活内存而非计算成为瓶颈的情况下,例如高分辨率和体积训练以及设备端微调,这种节省最为重要。

英文摘要:

Training convolutional neural networks at scale demands substantial memory, largely because intermediate activations must be stored for backpropagation. Existing remedies (checkpointing, invertible architectures, or gradient-approximation methods such as randomized automatic differentiation) either add significant computation, impose architectural constraints, or require non-trivial code changes. We propose XConv, a near-drop-in replacement for standard 2D and 3D convolutional layers that addresses all three: it preserves standard backpropagation, imposes no architectural constraints, and integrates into existing codebases with minimal changes. XConv exploits the algebraic structure of convolutional weight gradients, storing highly compressed projections of the activations rather than the full tensors and approximating the gradients via multi-channel randomized trace estimation. The number of probing vectors sets a memory-accuracy tradeoff and recovers the exact gradient in the limit. We establish convergence guarantees and error bounds for the estimator, showing that its gradient-error variance is comparable to that of stochastic gradient descent. Empirically, XConv matches exact-gradient methods across classification, generative modeling, super-resolution, inpainting, and segmentation, with gaps that narrow as the number of probing vectors grows, while reducing activation memory by a factor of two or more when convolutional activations dominate, and remaining computationally competitive with optimized convolution kernels at larger batch sizes. At half precision the gradient-approximation error falls to the rounding floor, so XConv adds essentially no error beyond that of low-precision arithmetic. The savings matter most where activation memory rather than compute is the binding constraint, such as high-resolution and volumetric training and on-device finetuning.

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

↑