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.
GPU Accelerated Self-join for the Distance Similarity Metric
自连接在数据集中找到由相似性度量定义的彼此阈值内的所有对象。因此,自连接是数据库和数据采掘领域的构建块,并且在大数据应用中被采用。在本文中,我们提出了一个GPU效率的算法的相似性自连接,使用欧几里德距离度量。搜索和细化策略对于低维度数据集是一种有效的方法,因为索引搜索随着维度的增加而降级(即,维度的灾难(curse of dimensionality)。因此,我们的目标是低维问题,并比较我们的GPU自连接到搜索和细化实现,以及最先进的并行算法。在低维度中,有效解决GPU上的自连接问题存在一些独特的挑战。低维数据通常会导致较高的数据密度,从而导致大量的距离计算和较大的结果集。随着维度的增加,索引搜索变得越来越详尽,形成了性能瓶颈。我们提出了几种技术来克服这些挑战,使用GPU。我们提出的技术包括一个GPU高效的索引,采用有界搜索,一个可适应大的结果集大小,并通过删除重复搜索减少距离计算的搜索方案。我们的GPU自连接性能优于搜索和优化算法和最先进的算法。