This project has been validated on four GPUs:
| GPU | VRAM | Architecture | CUDA | Status |
|---|---|---|---|---|
| A100X 80GB | 80 GB | Ampere sm_80 | 12.0 | validated |
| A100 PCIE 40GB | 40 GB | Ampere sm_80 | 12.8 | validated |
| A100 SXM4 80GB | 80 GB | Ampere sm_80 | 12.6–12.8 | validated |
| RTX 5060 Ti 16GB | 16 GB | Blackwell sm_120 | 13.0 | validated |
All raw results are in the results/ folder.
This document explains how to reproduce the validation on rented GPU hardware — no local GPU required.
Total cost: under $3. Total time: under 30 minutes.
Running make check builds and runs src/validate.cu, which:
- Reports the GPU device properties (name, compute capability, SM count, HBM bandwidth, driver version)
- Runs the full four-stage retrieval pipeline across 5 corpus sizes (1K to 16K memories) with 768-D embeddings
- Measures per-stage latency with
cudaEventtiming (sub-microsecond accuracy) - Performs a correctness check: compares the GPU's top-10 against a brute-force CPU top-10 and reports recall@10
- Writes a structured
results/results.jsonto the current directory
The output JSON is self-contained and ready to paste into the paper or attach to a GitHub issue.
Beyond make check, the repo includes several benchmark tiers:
# Core validation (5 corpus sizes, 100 queries each)
make check # -> results/results.json
# Demo-level GPU kernel timing (4 workloads)
make demo-av # 60 Hz, 2.4K memories, 1 ms budget
make demo-robot # 1 kHz, 10K memories, 1 ms budget
make demo-ar # 90 Hz, 27K memories, 5 ms budget
make demo-voice # 30 Hz, 9K memories, 20 ms budget
# Wall-clock latency benchmarks (includes kernel launch overhead)
make bench-av # 10s, 2.4K memories
make bench-robot # 10s, 6K memories
make bench-ar # 50s, 20K memories
make bench-voice # 30s, 3K memories
# Sustained duration tests (real-world length)
make bench-sustained # all four 15-30s tests
# Corpus-size scaling sweep
make bench-scale # 60 Hz × 15s at N = 1K, 5K, 10K, 20K, 50K
# GPU keepalive variants (for low-rate workloads)
make bench-av-keepalive # 10s, 2.4K memories, keepalive ON
make bench-av-30s-keepalive # 30s, 5K memories, keepalive ONAll benchmark outputs go to the results/ folder as JSON.
Typical cost: $0.30–$0.80/hour for RTX 4090, $0.80–$1.50/hour for A100
- Sign up at vast.ai and add $5 of credit
- Console > Instances, search for:
- GPU:
RTX 4090,A100 PCIE,A100 SXM4, orH100 - Image:
pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel(any CUDA 12+ devel image) - Disk: 10 GB is plenty
- GPU:
- Click Rent and wait for boot
- Connect via SSH
apt-get update && apt-get install -y git build-essential
git clone https://github.com/antonellof/MARS.git
cd MARS
make info # verify nvcc + GPU
make # build everything
make check # core validation -> results/results.json
# Full suite (optional, ~5 min total)
make demo-av && make demo-robot && make demo-ar && make demo-voice
make bench-av && make bench-robot && make bench-ar && make bench-voice
make bench-sustained
make bench-scale- Destroy the instance immediately after — vast.ai bills by the second
- Download results before destroying:
# From your local machine
scp -P <port> root@<host>:/root/MARS/results/*.json .Typical cost: $1.10/hour for A100 PCIE 40GB, $1.89/hour for A100 SXM4 80GB
pip install lambda-cloud
lambda-cloud gpu launch --instance-type gpu_1x_a100_pcie --region us-west-1
ssh ubuntu@<instance-ip>
git clone https://github.com/antonellof/MARS.git
cd MARS && make && make check
scp ubuntu@<instance-ip>:~/MARS/results/*.json .
lambda-cloud gpu terminate <instance-id>Typical cost: $0.44/hour for RTX A5000, $1.89/hour for A100 80GB
- Sign up at runpod.io
- Deploy a Pod with:
- GPU:
RTX A6000,A100 80GB, orH100 PCIe - Template:
RunPod PyTorch 2.1(includes CUDA 12) - Disk: 10 GB
- GPU:
- Click Connect > Web Terminal
- Same build and validation steps as above
- Download results via the web UI or
runpodctl send - Stop the pod when done
Typical cost: $1.15/hour for A100, $2.30/hour for H100
- Sign up at paperspace.com
- Gradient > Notebooks > Create Notebook
- Choose an A100 machine type and the PyTorch template
- Open a terminal inside the notebook
- Same build and validation steps
- Download results via the notebook file browser
These are the measured results from the project's A100X validation run. Your results should be in the same ballpark (within 2x for different GPUs).
| N | Similarity | Rerank | Top-K | BFS | Total | QPS | Recall@10 |
|---|---|---|---|---|---|---|---|
| 1,000 | 0.014 ms | 0.010 | 0.564 | 0.095 | 0.684 | 1,463 | 1.00 |
| 2,000 | 0.016 ms | 0.009 | 0.505 | 0.097 | 0.627 | 1,596 | 0.90 |
| 4,000 | 0.017 ms | 0.008 | 0.412 | 0.085 | 0.522 | 1,917 | 0.80 |
| 8,000 | 0.028 ms | 0.008 | 0.803 | 0.088 | 0.927 | 1,079 | 0.80 |
| 16,000 | 0.061 ms | 0.008 | 0.803 | 0.085 | 0.957 | 1,045 | 0.60 |
After a successful run, please open a GitHub issue with:
- The full contents of
results/results.json - The output of
make info(GPU name, nvcc version) - The output of
nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv - Any unexpected warnings from the build or runtime
Your results will be added to the README's benchmark table with attribution.
Use a *-devel image (pytorch/pytorch:2.1.0-cuda12.1-cudnn8-devel), not
a *-runtime image. Alternatively: apt-get install -y nvidia-cuda-toolkit
The container was not launched with GPU access. On vast.ai this should be
automatic. On Docker, you need --gpus all.
CUDA toolkit too old. Need 11.8+. Check with nvcc --version.
Likely a compute-capability mismatch. The Makefile targets sm_70–sm_89.
For H100 (sm_90), add -gencode arch=compute_90,code=sm_90 to the
GENCODE list in the Makefile.
Correctness issue on your GPU. Most common cause is an atomicCAS
pointer-type mismatch on older toolchains. Please open a GitHub issue.
The --expt-relaxed-constexpr flag suppresses most warnings. If you still
see thousands of lines, your nvcc is probably pre-11.8.
./validate <n_queries_per_config> <embedding_dim>Defaults: 100 queries, 768 dimensions. Examples:
./validate 500 1024 # 500 queries, 1024-D embeddings
./validate 50 512 # 50 queries, 512-D embeddings