What is CAGRA (GPU graph ANN)?
CAGRA (GPU graph ANN) is a proximity-graph approximate nearest-neighbor method designed from the ground up for GPU parallelism: it builds a fixed-degree neighbor graph with massively parallel kernels and searches that graph in batches so irregular CPU-style HNSW walks are replaced by hardware-friendly, high-throughput graph operations.
Why does ordinary HNSW map poorly onto GPUs without a redesign?
Classic HNSW search is sequential and data-dependent: the next neighbor depends on the previous distance comparisons, threads in a warp diverge, and memory accesses chase pointers across the graph. GPUs reward the opposite pattern – many threads executing similar instructions on contiguous or regularly strided data. Porting an unchanged CPU graph algorithm therefore leaves most of the device idle or stuck synchronizing divergent walks. CAGRA’s premise is that the graph structure itself and the search schedule must be chosen for the device: fixed out-degree lists, construction phases that expose huge parallel work, and query serving that batches many independent searches so the SMs stay busy. That is “GPU graph ANN” as a design goal, not merely “run HNSW kernels on a GPU.”
Construction follows a two-phase pattern that fits those constraints.
How does CAGRA build and search its graph?
Build typically starts with an initial k-nearest-neighbor graph – each point linked to a fixed number of approximate neighbors – produced by a parallel method such as NN-descent-style refinement or a partition-based accelerator that can even work out of core when the full set exceeds GPU memory. A second optimization pass then prunes and rewires edges to improve reachability and remove redundant paths while preserving a bounded degree, yielding a flat directed graph whose regular shape is easy to traverse in parallel. Search expands neighbor lists greedily (or with a bounded beam) across many queries at once; fixed degree keeps per-node work predictable for the scheduler. The graph is intended to live in GPU memory with the vectors for peak throughput, though workflows exist to detach or export the structure after build. Compared with NSG or Vamana on CPUs, CAGRA prioritizes implementation-centric parallelism over the same theoretical MRNG story – quality comes from heuristic optimization under GPU cost models.
Those properties open a practical split between where you build and where you serve.
How do hybrid GPU-build and CPU-serve pipelines use CAGRA?
Index construction is often the painful part of large embedding refreshes: hours of CPU HNSW insert time block model updates. Building with CAGRA on a GPU can cut that wall-clock dramatically, after which the graph may be converted into an HNSW-compatible structure for serving on ordinary CPU hosts that do not need a GPU in the query path. Vector databases such as Weaviate have publicly described this hybrid pattern – GPU-accelerated graph build, then CPU HNSW serve – alongside batching queries when the GPU remains in the serve loop for extreme QPS. The conversion step matters operationally: once the index is an HNSW on CPU, day-to-day serving cost and tooling match the rest of the HNSW ecosystem, while the GPU bill appears mainly at rebuild time.
CAGRA is therefore a throughput and build-time tool, with clear limits.
When should you choose CAGRA-style GPU graph ANN?
Prefer CAGRA when GPU memory can hold the working graph and vectors (or an out-of-core build path is available), when build speed or large-batch query throughput dominates, or when you can afford a hybrid build-on-GPU, serve-on-CPU workflow. Prefer CPU HNSW when incremental single-threaded inserts, mature CRUD, and simple deployment without accelerators matter more – still the default mental model for many Weaviate deployments. Prefer DiskANN-style designs when the bottleneck is host RAM versus SSD rather than CPU versus GPU. Always remeasure recall after export or conversion, and size batches so the device is saturated without blowing latency SLOs for interactive traffic. CAGRA is how graph ANN stopped treating the GPU as an afterthought.
CAGRA is a GPU-native fixed-degree proximity graph for fast parallel ANN build and search, often used to accelerate indexing before CPU HNSW serving. From here, robust pruning in graph ANN covers the edge-selection ideas shared with other flat graphs, the flat-versus-hierarchical graph page contrasts CAGRA’s flat layout with HNSW layers, and offline versus incremental construction frames when a fast GPU rebuild replaces continuous CPU inserts.