Skip to content

rhossi/cuvs-lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Semantic Search Benchmark: Milvus CPU vs GPU (cuVS)

Benchmark semantic search (nearest-neighbor search) on NVIDIA DGX Spark hardware, comparing Milvus CPU indexes vs GPU-accelerated indexes (powered by cuVS) in the same database.

What's being compared

Index Type Methods Backend
Milvus CPU FLAT, IVF_FLAT, HNSW CPU
Milvus GPU GPU_BRUTE_FORCE, GPU_IVF_FLAT, GPU_CAGRA cuVS on GPU

Prerequisites

  • NVIDIA DGX Spark (or any machine with an NVIDIA GPU and CUDA)
  • Docker and Docker Compose (with NVIDIA Container Toolkit for GPU support)
  • uv package manager

Setup

1. Start Milvus

docker compose up -d

This starts Milvus standalone with etcd and MinIO. The default configuration uses the GPU-enabled Milvus image.

If the GPU image doesn't work on your platform (e.g., no ARM64 GPU image available), edit docker-compose.yml:

  • Change the image from milvusdb/milvus:v2.5.6-gpu to milvusdb/milvus:v2.5.6
  • Remove the deploy block

The notebook will detect whether GPU indexes are available and skip them if not.

2. Install Python dependencies

uv sync

For GPU support (cuVS and CuPy):

uv sync --extra gpu

3. Run the benchmark notebook

uv run jupyter lab

Then open benchmark.ipynb and run all cells.

Configuration

Key parameters in Cell 2 of the notebook:

Parameter Default Description
CORPUS_SIZES [10K, 100K, 500K, 1M] Vector corpus sizes to benchmark
DIM 384 Embedding dimension
N_QUERIES 100 Number of query vectors
K 10 Top-K neighbors to retrieve
METRIC_TYPE L2 Distance metric (GPU indexes don't support COSINE)
N_RUNS 10 Timed iterations per method

Outputs

  • benchmark_results.png -- Four-panel chart (latency, throughput, build time, recall)
  • Speedup summary table -- CPU vs GPU latency with speedup factors
  • Full results DataFrame -- All metrics for every method at every corpus size

Stopping Milvus

docker compose down

To also remove persisted data:

docker compose down -v

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors