Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
CAGRA (NVIDIA's GPU graph-ANN, inside the RAFT library) gives you roughly 5-10x QPS over CPU HNSW at the same recall.
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.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: name RAFT/CAGRA + the throughput win + HBM and cost catches + Milvus/Vespa integration + the decision rubric (QPS-binding vs cost-binding).
| Property | CPU HNSW | CAGRA (GPU) | DiskANN |
|---|---|---|---|
| Primary storage | RAM | GPU HBM | SSD |
| Per-query latency | ~1-3 ms | ~0.2-1 ms | ~5-15 ms |
| Sustained QPS | 100-1000/core | 10k-100k/GPU | 100-500/box |
| $/byte of storage | 1x baseline | 5-10x worse | 0.1-0.3x baseline |
| Max single-node index | ~1TB RAM | 80-192GB HBM | Multi-TB SSD |
| Best for | Default production | High QPS, low latency, mid-scale | Cost first billion scale |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
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.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.