Exact vector search on GPUs and CPUs
An exact search index for int8 vectors, measured on six NVIDIA GPUs and four CPUs against PyTorch's fastest brute force, F.cosine_similarity, FAISS and NVIDIA cuVS. Every Riptorch result returned the float64 top-10, in order, on every query.
Abstract
A brute-force vector search computes the similarity of each query to every stored vector and keeps the best . In PyTorch the fastest way to do that on a GPU is to normalise the vectors once and run a half-precision matrix multiply followed by torch.topk. Rounding in that pipeline merges close scores, so the returned top-10 is often not the true top-10 order of the stored vectors.
Riptorch's exact similarity index stores integer vectors and returns the top-10 in the order a float64 reference gives. On the measurements in this paper it returned the float64 top-10, in the same order, for every query on every machine. It was also faster than PyTorch's fastest brute force at the sizes where search is expensive: 1.89–3.85× at 8 million vectors on five data-centre and workstation GPUs, 1.86× at 10 million 384-dimensional vectors on an RTX 4090 (where float16 returned the exact order for 7 of 16 queries), 4.2× NVIDIA cuVS brute force and 7.0× FAISS GpuIndexFlatIP on the same vectors, and 1.58–8.49× at 2 million vectors on four CPUs. It is slower at 100 thousand vectors on GPUs and on most GPUs at 500 thousand, at 64 or more queries per call, and against approximate indexes.
The problem
A search result is exact in this paper when its top-10 identifiers equal the top-10 of a float64 reference computed from the same stored vectors, in the same order, with ties broken by the lowest index. The question is whether a pipeline returns that ranking, and how fast.
Cosine scores near the top of a ranking are close together. A float16 number carries 11 significant bits, so near 0.9 consecutive float16 values are about 0.0005 apart, and bfloat16 values about 0.004 apart. When the gap between neighbours in a top-10 is smaller than that, rounding turns the pair into a tie or swaps it, and which document wins then depends on the kernel, the batch size and the device. In the BEIR FiQA data used in the companion paper, How embedding pipelines change the answer, 38.9% of queries have a gap below 0.001 between the 10th and 11th score with bge-base.
Float32 scoring avoids most of that drift but took 1.9–2.6 times as long as float16 on the GPUs measured here. The plain spelling most code uses, F.cosine_similarity per query followed by torch.topk, is exact enough in float32 and 56–114 times slower again.
Method
What is measured
Riptorch's exact similarity index takes int8 vectors (float embeddings are quantised to int8 first; the companion paper measures what quantisation does to rankings) and a batch of int8 queries, and returns the top-10 identifiers per query. The claim under test is behavioural: the returned top-10 equals the float64 top-10 of the same stored vectors, in order, with ties to the lowest index, and the question is how long it takes. How the index reaches that result is not described here.
Baselines
Every baseline ran on the same machine as Riptorch, in the same session, on the same stored values.
- PyTorch's fastest brute force (
normdot): the documents are normalised once withF.normalize(not timed), thentorch.topk(F.normalize(Q) @ Xn.T, 10). In the GPU sweep (Tables 2 and 3) this ran in float32 with PyTorch's default matmul settings; on that data float32 also returned the exact order on every query, so those rows compare speed at equal exactness. In the embedding-scale runs (Tables 4 and 5) it is named by precision: float16 (.half()vectors, PyTorch's fastest) and float32. - The common spelling:
torch.topk(F.cosine_similarity(q[None], X, dim=1), 10)per query. - FAISS
GpuIndexFlatIPon the normalised float32 vectors (faiss-gpu-cu12 1.14.1). The pip wheels have no sm_90 kernels, so FAISS GPU did not run on the H100. - NVIDIA cuVS 26.10
brute_force(exact float32 inner product). - On CPUs, PyTorch's fastest is the same
normdotspelling in float32 on the CPU (it was faster there than on Apple's MPS back end, so the CPU row is the baseline on the Apple M4).
Data
- GPU sweep and CPU runs: N documents × 256 dimensions and 16 queries, integers in the int8 range drawn from NumPy's
default_rng(1234), with 3 planted near-duplicates per query so the top of each ranking is meaningful. Float32 holds these values and their dot products exactly, so every method scores the same numbers. - Embedding-scale runs: N unit vectors in 384, 768 or 1,024 dimensions from 8,192 Gaussian clusters (spread 0.6), 1% exact duplicates, quantised to int8; queries are corpus vectors plus noise, re-quantised; seed 7. These are synthetic vectors shaped like an int8 vector store, not a public dataset.
Timing and truth
- Each method ran in its own process. One warm-up call, then the median of 7 calls (3 calls for
F.cosine_similarityat 1 million vectors or more). A call is the whole query batch until the result identifiers are a Python list on the host, so all of Riptorch's work is included. - Truth: float64 cosine of the stored vectors (NumPy, or a float64 GPU matmul for the embedding-scale runs), top-10 per query, ties by the lowest index.
- These runs did not compute confidence intervals. Repeatability was checked instead: the pinned CUDA 12 rerun of Tables 4 and 5 ran every row twice, and the two passes agree within 0.3 ms on every row and within 4% of the original campaign.
Machines and software
| machine | where | host | driver / CUDA | stock software | Riptorch |
|---|---|---|---|---|---|
| NVIDIA H100 SXM 80GB, H200 SXM, B200, RTX PRO 6000 Blackwell Server, A100 SXM 80GB | RunPod, 29 Nov 2026 | Xeon 8470 / Xeon 6548Y+ / Xeon 6972P / EPYC 9554 / EPYC 7742 | 595.112.07 / 13.2 (H200: 575.57.08 / 12.9) | PyTorch 2.13.0+cu129 | development build, 29 Nov |
| NVIDIA RTX 4090 24 GB | RunPod, 29 Nov 2026 | – | CUDA 13.2 | PyTorch 2.13.0+cu129 | later development build, 29 Nov |
| NVIDIA RTX 4090 24 GB, H100 80GB HBM3 (original campaign) | RunPod, 30 Nov 2026 | EPYC 75F3 / Xeon 8470 | 595.112.07 | PyTorch 2.13.0+cu129, FAISS 1.14.1, cuVS 26.10 | 0.4.0 wheel (see note below) |
| NVIDIA RTX 4090 24 GB, H100 80GB HBM3 (pinned rerun) | RunPod, 30 Nov 2026 | Ryzen 9 9950X / Xeon 8468 | 595.112.07 / 13.2 | PyTorch 2.13.0+cu129, FAISS 1.14.1, cuVS 26.10; every library on the same CUDA 12.9 libraries | 0.4.0 wheel |
| Intel Xeon Platinum 8488C (Sapphire Rapids), 8 cores | EC2 c7i.4xlarge, us-east-2, 30 Nov 2026 | PyTorch 2.15.0+cpu | 0.4.0 release wheel | ||
| AMD EPYC 9R14 (Genoa), 16 cores | EC2 c7a.4xlarge | PyTorch 2.15.0+cpu | 0.4.0 release wheel | ||
| AWS Graviton4 (Neoverse V2), 16 cores | EC2 c8g.4xlarge | PyTorch 2.15.0+cpu | 0.4.0 release wheel | ||
| Apple M4, 10-core CPU | EC2 mac-m4.metal, us-east-2 | PyTorch 2.15.0 | 0.4.0 release wheel |
Tables 4 and 5 are from the pinned rerun. The 1M-vector rows, the 64-query rows and the comparisons with F.cosine_similarity at embedding scale are from the original campaign of the same day, in which Riptorch probably loaded CUDA 13 libraries through an ONNX Runtime dependency while stock PyTorch used CUDA 12.9; the pinned rerun removed that difference and agreed with the original within 4%.
Results
Five GPUs, 100 thousand to 8 million vectors
| GPU | 100K | 500K | 2M | 8M | 8M time, PyTorch → Riptorch | 8M vs F.cosine_similarity |
|---|---|---|---|---|---|---|
| H100 SXM | 0.47× | 0.91× | 1.67× | 2.09× | 5.81 → 2.78 ms | 156× |
| H200 SXM | 0.55× | 1.00× | 1.48× | 2.05× | 5.66 → 2.76 ms | 136× |
| B200 | 0.31× | 0.89× | 1.52× | 1.89× | 4.86 → 2.57 ms | 123× |
| RTX PRO 6000 | 0.22× | 0.80× | 2.62× | 3.85× | 13.13 → 3.41 ms | 214× |
| A100 SXM | 0.59× | 1.13× | 1.65× | 2.35× | 11.00 → 4.69 ms | 150× |




| GPU | 16 queries | 64 queries | 256 queries |
|---|---|---|---|
| H100 SXM | 1.67× | 1.17× | 0.77× |
| H200 SXM | 1.48× | 1.18× | 1.19× |
| B200 | 1.52× | 1.05× | 1.06× |
| RTX PRO 6000 | 2.62× | 1.13× | 1.03× |
| A100 SXM | 1.65× | 1.43× | 1.50× |

On the RTX 4090 the same benchmark at 2 million vectors, run on 29 November with a later development build, gave 1.46 ms for the exact index against 3.29 ms for PyTorch's fastest (2.26×), and 1.21× at 500 thousand vectors.
Run gpu-sweep-2026-11-29 (sections 1–2) and cuda-search-2026-11-29. Correctness in the same sweep: the GPU search matched Riptorch's CPU back end on 704 of 704 checks (4 metrics, 44 shapes including ties) on every GPU.
Embedding-scale search: 10 and 50 million vectors
| vectors × dims | queries | Riptorch exact int8 | PyTorch float16 | PyTorch float32 | cuVS brute force | FAISS GpuIndexFlatIP | vs float16 |
|---|---|---|---|---|---|---|---|
| 10M × 384 | 1 | 6.41 (1/1) | 8.30 (0/1) | 16.50 (1/1) | 17.26 (1/1) | 40.04 (1/1) | 1.30× |
| 10M × 384 | 16 | 5.47 (16/16) | 10.17 (7/16) | 21.24 (16/16) | 22.99 (16/16) | 38.16 (15/16) | 1.86× |
| 10M × 768 | 1 | 9.34 (1/1) | 16.36 (0/1) | out of memory | out of memory | out of memory | 1.75× |
| 10M × 768 | 16 | 10.05 (16/16) | 18.38 (3/16) | out of memory | out of memory | out of memory | 1.83× |

At 10M × 384 with 16 queries the exact index is 1.86× PyTorch's fastest, 3.9× PyTorch float32, 4.2× cuVS brute force and 7.0× FAISS GpuIndexFlatIP. At 10M × 768, float32 vectors take 30.7 GB, more than the card's 24 GB, so only the float16 and int8 paths fit.
| vectors × dims | queries | Riptorch exact int8 | PyTorch float16 | PyTorch float32 | cuVS brute force | vs float16 | vs float32 |
|---|---|---|---|---|---|---|---|
| 10M × 768 | 1 | 4.13 (1/1) | 5.18 (0/1) | 10.02 (1/1) | 10.41 (1/1) | 1.25× | 2.43× |
| 10M × 768 | 16 | 5.51 (16/16) | 6.63 (3/16) | 16.34 (16/16) | 16.05 (15/16) | 1.20× | 2.97× |
| 10M × 1024 | 1 | 5.22 (1/1) | 6.79 (0/1) | 13.39 (1/1) | 13.80 (1/1) | 1.30× | 2.57× |
| 10M × 1024 | 16 | 6.52 (16/16) | 8.26 (4/16) | 21.16 (15/16) | 20.73 (15/16) | 1.27× | 3.25× |
| 50M × 384 | 1 | 11.31 (1/1) | 13.03 (0/1) | 25.59 (1/1) | – | 1.15× | 2.26× |
| 50M × 384 | 16 | 17.47 (16/16) | 19.43 (4/16) | 46.57 (16/16) | – | 1.11× | 2.67× |
| 50M × 384 | 64 | 65.43 (64/64) | 41.08 (15/64) | out of memory | – | 0.63× | – |



At 50 million 384-dimensional vectors, float32 takes 76.8 GB and int8 19.2 GB. With 64 queries per call, PyTorch's float32 search stopped with "CUDA out of memory" on the 80 GB card; the exact index answered in 65.43 ms with all 64 top-10s exact. Float16 fits and is faster there (41.08 ms) with 15 of 64 orders exact.
Against the common spelling, F.cosine_similarity per query, the exact index was 302× faster on the RTX 4090 and 206× on the H100 at 1M × 1,024 with 16 queries (original campaign run).
Four CPUs, 2 million vectors
| CPU | 100K | 500K | 2M | 2M time, PyTorch → Riptorch | 2M vs F.cosine_similarity |
|---|---|---|---|---|---|
| AMD EPYC 9R14 (c7a.4xlarge) | 6.38× | 6.57× | 8.49× | 156.46 → 18.43 ms | 674× |
| Apple M4 (mac-m4.metal) | 3.21× | 3.53× | 3.75× | 66.89 → 17.84 ms | 178× |
| Intel Xeon 8488C (c7i.4xlarge) | 2.86× | 1.97× | 2.93× | 95.01 → 32.42 ms | 308× |
| AWS Graviton4 (c8g.4xlarge) | 1.10× | 1.20× | 1.58× | 70.29 → 44.36 ms | 40× |


On Graviton4, Riptorch's float32 index (not exact by construction, but exact on this data) was faster than its exact index at 2 million vectors: 34.76 ms, 2.02× PyTorch.
Limitations and next steps
The limits of these results, each with its cause and, where one is planned, the next step.
- Small collections on GPUs. Below about one million vectors Riptorch's fixed cost per call dominates: 0.22–0.59× of PyTorch's fastest at 100 thousand vectors and 0.80–1.13× at 500 thousand on the five sweep GPUs; on the RTX 4090 at 100 thousand, 0.61 ms against 0.34 ms, and 0.80× of float16 at 1M × 384 with one query. At 100 thousand vectors Riptorch's float index is faster than its exact index, and still slower than PyTorch.
- Many queries per call. With 64 queries per call it was 0.45–0.75× of PyTorch float16 on the RTX 4090 and H100 (float16 then returns the exact order for 13–38 of 64 queries), and 0.77× of float32 on the H100 at 256 queries in the sweep. Large query batches are open work; the reason is under investigation.
- The H100 at one million vectors with 1–16 queries: 0.71–1.00× of float16. Cause: under investigation.

- Approximate indexes. FAISS IVF and cuVS IVF answered in 0.13–2.9 ms with recall@10 of 0.99–1.0 at 16 or more queries on the clustered synthetic data (0.87–0.90 on FiQA). Cause: Riptorch has no approximate index; when an approximate top-10 is acceptable, those are faster.
- int16 exact search on CUDA is slow: 157 ms for 648 queries over 57,638 FiQA passages against 6.7 ms for int8. The int16 path is the one that keeps the float ranking of the original embeddings (see the companion paper), so bringing it near int8 speed is open work. Cause: under investigation.
- Integer data only. The exact index takes integer vectors; float embeddings must be quantised first.
- Statistics. The search rows are medians of 7 calls without confidence intervals; the evidence for stability is the repeated pass (within 0.3 ms) and the rerun (within 4%). The runs used development builds and 0.4.0 wheels of Riptorch, named in the machines table.
Reproduce it yourself
Run kits/exact-vector-search from the public riptide-reproduce repository: one command, a few minutes on a laptop, public software only. It reproduces PyTorch's fastest brute force in float32, float16 and bfloat16 against a float64 top-10, and Riptorch 0.4.0's exact index returning the float64 order on every query. Every baseline's value and its error against the exact answer are printed and saved to errors.csv, and the exact results print the same hash on every machine: if your float hash differs from ours or a colleague's, that is precision drift in your pipeline.
Reproduction notes
- Software. Riptorch is distributed as binary wheels; release 0.4.0 is pending, and until it is published the Riptorch page and the playgrounds are the public entry points. Evaluation builds are available through Request an evaluation.
- GPU sweep and CPU rows. Data as in the Method section, one process per (method, size, device), median of 7, float64 truth cached per size. The 1-minute load average is recorded with every timing; the Linux EC2 hosts ran nothing else.
- Embedding-scale rows. The int8 corpus, queries and float64 truth are generated once per shape, then each method is timed in its own process. The pinned rerun used a fresh virtual environment with no ONNX Runtime and every library loading the same CUDA 12.9 libraries, checked in each process.
- Records. Each run keeps its raw JSON lines, logs and machine records (driver, CUDA, CPU, clocks; serials and addresses removed). Run names:
gpu-sweep-2026-11-29,cuda-search-2026-11-29,workloads-2026-11-30(withpinned-cu12),showcase/ec2-2026-11-30,dec-posts-rerun-2026-11-30. Evaluation partners can have the raw files on request.
Date and version
Version 1.2, 30 November 2026. Measurements from 29 and 30 November 2026. Corrections will be published as new versions of this page with the changes listed. Updated 1 December 2026: limitations section retitled. Updated 1 December 2026: added "Reproduce it yourself".
Working with Riptide
Riptide works with a small number of teams. Each engagement starts with 4 weeks inside your systems, learning how your models, data and infrastructure work. Only then does Riptide apply its software to them. Contact samario@riptidecompute.com or riptidecompute.com/evaluate.