NeurIPS 2022accept18 citations

Graph Reordering for Cache-Efficient Near Neighbor Search

Benjamin Coleman, Santiago Segarra, Alex Smola, Anshumali Shrivastava

Abstract

Graph search is one of the most successful algorithmic trends in near neighbor search. Several of the most popular and empirically successful algorithms are, at their core, a greedy walk along a pruned near neighbor graph. However, graph traversal applications often suffer from poor memory access patterns, and near neighbor search is no exception to this rule. Our measurements show that popular search indices such as the hierarchical navigable small-world graph (HNSW) can have poor cache miss performance. To address this issue, we formulate the graph traversal problem as a cache hit maximization task and propose multiple graph reordering as a solution. Graph reordering is a memory layout optimization that groups commonly-accessed nodes together in memory. We mathematically formalize the connection between the graph layout and the cache complexity of search. We present exhaustive experiments applying several reordering algorithms to a leading graph-based near neighbor method based on the HNSW index. We find that reordering improves the query time by up to 40%, we present analysis and improvements for existing graph layout methods, and we demonstrate that the time needed to reorder the graph is negligible compared to the time required to construct the index.

near-neighbor searchembedding searchgraph orderingmachine learning systems
BibTeX
@inproceedings{
coleman2022graph,
title={Graph Reordering for Cache-Efficient Near Neighbor Search},
author={Benjamin Coleman and Santiago Segarra and Alex Smola and Anshumali Shrivastava},
booktitle={Advances in Neural Information Processing Systems},
editor={Alice H. Oh and Alekh Agarwal and Danielle Belgrave and Kyunghyun Cho},
year={2022},
url={https://openreview.net/forum?id=8LeCgKb6UX}
}
Graph Reordering for Cache-Efficient Near Neighbor Search · NeurIPS 2022