TL;DR
This paper introduces NDSEARCH, a novel system that accelerates Approximate Nearest Neighbor Search (ANNS) by performing computations directly within SSDs (near-data processing). By leveraging LUN-level parallelism and a new processing model, NDSEARCH significantly boosts ANNS performance and energy efficiency compared to existing CPU, GPU, and even other in-storage solutions.
What Problem Does This Paper Address?
Approximate Nearest Neighbor Search (ANNS) is a crucial technique for tasks like recommendation systems and retrieval-augmented generation (RAG). A leading ANNS method, graph-traversal-based ANNS (like HNSW and DiskANN), builds a graph of data points. However, for large datasets, this graph can exceed main memory capacity, forcing reliance on SSDs. This leads to a bottleneck: the limited I/O bandwidth between the CPU and SSD severely degrades performance, with SSD I/O often accounting for over 75% of the latency. Existing solutions struggle to efficiently utilize the internal bandwidth of SSDs for the irregular access patterns of ANNS.
Methods
NDSEARCH tackles this by proposing a hardware-software co-designed near-data processing (NDP) solution.
- SEARSSD Architecture: A modified SSD architecture that offloads ANNS kernels (graph traversal and distance computation) directly to the storage. It utilizes LUN-level accelerators within NAND flash chips to exploit fine-grained parallelism.
- LUNCSR Graph Format: A new graph format that stores vertex and neighbor information in a way that's optimized for in-storage processing, avoiding unnecessary data fetches.
- Two-Level Scheduling:
- Static Scheduling: Reorders graph vertices offline to improve spatial data locality, ensuring related data is stored together.
- Dynamic Scheduling: Manages query allocation at runtime to maximize temporal data locality and overlap computation. This includes a speculative searching mechanism to prefetch data for the next iteration.
- Processing Model: A new model tailored for NDP, decoupling stages like Scatter and Apply to enable parallelism and latency overlap.
Datasets
The paper evaluates NDSEARCH on several standard ANNS datasets:
- glove-100
- fashion-mnist
- sift-1b
- deep-1b
- spacev-1b
Key Insights and Ideas
- SSD I/O is the primary bottleneck: The paper convincingly demonstrates that for large-scale ANNS, the SSD's limited I/O bandwidth is the main performance limiter, not necessarily the computation itself.
- LUN-level parallelism is key: Exploiting the parallelism within individual Logic Units (LUNs) of NAND flash chips is crucial for efficiently processing the irregular access patterns of ANNS, outperforming chip-level or channel-level acceleration.
- Data locality is paramount: Both static (vertex reordering) and dynamic (query allocation) scheduling are vital for maximizing data locality, reducing redundant data transfers, and improving temporal reuse.
- Speculative execution pays off: Pre-fetching potential next-iteration data significantly accelerates the search process by overlapping computation and I/O.
- In-storage processing offers massive energy savings: By drastically reducing data movement, NDSEARCH achieves orders of magnitude higher energy efficiency than CPU and GPU.
Key Results
NDSEARCH demonstrates significant performance improvements:
- Throughput: Up to 31.7× over CPU, 14.6× over GPU, 7.4× over a state-of-the-art SmartSSD-only design, and 2.9× over DeepStore.
- Energy Efficiency: Achieves two orders of magnitude higher energy efficiency than CPU and GPU.
- Static Scheduling: Reduces page access ratio by up to 38% and induces up to 1.17× speedup.
- Dynamic Scheduling: Reduces page accesses by up to 73% and induces up to 2.67× speedup.
- Combined Optimizations: Achieves 4.1× performance improvement over a bare NDSEARCH system (without dynamic scheduling or multi-plane mapping).
Limitations and Future Work
- Generalization: The current work focuses on graph-traversal-based ANNS. While the authors believe the approach has potential for generalization to other ANNS types (e.g., quantization-based, tree-based), this is left for future work.
- Batch Size Impact: Performance gains from LUN-level parallelism are most pronounced with larger batch sizes. For very small batches, the advantage is marginal.
- Resource Constraints: For extremely large batch sizes, splitting into sub-batches is necessary due to limited resources, which can slightly reduce speedup.
- Future Work: The authors suggest exploring the generalization of NDSEARCH to other ANNS algorithms and further optimizing its capabilities.
Summary updated