FLASH: Randomized Algorithms Accelerated over CPU-GPU for Ultra-High Dimensional Similarity Search

Yiqiu Wang, Anshumali Shrivastava, Junghee RyuarXiv 2017

Abstract

Similarity search in ultra-high dimensional spaces is a fundamental bottleneck for large-scale machine learning applications. Traditional indexing methods often suffer from excessive memory consumption and high computational costs when dealing with sparse data. This paper introduces FLASH (Fast LSH Algorithm for Similarity search accelerated with HPC), a system that leverages densified one-permutation hashing (DOPH) and fixed-size reservoir sampling to perform k-nearest neighbor search (k-NNS) without explicit distance calculations. By offloading collision counting to GPUs, FLASH achieves up to a 27x speedup and 40x memory reduction compared to state-of-the-art methods like HNSW and FAISS on massive, sparse datasets.

Introduction

The "Curse of Dimensionality" poses a significant challenge for k-NNS in datasets with millions of features. Existing solutions typically fall into two traps: memory bloat from dense representations of sparse data and high computational overhead from calculating exact distances (e.g., Cosine or Jaccard) between queries and candidates. FLASH addresses these limitations by departing from the traditional "retrieve then rank" paradigm, instead using randomized hashing as a direct proxy for similarity.

System Architecture and Methods

FLASH utilizes a pipeline of randomized algorithms designed for efficiency and parallel execution. The core of the system is built on four key innovations:

  1. Densified One Permutation Hashing (DOPH): Unlike traditional minwise hashing, DOPH generates thousands of hashes in a single pass, offering a 400x speedup for sparse data processing.
  2. Fixed-Size Reservoir Sampling: To manage the skewed nature of LSH buckets, FLASH employs fixed-size reservoirs. This ensures predictable memory usage and facilitates perfect load balancing for parallel processing.
  3. Count-Based k-Selection: FLASH avoids expensive distance functions entirely. It identifies near neighbors by counting collisions across $L$ different hash tables; data points with the highest collision counts are statistically the most likely neighbors.
  4. CPU-GPU Hybrid Execution: The system performs indexing on the CPU to utilize large RAM capacities while offloading the heavy collision counting and sorting tasks to the GPU.
The FLASH system pipeline: Adding data via DOPH and reservoir sampling, the Hash Table structure, and the Querying process involving collision aggregation.

GPU-Accelerated Collision Counting

A critical component of FLASH's performance is its ability to parallelize the aggregation of hash collisions. The system uses a series of specialized GPU kernels to process queries. As shown in the following figure, these kernels manage the mapping of query hashes to candidates and the subsequent counting of matches to identify the top-k results without ever referencing the original high-dimensional features.

Detailed view of the GPU kernels (1, 2, and 3) used for efficient collision counting and aggregation during the querying phase.

Evaluation and Results

The authors evaluated FLASH on several massive, real-world sparse datasets, including Webspam (16 million dimensions) and Kdd12 (54 million features). Key findings include:

  • Performance: FLASH was 13x to 27x faster than NMSLIB-HNSW for k-NN graph construction on the URL and Webspam datasets.
  • Memory Efficiency: On the Webspam dataset, FLASH required only 0.43 GB of memory for its index, compared to 16 GB for HNSW—a nearly 40x reduction.
  • Sparsity as an Asset: While sparsity often hinders traditional algorithms, it makes FLASH's DOPH implementation incredibly efficient, allowing it to compute a full k-NN graph for 1.3 billion non-zeros in under 10 seconds.

Conclusion

FLASH demonstrates that exact similarity computation is optional for effective k-NNS in high-dimensional spaces. By using hash collisions as a proxy for similarity and leveraging GPU parallelism, the system provides a scalable solution for massive datasets that were previously computationally prohibitive. Future work may involve extending these techniques to dense, continuous data and automating parameter optimization for hash length and reservoir size.

Summary updated

BibTeX
@misc{wang2017flash,
  author = {Yiqiu Wang and Anshumali Shrivastava and Junghee Ryu},
  title = {{FLASH: Randomized Algorithms Accelerated over CPU-GPU for Ultra-High Dimensional Similarity Search}},
  year = {2017},
  eprint = {1709.01190},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.01190},
}
Figure