Performance optimization for the k-nearest neighbors kernel on x86 architectures

Authors:

Abstract
Nearest neighbor search is a cornerstone problem in computational geometry, non-parametric statistics, and machine learning. For N points, exhaustive search requires quadratic work, but many fast algorithms reduce the complexity for exact and approximate searches. The common kernel (kNN kernel) in all these algorithms solves many small-size problems exactly using exhaustive search. We propose an efficient implementation and performance analysis for the kNN kernel on x86 architectures. By fusing the distance calculation with the neighbor selection, we are able to utilize memory throughput. We present an analysis of the algorithm and explain parameter selection. We perform an experimental study varying the size of the problem, the dimension of the dataset, and the number of nearest neighbors. Overall we observe significant speedups. For example, when searching for 16 neighbors in a point dataset with 1.6 million points in 64 dimensions, our kernel is over 4 times faster than existing methods.
Funding Information
  • National Science Foundation (CCF-1337393, OCI-1029022, CCF-1218483, CCF-1320112)
  • National Institute for Health Research (10042242)
  • Air Force Office of Scientific Research (FA9550-11-10339, FA9550-11-10339)
  • U.S. Department of Energy (DE-SC0010518, DE-SC0009286, DE- FG02-08ER2585)

This publication has 20 references indexed in Scilit: