Zenaique

Explain what NVIDIA CAGRA buys you over CPU HNSW and the operational catch that decides whether you should reach for it.

Flashcard·Medium·4.0 · 0·~30s·Asked atForethoughtGnaniZilliz·Relevant atNVIDIA
Attempt it
TL;DR

CAGRA (NVIDIA's GPU graph-ANN, inside the RAFT library) gives you roughly 5-10x QPS over CPU HNSW at the same recall.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

A CPU is like one really smart accountant doing additions one at a time. A GPU is like a stadium full of slightly dumber accountants who can all add at the same time. For vector search, where you need to compute thousands of small dot products, the stadium wins by a huge margin, often 10x faster. **But** the stadium has a tiny private vault, way smaller than the accountant's filing cabinet, and renting the stadium is much more expensive per square foot. So you bring the stadium in when you have a lot of queries pouring in and need them answered now; you don't bring it in just to store a billion items cheaply.

Key concepts

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

GPU accelerated ANN has been around for a decade (Faiss had GPU indexes in 2017), but the 2023-2024 NVIDIA RAFT / CAGRA release was the moment GPU-ANN became a serious production option rather than a research curiosity. The interview signal is whether the candidate understands what GPU-ANN actually buys, what it actually costs, and when to reach for it.

The headline: 5-10x QPS over CPU HNSW at the same recall, paired with 5-10x worse cost-per-byte-of-storage. That makes CAGRA the right tool for QPS-binding or latency-binding workloads and the wrong tool for storage-binding workloads. Calibrating to that distinction is the whole answer.

What CAGRA actually is

CAGRA (CUDA Accelerated Graph Index) is a GPU-native graph ANN algorithm, published by NVIDIA in 2023 and shipped inside their RAFT library of GPU primitives. The graph structure is similar in spirit to HNSW (small world graph, greedy walk) but flatter (single or shallow hierarchy) to match GPU SIMT execution.

During serving, both the graph topology and the raw vectors live in GPU HBM. Each query launches a CUDA kernel that maintains a candidate list in shared memory, evaluates many candidate distances in parallel using tensor cores or SIMD float lanes, expands neighbors, and iterates until convergence. The end to end query cost is dominated by HBM bandwidth and the cost of the distance kernel, both of which are dramatically better on GPU than CPU.

The public CAGRA paper claims 4-25x query speedup over CPU HNSW depending on dimensionality and recall target, with the high end on 1024+-dim vectors at recall 0.95. Independent benchmarks (BAAI, Anthropic, Milvus) confirm the 5-10x range as the typical production win.

Why HBM is the binding constraint
The killer 2026 use case: GPU-resident embedding pipelines
Decision rubric for 2026
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.
PropertyCPU HNSWCAGRA (GPU)DiskANN
Primary storageRAMGPU HBMSSD
Per-query latency~1-3 ms~0.2-1 ms~5-15 ms
Sustained QPS100-1000/core10k-100k/GPU100-500/box
$/byte of storage1x baseline5-10x worse0.1-0.3x baseline
Max single-node index~1TB RAM80-192GB HBMMulti-TB SSD
Best forDefault productionHigh QPS, low latency, mid-scaleCost first billion scale

Real products, models, and research that use this idea.

  • Milvus 2.4+ ships CAGRA as a first class index type, recommended for high-QPS RAG and recommendation backends.
  • Vespa offers CAGRA integration via its tensor framework for hybrid scoring at scale.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow does CAGRA pair with PQ to handle indexes that exceed HBM?
A

RAFT exposes PQ encoding on the GPU; CAGRA-PQ compresses vectors to ~32-64 bytes each, letting a single H100 hold ~1-2B vectors. Recall drops are similar to CPU IVF-PQ at the same compression.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Assuming GPU-ANN is universally better than CPU HNSW because GPUs are faster. The cost per byte of memory inversion means GPU-ANN is the wrong choice for cost first storage bound workloads; it shines only when QPS or latency is the binding constraint.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • CAGRA sits inside NVIDIA RAFT; it is GPU-native graph ANN

  • 5-10x QPS over CPU HNSW at the same recall on equivalent hardware

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
HNSW vs IVF, when…
Flashcard·Medium