Skip to main content
QUICK REVIEW

[논문 리뷰] ParlayANN: Scalable and Deterministic Parallel Graph-Based Approximate Nearest Neighbor Search Algorithms

Magdalen Dobson, Zheqi Shen|arXiv (Cornell University)|2023. 05. 07.
Time Series Analysis and ForecastingComputer Science인용 수 3
한 줄 요약

ParlayANN은 빌리언 스케일 데이터셋에서 고처리량, 고리콜브를 달성하기 위해 네 가지 최신 기술 기반 그래프 기반 근사 근접 이웃 검색(ANNS) 알고리즘에 대해 확장 가능하고 결정론적이며 락 없는 병렬 구현을 제공한다. 순차적 병목 현상과 락을 제거함으로써 다양한 워크로드에서 뛰어난 병렬 확장성과 결정론적 출력을 달성하며, 기존의 비그래프 기반 및 그래프 기반 방법보다 뛰어나게 성능을 발휘한다. 특히 분포 외부 쿼리에서 두각을 나타낸다.

ABSTRACT

Approximate nearest-neighbor search (ANNS) algorithms are a key part of the modern deep learning stack due to enabling efficient similarity search over high-dimensional vector space representations (i.e., embeddings) of data. Among various ANNS algorithms, graph-based algorithms are known to achieve the best throughput-recall tradeoffs. Despite the large scale of modern ANNS datasets, existing parallel graph based implementations suffer from significant challenges to scale to large datasets due to heavy use of locks and other sequential bottlenecks, which 1) prevents them from efficiently scaling to a large number of processors, and 2) results in nondeterminism that is undesirable in certain applications. In this paper, we introduce ParlayANN, a library of deterministic and parallel graph-based approximate nearest neighbor search algorithms, along with a set of useful tools for developing such algorithms. In this library, we develop novel parallel implementations for four state-of-the-art graph-based ANNS algorithms that scale to billion-scale datasets. Our algorithms are deterministic and achieve high scalability across a diverse set of challenging datasets. In addition to the new algorithmic ideas, we also conduct a detailed experimental study of our new algorithms as well as two existing non-graph approaches. Our experimental results both validate the effectiveness of our new techniques, and lead to a comprehensive comparison among ANNS algorithms on large scale datasets with a list of interesting findings.

연구 동기 및 목표

  • 대규모 멀티코어 시스템을 효율적으로 활용할 수 있는 그래프 기반 ANNS 알고리즘에 대한 확장 가능하고 결정론적인 병렬 구현의 부족을 해결한다.
  • 기존의 구현 방식이 각 정점 락에 의존하여 수십 스레드를 초과하면 성능이 저하되는 확장성 한계를 극복한다.
  • 복구, 복제 등 재현 가능성이 요구되는 사용 사례를 지원하기 위해 ANNS에서 결정론적 동작을 가능하게 한다.
  • 빌리언 스케일 데이터셋에서 그래프 기반 및 비그래프 기반 ANNS 알고리즘을 종합적으로 평가하여 병렬 실행 조건 하에서의 성능 및 리콜 간의 상충 관계를 규명한다.
  • 향후 대규모 벡터 검색 분야의 연구 및 구현을 위해 재사용 가능한 도구와 병렬 알고리즘 구현을 포함한 새로운 오픈소스 라이브러리(ParlayANN)를 제공한다.

제안 방법

  • ParlayLib 병렬 프로그래밍 프레임워크를 사용하여 네 가지 최신 기술 기반 그래프 기반 ANNS 방법(HNSW, HCNNG, LSH-Graph, GDSR)에 대해 락 없는 병렬 알고리즘을 설계한다.
  • 공유 메모리 기반의 워크스틸링 실행 모델을 적용하여 경쟁을 최소화하고 락을 피함으로써 수백 개의 코어에서 뛰어난 확장성을 달성한다.
  • 전역 우선순위 큐에 의해 정점 처리 순서가 고정된 결정론적 그래프 구축 및 검색 전략을 사용하여 런타임 간 동일한 출력을 보장한다.
  • 그래프 탐색과 효율적인 메모리 액세스 패턴을 조합한 하이브리드 인덱싱 전략을 구현하여 가짜 공유를 줄이고 로드 밸런싱을 향상시킨다.
  • ParlayLib 럨타임 시스템을 활용하여 그래프 구축 및 쿼리 처리 시 세밀한 병렬성을 표현하면서도 정확성과 결정론성을 유지한다.
  • 조기 종료, 캐시 인식 데이터 레이아웃, 병렬 우선순위 큐 연산과 같은 알고리즘 최적화를 구현하여 대규모 데이터셋에서의 성능을 향상시킨다.
