Warp-centric K-Nearest Neighbor Graphs construction on GPU

Recent advances and applications of machine learning algorithms are becoming more common in different fields. It is expected that some applications require the processing of large datasets with those algorithms, which leads to high computational costs. Massively parallel GPU methods can be applied to surpass this limitation and reduce the execution time of these algorithms. The construction of approximate K-Nearest Neighbor Graphs (K-NNG) is frequently required for similarity search or other applications such as the t-SNE dimensionality reduction technique. The K-NNG represents the K closest points (neighbors) for each point in a set. In this paper, we propose and analyze an all-points K-Nearest Neighbor Graph construction algorithm on GPU called Warp-centric K-NNG (w-KNNG), which is based on the Random Projection Forest method. Usually, the construction or search for k-NN sets for high dimensional points presents challenges for its implementation on many-core processing units, due to the space limitation in maintaining these sets in high speed shared memory. We present three warp-centric approaches for our algorithm that efficiently search and maintain the k-NN high dimensional point sets in global memory. In our experiments, the new methods allows the algorithm to achieve up to 639% faster execution when compared to the state-of-the-art FAISS library, considering an equivalent accuracy of approximate K-NNG. One of the new strategies (w-KNNG atomic) is more successful when applied to a smaller number of dimensions, while the tiled w-KNNG approach was successful in general scenarios for higher dimensional points.

[1]  Wan-Lei Zhao k-NN Graph Construction: a Generic Online Approach , 2018, ArXiv.

[2]  Ali Dashti,et al.  Fast k-NNG Construction with GPU-Based Quick Multi-Select , 2013, PloS one.

[3]  Jingzhou Liu,et al.  Visualizing Large-scale and High-dimensional Data , 2016, WWW.

[4]  Yingjie Wang,et al.  K-Nearest Neighbor Search by Random Projection Forests , 2018, IEEE Transactions on Big Data.

[5]  John Canny,et al.  GPU accelerated t-distributed stochastic neighbor embedding , 2019, J. Parallel Distributed Comput..

[6]  Geoffrey E. Hinton,et al.  Visualizing Data using t-SNE , 2008 .

[7]  Aurora Trinidad Ramirez Pozo,et al.  Improving Barnes-Hut t-SNE Algorithm in Modern GPU Architectures with Random Forest KNN and Simulated Wide-Warp , 2021, ACM J. Emerg. Technol. Comput. Syst..

[8]  Sanjoy Dasgupta,et al.  Random projection trees and low dimensional manifolds , 2008, STOC.

[9]  Deng Cai,et al.  AtSNE: Efficient and Robust Visualization on GPU through Hierarchical Optimization , 2019, KDD.

[10]  Kai Li,et al.  Efficient k-nearest neighbor graph construction for generic similarity measures , 2011, WWW.

[11]  Samuel Williams,et al.  Roofline: an insightful visual performance model for multicore architectures , 2009, CACM.

[12]  Michael E. Houle,et al.  NN-Descent on High-Dimensional Data , 2018, WIMS.

[13]  Xiangxiang Zeng,et al.  Large-Scale Approximate k-NN Graph Construction on GPU , 2021, ArXiv.

[14]  Jeffrey Dean,et al.  Efficient Estimation of Word Representations in Vector Space , 2013, ICLR.

[15]  H. Lensch,et al.  GGNN: Graph-Based GPU Nearest Neighbor Search , 2019, IEEE Transactions on Big Data.

[16]  Jeff Johnson,et al.  Billion-Scale Similarity Search with GPUs , 2017, IEEE Transactions on Big Data.

[17]  Li Fei-Fei,et al.  ImageNet: A large-scale hierarchical image database , 2009, CVPR.

[18]  Martin Aumüller,et al.  ANN-Benchmarks: A Benchmarking Tool for Approximate Nearest Neighbor Algorithms , 2018, SISAP.

[19]  Martin Kruliš,et al.  Detailed Analysis and Optimization of CUDA K-means Algorithm , 2020, ICPP.