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

利用GPU张量核进行双精度的欧几里得距离计算

Leveraging GPU Tensor Cores for Double Precision Euclidean Distance Calculations

Benoit Gallet, Michael Gowanlock

摘要:

张量核(Tensor Cores,TC)是一种专用集成电路(ASIC),是图形处理单元(GPU)架构的最新成员。因此,TC被有目的地设计为大大提高矩阵乘法累加(MMA)运算的性能。虽然TC被大量研究用于机器学习和密切相关的领域,在这些领域中,它们的高效率是不可否认的,但MMA操作并不是这些领域所独有的。更一般地说,任何可以表示为MMA操作的计算都可以利用TC,并且与其他通用核心(例如Nvidia GPU上的CUDA核心)相比,可能会受益于其更高的计算吞吐量。在本文中,我们提出了第一个双精度的(FP64)欧几里得距离计算算法,该算法表示为MMA运算,以利用Nvidia GPU上的TC,而不是更常用的CUDA内核。为了表明欧氏距离可以在现实世界中的应用加速,我们评估我们提出的TC算法的距离相似性自连接问题,因为该算法的计算最密集的部分包括在多维空间中计算距离。我们发现,使用张量核心算法的CUDA核心算法的性能增益弱依赖于数据集的大小和分布,但强烈依赖于数据的维数。总的来说,TC是CUDA核心的一个令人信服的替代品,特别是当数据维度较低($\leq{4}$)时,因为我们实现了$1.28\times$的平均加速比,最高可达$2.23\times$,而不是最先进的GPU距离相似性自连接算法。此外,由于本文是第一个探索使用TC的FP64通用计算,未来的研究是有希望的。

英文摘要:

Tensor cores (TCs) are a type of Application-Specific Integrated Circuit (ASIC) and are a recent addition to Graphics Processing Unit (GPU) architectures. As such, TCs are purposefully designed to greatly improve the performance of Matrix Multiply-Accumulate (MMA) operations. While TCs are heavily studied for machine learning and closely related fields, where their high efficiency is undeniable, MMA operations are not unique to these fields. More generally, any computation that can be expressed as MMA operations can leverage TCs, and potentially benefit from their higher computational throughput compared to other general-purpose cores, such as CUDA cores on Nvidia GPUs. In this paper, we propose the first double precision (FP64) Euclidean distance calculation algorithm, which is expressed as MMA operations to leverage TCs on Nvidia GPUs, rather than the more commonly used CUDA cores. To show that the Euclidean distance can be accelerated in a real-world application, we evaluate our proposed TC algorithm on the distance similarity self-join problem, as the most computationally intensive part of the algorithm consists of computing distances in a multi-dimensional space. We find that the performance gain from using the tensor core algorithm over the CUDA core algorithm depends weakly on the dataset size and distribution, but is strongly dependent on data dimensionality. Overall, TCs are a compelling alternative to CUDA cores, particularly when the data dimensionality is low ($\leq{4}$), as we achieve an average speedup of $1.28\times$ and up to $2.23\times$ against a state-of-the-art GPU distance similarity self-join algorithm. Furthermore, because this paper is among the first to explore the use of TCs for FP64 general-purpose computation, future research is promising.

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

↑