arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.13986cs.LGcs.AI
收藏

面向O(3)-等变深度网络的高效稀疏核生成器

An Efficient Sparse Kernel Generator for O(3)-Equivariant Deep Networks

University of California, Berkeley(加州大学伯克利分校);Lawrence Berkeley National Laboratory(伯克利国家实验室)

Vivek Bharadwaj, Austin Glover, Aydin Buluc, James Demmel

AI总结:

本文提出一种面向O(3)-等变深度网络中Clebsch-Gordon张量积的GPU稀疏核生成器,通过编译期共享内存管理、寄存器级分解和与图卷积融合等优化,相比cuEquivariance和e3nn分别实现最高1.3倍和10倍加速,并使MACE模型FP64推理加速达6.2倍。

摘要:

旋转等变图神经网络,即旨在保证其输入与输出之间特定几何关系的网络,在空间深度学习任务上取得了最先进的性能。与经典方法相比,它们在训练期间表现出高数据效率,并且在原子间势能计算中显著缩短了推理时间。这些模型的关键是Clebsch-Gordon(CG)张量积,这是一种将两个稠密特征向量与高度结构化的稀疏张量进行收缩以产生稠密输出向量的核。该操作在典型的等变模型中可能重复数百万次,是一个代价高昂且低效的瓶颈。我们引入了一个针对CG张量积的GPU稀疏核生成器,与现有最佳的开放源代码和闭源代码实现相比,它提供了显著的加速。我们的实现通过在模型编译时进行静态分析来仔细管理有限的GPU共享内存,从而最小化对全局内存的读写,实现了高性能。我们将张量积分解为一系列较小的核,其操作数完全适合寄存器,使我们能够生成长的算术指令流,从而最大化指令级并行性。通过将CG张量积与随后的图卷积融合,我们减少了中间存储和全局内存流量,优于复制输入数据的朴素方法。我们还为CG张量积的梯度提供了优化的核,并为预测原子间力所需的高阶偏导数提供了一个新的恒等式。我们的核相对于NVIDIA闭源的cuEquivariance包提供了高达1.3倍的加速,相对于广泛使用的e3nn包提供了10倍的加速。在FP64精度下,我们为MACE化学基础模型提供了相对于原始未优化版本高达6.2倍的推理时间加速。

英文摘要:

Rotation equivariant graph neural networks, i.e. networks designed to guarantee certain geometric relations between their inputs and outputs, yield state of the art performance on spatial deep learning tasks. They exhibit high data efficiency during training and significantly reduced inference time for interatomic potential calculations compared to classical approaches. Key to these models is the Clebsch-Gordon (CG) tensor product, a kernel that contracts two dense feature vectors with a highly-structured sparse tensor to produce a dense output vector. The operation, which may be repeated millions of times for typical equivariant models, is a costly and inefficient bottleneck. We introduce a GPU sparse kernel generator for the CG tensor product that provides significant speedups over the best existing open and closed-source implementations. Our implementation achieves high performance by carefully managing the limited GPU shared memory through static analysis at model compile-time, minimizing reads and writes to global memory. We break the tensor product into a series of smaller kernels with operands that fit entirely into registers, enabling us to emit long arithmetic instruction streams that maximize instruction-level parallelism. By fusing the CG tensor product with a subsequent graph convolution, we reduce both intermediate storage and global memory traffic over naive approaches that duplicate input data. We also provide optimized kernels for the gradient of the CG tensor product and a novel identity for the higher partial derivatives required to predict interatomic forces. Our kernels offer up to 1.3x speedup over NVIDIA's closed-source cuEquivariance package, as well as 10x speedup over the widely-used e3nn package. In FP64 precision, we offer up to 6.2x inference-time speedup for the MACE chemistry foundation model over the original unoptimized version.

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

↑