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

混合精度神经算子的保证近似界

Guaranteed Approximation Bounds for Mixed-Precision Neural Operators

NVIDIA(英伟达);Caltech(加州理工学院);University of Toronto(多伦多大学);Vector Institute(矢量研究院)

Renbo Tu, Colin White, Jean Kossaifi, Boris Bonev, Nikola Kovachki, Gennady Pekhimenko, Kamyar Azizzadenesheli, Anima Anandkumar

AI总结:

本文针对混合精度训练FNO时的数值溢出与精度损失问题,从理论上证明有针对性的降精度仍能保证近似界,并提出贪心优化半精度张量收缩的方法,在几乎不损失精度的情况下显著降低GPU内存并提升吞吐量。

摘要:

神经算子,如傅里叶神经算子(FNO),为学习偏微分方程的解算子以及函数空间之间的其他映射提供了一种有原则的方法。然而,许多现实世界的问题需要高分辨率的训练数据,训练时间和有限的GPU内存构成了巨大障碍。一种解决方案是以混合精度训练神经算子,以减少内存需求并提高训练速度。然而,现有的混合精度训练技术是为标准神经网络设计的,我们发现将其直接应用于FNO会导致数值溢出和较差的内存效率。此外,乍一看,混合精度在FNO中似乎会导致精度急剧下降,因为在经典数值求解器中降低傅里叶变换的精度会产生较差的结果。我们证明情况并非如此;事实上,我们证明了在以有针对性的方式降低FNO中的精度时,仍然可以保证良好的近似界。具体来说,我们基于以下直觉:神经算子学习本质上会引入近似误差,该误差源于对无限维真实输入函数的离散化,这意味着不需要全精度训练。我们通过严格刻画FNO的近似误差和精度误差,并针对一般输入函数对这些误差进行界定,从而形式化了这一直觉。我们证明了精度误差在渐近意义上与近似误差相当。基于此,我们设计了一种简单的方法,通过贪心地寻找最优收缩顺序来优化内存密集型的半精度张量收缩。通过在不同最先进的神经算子、数据集和GPU上进行的大量实验,我们证明了我们的方法可将GPU内存使用量降低多达50%,并将吞吐量提高58%,同时精度几乎没有或完全没有降低。

英文摘要:

Neural operators, such as Fourier Neural Operators (FNO), form a principled approach for learning solution operators for PDEs and other mappings between function spaces. However, many real-world problems require high-resolution training data, and the training time and limited GPU memory pose big barriers. One solution is to train neural operators in mixed precision to reduce the memory requirement and increase training speed. However, existing mixed-precision training techniques are designed for standard neural networks, and we find that their direct application to FNO leads to numerical overflow and poor memory efficiency. Further, at first glance, it may appear that mixed precision in FNO will lead to drastic accuracy degradation since reducing the precision of the Fourier transform yields poor results in classical numerical solvers. We show that this is not the case; in fact, we prove that reducing the precision in FNO still guarantees a good approximation bound, when done in a targeted manner. Specifically, we build on the intuition that neural operator learning inherently induces an approximation error, arising from discretizing the infinite-dimensional ground-truth input function, implying that training in full precision is not needed. We formalize this intuition by rigorously characterizing the approximation and precision errors of FNO and bounding these errors for general input functions. We prove that the precision error is asymptotically comparable to the approximation error. Based on this, we design a simple method to optimize the memory-intensive half-precision tensor contractions by greedily finding the optimal contraction order. Through extensive experiments on different state-of-the-art neural operators, datasets, and GPUs, we demonstrate that our approach reduces GPU memory usage by up to 50% and improves throughput by 58% with little or no reduction in accuracy.

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

↑