Figure 1 . Scalability of original and our new implementations of four ANNS algorithms on various number of threads. Within each subfigure, all numbers are speedup numbers relative to the original implementation on one thread . Higher is better. Results were tested on a machine with 48 cores using d
Figure 1 . Scalability of original and our new implementations of four ANNS algorithms on various number of threads. Within each subfigure, all numbers are speedup numbers relative to the original implementation on one thread . Higher is better. Results were tested on a machine with 48 cores using d

실험 결과

연구 질문

  • RQ1빌리언 스케일 데이터셋에서 락 없는 결정론적 병렬 구현 방식이 수백 개의 코어로도 효율적으로 확장 가능한가?
  • RQ2분포 외부 쿼리에서 그래프 기반 ANNS 알고리즘은 비그래프 기반 접근 방식(예: IVF, LSH)과 비교해 리콜과 처리량 측면에서 어떻게 성능을 발휘하는가?
  • RQ3고코어 수를 가진 공유 메모리 병렬 환경에서 최신 기술 기반 ANNS 알고리즘의 성능 및 확장성 특성은 어떠한가?
  • RQ4결정론적 그래프 기반 ANNS는 특히 분포 외부 쿼리가 많은 실세계 환경에서 높은 리콜과 처리량을 동시에 달성할 수 있는가?
  • RQ5그래프 구축 및 검색에서의 알고리즘 선택이 대규모 벡터 검색에서 병렬 확장성과 결정론성에 어떤 영향을 미치는가?

주요 결과

  • ParlayANN은 50개 이상의 스레드를 초월해 뚜렷한 성능 향상을 보이며, 기존의 락 기반 구현 방식이 수십 개의 스레드에서 포화 상태에 도달하는 것과는 달리 대규모 데이터셋에서 뛰어난 확장성을 입증한다.
  • 라이브러리는 여러 런타임 간 동일한 출력을 보이며, 재현 가능성과 일관성을 요구하는 생산 환경에서의 핵심 문제를 해결한다.
  • 알려지지 않은 그래프 기반 알고리즘인 HCNNG가 분포 외부 쿼리에서 HNSW 및 기타 방법보다 높은 리콜을 달성하여 이전의 알고리즘 우월성에 대한 가정을 도전한다.
  • ParlayANN의 그래프 기반 방법은 IVF 및 LSH 기반 접근 방식보다 일관되게 높은 리콜을 달성하며, 특히 후자에서 심각한 성능 저하가 발생하는 분포 외부 쿼리에서 두각을 나타낸다.
  • ParlayANN의 처리량은 메모리 기반 워크로드에서 디스크 기반 시스템인 SPANN 및 DiskANN을 뛰어넘으며, 주로 메모리 제약 조건을 고려한 상황에서도 성능이 뛰어나다.
  • 벤치마킹 연구 결과, 기존의 공개된 ANNS 구현 방식은 종종 대표성 없는 조건(예: 소규모 데이터셋, 순차적 실행)에서 결과를 보고하여 실제 적용 가능성에 한계가 있다.
Figure 2 . An example of ANNS graph and a greedy search. The blue arrows represent directed edges in the proximity graph, which is a mix of long and short edges. Below is an example of NNS query on point $q$ (red point). The algorithm starts with adding the starting point $A$ as the only point in th
Figure 2 . An example of ANNS graph and a greedy search. The blue arrows represent directed edges in the proximity graph, which is a mix of long and short edges. Below is an example of NNS query on point $q$ (red point). The algorithm starts with adding the starting point $A$ as the only point in th

이 논문 읽기

누빈트 뷰어에서 원문을 열고, 읽으면서 궁금한 곳을 바로 물어보세요.

누빈트에서 이 논문 읽기

이 리뷰는 AI가 논문 원문을 바탕으로 만들었습니다. 인용하기 전에 원문을 확인해 주세요.