Scalable KNN Graph Construction for Heterogeneous Architectures
Constructing k-nearest neighbor (kNN) graphs is a fundamental component in many machine learning and scientific computing applications. Despite its prevalence, efficiently building all-nearest-neighbor graphs at scale on distributed heterogeneous HPC systems remains challenging, especially for large sparse non-integer datasets. We introduce optimizations for algorithms based on forests of random projection trees. Our novel GPU kernels for batched, within leaf, exact searches achieve 1.18× speedup over sparse reference kernels with less peak memory, and up to 19× speedup over CPU for memory-intensive problems. Our library, PyRKNN , implements distributed randomized projection forests for approximate kNN search. Optimizations to reduce and hide communication overhead allow us to achieve 5× speedup, in per iteration performance, relative to GOFMM (another projection tree, MPI-based kNN library), for a 64M 128d dataset on 1,024 processes. On a single-node we achieve speedup over FAISS-GPU for dense datasets and up to 10× speedup over CPU-only libraries. PyRKNN uniquely supports distributed memory kNN graph construction for both dense and sparse coordinates on CPU and GPU accelerators.
Authors
- William Ruys (ORCID: https://orcid.org/0000-0001-5702-022X)
- George Biros (ORCID: https://orcid.org/0000-0002-0033-3994)
- Ali Ghafouri (ORCID: https://orcid.org/0000-0003-3345-4685)
- Chao Chen (ORCID: https://orcid.org/0000-0002-5385-3651)
Institutions
- North Carolina State University (US)
- North Central State College (US)
- The University of Texas at Austin (US)
Publication Details
- Journal
- ACM Transactions on Parallel Computing
- Published
- 2025-04-30
- DOI
- https://doi.org/10.1145/3733610
- Citations
- 1
- Primary Topic
- Graph Theory and Algorithms
- Type
- article
- Field-Weighted Citation Impact
- 1.28