GPU K-NN Search Using Parallel Thread Queues

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current social networking systems face inefficiencies in performing similarity searches within large datasets, particularly in identifying nearest neighbors among user profiles and object vectors, due to limitations in processing power and data structure management.

Innovation Solution

The implementation of parallel processing techniques on graphics processing units (GPUs) for similarity searches, utilizing distance metrics like L2 distance and cosine similarity, and employing methods such as k-nearest neighbor (k-NN) searches with quantization and product quantization to efficiently identify similar object vectors, along with data structures like inverted files and priority queues to optimize computation.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If traditional sequential processing is used for similarity searches, then processing accuracy is maintained, but search speed and efficiency deteriorate when handling large datasets

Engineering Contradiction:
Improvesearch speedVSAvoidprocessing complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent divides the large dataset into multiple partitions or chunks that can be processed independently and in parallel. Each partition is handled by separate processing threads or computational units, allowing the similarity search to be distributed across multiple processors simultaneously, thereby increasing search speed without sacrificing accuracy

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent transitions from sequential single-threaded processing to parallel multi-threaded processing, adding a temporal dimension to the computation. By utilizing multiple processing threads that execute simultaneously, the system achieves faster search performance while maintaining the same level of processing accuracy through coordinated thread management

Inventive Principle:
Principle #17Another dimension (Dimensionality change)

2Productivity

If parallel processing on GPUs is implemented, then search efficiency improves, but system complexity and resource requirements increase

Engineering Contradiction:
Improvesearch efficiencyVSAvoidsystem complexity
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent employs GPU architecture which provides universal parallel processing capability that can handle various similarity search algorithms and distance metrics. The GPU's inherent parallel structure allows the same hardware to efficiently execute different search operations (k-NN, approximate nearest neighbor, various distance calculations) without requiring separate specialized systems for each function

Inventive Principle:
Principle #6Universality (Multi-functionality)

Solution Approach 2:

The patent introduces data structures such as priority queues and inverted files as intermediary components between the GPU parallel processing units and the final search results. These intermediaries organize and manage the parallel computation outputs, facilitating efficient result aggregation and retrieval while reducing the complexity of directly managing raw parallel processing outputs

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If quantization and product quantization methods are used, then computational speed increases, but measurement precision of distance metrics may deteriorate

Engineering Contradiction:
Improvecomputation speedVSAvoiddistance metric accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent applies quantization techniques that partially approximate the original high-precision distance calculations. By using reduced-precision arithmetic and quantized vector representations, the system achieves faster computation speed while maintaining acceptable accuracy levels for most practical similarity search applications, trading off some measurement precision for significant performance gains

Inventive Principle:
Principle #16Partial or excessive action

Solution Approach 2:

The patent dynamically adjusts quantization parameters and precision levels based on the specific search requirements and data characteristics. By changing parameters such as quantization bit-depth, block size, and approximation thresholds, the system can optimize the balance between computation speed and measurement precision for different search scenarios, allowing faster processing when high precision is not critical

Inventive Principle:
Principle #35Parameter changes

4Reliability

If k-nearest neighbor searches are performed on large datasets, then search completeness improves, but processing time increases significantly

Engineering Contradiction:
Improvesearch completenessVSAvoidprocessing time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent implements preprocessing steps such as data indexing, vector quantization, and partitioning before performing the actual k-NN search. By organizing the data into inverted files or priority queue structures in advance, the system reduces the computational burden during the search phase, enabling complete k-NN searches across large datasets without excessive processing time

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent employs dynamic search strategies that adapt the search depth and scope based on intermediate results and query characteristics. The system can dynamically adjust between exhaustive search (for complete results) and approximate search (for faster results), allowing flexibility in balancing search completeness against processing time requirements based on real-time conditions

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS10649770B2Κ-selection using parallel processing
Publication Date: 2020.05.12 META PLATFORMS INC
  • US10649770B2 patent drawing
  • US10649770B2 patent drawing
  • US10649770B2 patent drawing

AI summary

In one embodiment, a method includes accessing a query vector; accessing object vectors; determining input distances corresponding to a distance between the query vector and the object vectors; accessing thread queues; accessing a warp queue; for each of the input distance values: selecting one of the thread queues, when the input distance value is less than a greatest one of the distance values stored in the selected thread queue, inserting the input distance value into the thread queues and ejecting the greatest distance values stored in the thread queue, and when a greatest distance value stored in any of the thread queues is less than a greatest distance value stored in the warp queue, merging the thread queue with the warp queue; identifying the objects represented by an object vector corresponding to the distance values stored in the warp queue; and providing the search results for presentation.