# Turbocharging PiPNN for Proximity and $k$-NN Graph Building

DevFeed: [Turbocharging PiPNN for Proximity and $k$-NN Graph Building](<https://devfeed.tech/articles/turbocharging-pipnn-for-proximity-and-k-nn-graph-building-118113.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2611.05690>)

Author: Tobias Rubel, Richard Wen, Guy Blelloch, Laxman Dhulipala, Lars Gottesb\\"uren, Jakub {\\L}\\k{a}cki, Vahab Mirrokni

Published: 2026-11-05T05:00:00Z

Content type: article

Language: en

Sources: [arXiv: Databases](<https://devfeed.tech/sources/arxiv-databases.md>)

Topics: [ann](<https://devfeed.tech/topics/ann.md>), [Graphs](<https://devfeed.tech/topics/graphs.md>), [quantization](<https://devfeed.tech/topics/quantization.md>), [High-Performance Computing](<https://devfeed.tech/topics/high-performance-computing.md>), [clustering](<https://devfeed.tech/topics/clustering.md>)

Tags: [anomaly-detection](<https://devfeed.tech/tags/anomaly-detection.md>), [approximate-nearest-neighbor-search](<https://devfeed.tech/tags/approximate-nearest-neighbor-search.md>), [clustering](<https://devfeed.tech/tags/clustering.md>), [construction](<https://devfeed.tech/tags/construction.md>), [cs-db](<https://devfeed.tech/tags/cs-db.md>), [cs-ir](<https://devfeed.tech/tags/cs-ir.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [gpus](<https://devfeed.tech/tags/gpus.md>), [graph](<https://devfeed.tech/tags/graph.md>), [hnsw](<https://devfeed.tech/tags/hnsw.md>), [indexing](<https://devfeed.tech/tags/indexing.md>), [kernels](<https://devfeed.tech/tags/kernels.md>), [matrix](<https://devfeed.tech/tags/matrix.md>), [memory](<https://devfeed.tech/tags/memory.md>), [minutes](<https://devfeed.tech/tags/minutes.md>), [nearest-neighbor](<https://devfeed.tech/tags/nearest-neighbor.md>), [optimize](<https://devfeed.tech/tags/optimize.md>), [partitioning](<https://devfeed.tech/tags/partitioning.md>), [performance](<https://devfeed.tech/tags/performance.md>), [precision](<https://devfeed.tech/tags/precision.md>), [quantization](<https://devfeed.tech/tags/quantization.md>), [recall](<https://devfeed.tech/tags/recall.md>)

## AI overview

PiPNN II and its GPU implementation, GPiPNN, accelerate graph-based approximate nearest neighbor index construction and direct k-NN graph building. PiPNN II reports up to 8x faster index construction; GPiPNN builds comparable indices up to 43.7x faster than Jasper and 50x faster than CAGRA. For 10-NN graphs at 90% recall, reported gains over prior methods reach 13x on CPUs and 6.6x on GPUs, with PiPNN II building a billion-scale graph in under 16 minutes. Both methods use quantization to reduce memory traffic and low-precision matrix operations, and optimize top-K aggregation, including fusion with matrix kernels to avoid storing the distance matrix. CPU improvements also apply matrix kernels to RobustPrune; the GPU approach batches recursive partitioning, fuses top-K work, and prunes using already-witnessed direct edges.

## Source excerpt

arXiv:2611.05690v1 Announce Type: new Abstract: Graph-based Approximate Nearest Neighbor Search (ANNS) indexes such as HNSW and Vamana deliver state-of-the-art query performance at the cost of large indexing times. The recently introduced PiPNN method drastically accelerated index construction by way of a partitioning-based algorithm leveraging dense matrix multiplication and top-$K$ aggregation kernels. In this paper, we unlock the full potential of PiPNN's hardware-friendly algorithm design. We introduce PiPNN II, which optimizes multiple steps of the PiPNN recipe, giving up to $8\times$ speedups for graph-based ANNS index construction. In addition, we present GPiPNN, a GPU implementation which builds comparable ANNS indices up to $43.7\times$ faster than Jasper and up to $50\times$ faster than CAGRA. We also extend PiPNN II and GPiPNN to compute high-quality $k$-NN graphs directly, which unlocks massive speedups over methods used in many existing systems for clustering, anomaly detection, and more. For 10-NN graph building at $90\%$ recall, we obtain up to a $13\times$ speedup on CPUs and $6.6\times$ on GPUs as compared to the prior best methods. PiPNN II can build a billion-scale 10-NN graph in under 16 minutes. Common to both PiPNN II and GPiPNN is the use of quantization to reduce memory traffic and leverage fast low-precision matrix operations. Top-$K$ emerges as a new bottleneck, which we optimize with specialized code for specific $K$, and by fusing with the matrix kernel to avoid materializing the distance matrix to memory. On CPUs, we demonstrate further performance improvements by leveraging our matrix kernels in the RobustPrune procedure proposed in Vamana and used in PiPNN. On GPUs, we flatten recursive partitioning into segmented batches, use one fused top-$K$ abstraction for partitioning and leaf scoring, and prune with already-witnessed direct edges rather than new candidate-to-candidate scoring passes.