Skip to content
Open
Show file tree
Hide file tree
Changes from 41 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
bd2289b
null check
tarang-jain Oct 24, 2025
d8d9256
all tests
tarang-jain Oct 24, 2025
fa932cc
syntax error
tarang-jain Oct 24, 2025
b9acca7
add cuvs_ivf_pq pytest
tarang-jain Oct 24, 2025
119b0ba
format
tarang-jain Oct 24, 2025
37462e4
correct order in header
tarang-jain Oct 24, 2025
4ae79f0
format and docs
tarang-jain Oct 24, 2025
dedd71e
Merge branch 'main' of https://github.com/rapidsai/cuvs into cagra-be…
tarang-jain Oct 24, 2025
0c93b2a
correct header and params
tarang-jain Oct 24, 2025
47f879b
sparams to get increasing pareto
tarang-jain Oct 24, 2025
1f9d8e8
Merge branch 'main' into cagra-bench-params
tarang-jain Oct 27, 2025
9c8f72c
update pytests
tarang-jain Oct 27, 2025
4ea7705
merge ivf_pq tests
tarang-jain Oct 27, 2025
3a8909d
add new algos to current set of tests
tarang-jain Oct 27, 2025
0e49c6b
correct headers
tarang-jain Oct 27, 2025
ff64f48
Merge branch 'main' into cuvs-bench-pytests
tarang-jain Nov 5, 2025
3830f4a
Merge branch 'main' into cuvs-bench-pytests
tarang-jain Jan 27, 2026
3deffbe
Merge branch 'main' into cuvs-bench-pytests
cjnolet Jan 29, 2026
b5fbb40
Merge branch 'main' of https://github.com/rapidsai/cuvs into cuvs-ben…
tarang-jain Jan 29, 2026
42d4c0f
style
tarang-jain Jan 29, 2026
513cb7e
fix data_export and tests
tarang-jain Feb 1, 2026
ba47877
Merge branch 'main' into cuvs-bench-pytests
tarang-jain Feb 1, 2026
bf5442c
Merge branch 'release/26.04' into cuvs-bench-pytests
tarang-jain Mar 14, 2026
0c7cd2e
cmake change
tarang-jain Mar 16, 2026
f89d672
check arm cpu
tarang-jain Mar 16, 2026
bb74dc8
Merge branch 'release/26.04' into cuvs-bench-pytests
tarang-jain Mar 16, 2026
6ed5e06
undo cmake changes and conda env
tarang-jain Mar 16, 2026
a9e58a7
Merge branch 'cuvs-bench-pytests' of https://github.com/tarang-jain/c…
tarang-jain Mar 16, 2026
350db1b
style check
tarang-jain Mar 16, 2026
47586de
add vamana to the list
tarang-jain Mar 16, 2026
eb7e615
Merge branch 'release/26.04' into cuvs-bench-pytests
tarang-jain Mar 25, 2026
e9f0da7
single thread build
tarang-jain Mar 25, 2026
ed35be1
Merge branch 'cuvs-bench-pytests' of https://github.com/tarang-jain/c…
tarang-jain Mar 25, 2026
6f8d289
fix single thread config
tarang-jain Mar 25, 2026
268ab86
sync stream after vamana build
tarang-jain Mar 25, 2026
46ef644
do not skip state
tarang-jain Mar 25, 2026
f2c41da
fix style
tarang-jain Mar 25, 2026
284984a
add sync stream in dataset serialization
tarang-jain Mar 25, 2026
5edb4e5
rm sync stream in vamana wrapper
tarang-jain Mar 25, 2026
aa022a2
one more fix to serialize-dataset
tarang-jain Mar 25, 2026
23019c8
style
tarang-jain Mar 25, 2026
7ebf54f
lower value for L_load
tarang-jain Mar 28, 2026
690c72c
Merge branch 'main' into cuvs-bench-pytests
aamijar Apr 7, 2026
5b7f3bf
Merge branch 'main' into cuvs-bench-pytests
aamijar Apr 7, 2026
cda3731
Merge branch 'main' into cuvs-bench-pytests
tarang-jain May 13, 2026
f7191ae
Merge branch 'main' of https://github.com/rapidsai/cuvs into cuvs-ben…
tarang-jain May 13, 2026
f231647
debug statements
tarang-jain May 13, 2026
fb443c1
Merge branch 'cuvs-bench-pytests' of github.com:tarang-jain/cuvs into…
tarang-jain May 13, 2026
e239ea1
more debug prints
tarang-jain May 14, 2026
a17986e
more debug prints
tarang-jain May 14, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cpp/bench/ann/src/diskann/diskann_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void parse_build_param(const nlohmann::json& conf,
{
param.R = conf.at("R");
param.L_build = conf.at("L_build");
if (conf.contains("alpha")) { param.num_threads = conf.at("alpha"); }
if (conf.contains("alpha")) { param.alpha = conf.at("alpha"); }
if (conf.contains("num_threads")) { param.num_threads = conf.at("num_threads"); }
}

Expand Down
22 changes: 15 additions & 7 deletions cpp/src/neighbors/detail/vamana/vamana_serialize.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,20 @@ void serialize_dataset(raft::resources const& res,
const auto* strided_dataset =
dynamic_cast<const cuvs::neighbors::strided_dataset<T, int64_t>*>(dataset);
if (strided_dataset) {
auto h_dataset =
raft::make_host_matrix<T, int64_t>(strided_dataset->n_rows(), strided_dataset->dim());
raft::copy(res,
raft::make_host_vector_view(h_dataset.data_handle(),
strided_dataset->n_rows() * strided_dataset->dim()),
raft::make_device_vector_view(strided_dataset->view().data_handle(),
strided_dataset->n_rows() * strided_dataset->dim()));
auto nrows = strided_dataset->n_rows();
auto dim = strided_dataset->dim();
auto stride = strided_dataset->stride();
auto d_data = strided_dataset->view();
auto h_dataset = raft::make_host_matrix<T, int64_t>(nrows, dim);
RAFT_CUDA_TRY(cudaMemcpy2DAsync(h_dataset.data_handle(),
Comment thread
tarang-jain marked this conversation as resolved.
Outdated
sizeof(T) * dim,
d_data.data_handle(),
sizeof(T) * stride,
sizeof(T) * dim,
nrows,
cudaMemcpyDefault,
raft::resource::get_cuda_stream(res)));
raft::resource::sync_stream(res);
to_file(dataset_base_file, h_dataset);
} else {
RAFT_LOG_DEBUG("dynamic_cast to strided_dataset failed");
Expand All @@ -91,6 +98,7 @@ void serialize_dataset(raft::resources const& res,
try {
auto h_dataset = raft::make_host_matrix<T, int64_t>(dataset.extent(0), dataset.extent(1));
raft::copy(res, h_dataset.view(), dataset);
raft::resource::sync_stream(res);
to_file(dataset_base_file, h_dataset);
} catch (std::bad_alloc& e) {
RAFT_LOG_INFO("Failed to serialize dataset");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ groups:
base:
build:
search:
test:
build:
search:
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,10 @@ groups:
graph_build_algo: ["NN_DESCENT"]
search:
L_search: [10, 20, 30, 40, 50, 100, 200, 300]
test:
build:
graph_degree: [32]
intermediate_graph_degree: [32]
graph_build_algo: ["NN_DESCENT"]
search:
L_search: [10]
7 changes: 7 additions & 0 deletions python/cuvs_bench/cuvs_bench/config/algos/cuvs_vamana.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ groups:
search:
L_search: [10, 20, 30, 40, 50, 100, 200, 300]
num_threads: [32]
test:
build:
graph_degree: [32]
visited_size: [128]
alpha: [1.2]
search:
L_search: [10]
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ groups:
num_threads: [32]
search:
L_search: [10, 20, 30, 40, 50, 100, 200, 300]
test:
build:
R: [32]
L_build: [128]
alpha: [1.2]
num_threads: [1]
search:
L_search: [10]
5 changes: 3 additions & 2 deletions python/cuvs_bench/cuvs_bench/run/data_export.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#

Expand Down Expand Up @@ -213,9 +213,10 @@ def convert_json_to_csv_search(dataset, dataset_path):
write["build GPU"] = None
for col_idx in range(start_idx, len(build_df.columns)):
col_name = build_df.columns[col_idx]
write[col_name] = None
if col_name == "num_threads":
write["build_num_threads"] = None
else:
write[col_name] = None
for s_index, search_row in write.iterrows():
for b_index, build_row in build_df.iterrows():
if search_row["index_name"] == build_row["index_name"]:
Expand Down
167 changes: 162 additions & 5 deletions python/cuvs_bench/cuvs_bench/tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#
# SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
# SPDX-License-Identifier: Apache-2.0
#

import platform
from pathlib import Path

import pandas as pd
Expand All @@ -11,6 +12,11 @@
from cuvs_bench.get_dataset.__main__ import main


def is_arm_cpu():
"""Check if running on ARM Linux architecture."""
return platform.machine() in ("aarch64", "arm64")
Comment on lines +15 to +17

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Broaden ARM architecture detection to avoid false negatives.

The helper currently misses common ARM variants like armv7l, which can incorrectly run DiskANN/Vamana tests on unsupported ARM runners.

Proposed fix
 def is_arm_cpu():
     """Check if running on ARM Linux architecture."""
-    return platform.machine() in ("aarch64", "arm64")
+    machine = platform.machine().lower()
+    return machine in ("aarch64", "arm64") or machine.startswith("arm")
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@python/cuvs_bench/cuvs_bench/tests/test_cli.py` around lines 15 - 17, The
is_arm_cpu() helper currently only checks for ("aarch64", "arm64") and misses
common ARM variants like "armv7l", causing false negatives; update is_arm_cpu()
to detect ARM more broadly by checking platform.machine() (in the is_arm_cpu
function) for known values and patterns — e.g., include "armv7l", "armv6l", and
treat any value that starts with "arm" (case-insensitive) or contains "aarch" as
ARM — so replace the current membership test in is_arm_cpu() with a broader
pattern check to reliably detect ARM architectures.



@pytest.fixture(scope="session")
def temp_datasets_dir(tmp_path_factory):
return tmp_path_factory.mktemp("datasets")
Expand Down Expand Up @@ -51,7 +57,8 @@ def test_run_command_creates_results(temp_datasets_dir: Path):

python -m cuvs_bench.run --dataset test-data --dataset-path datasets/ \
--algorithms faiss_gpu_ivf_flat,faiss_gpu_ivf_sq,cuvs_ivf_flat,\
cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq \
cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq,cuvs_vamana,\
diskann_memory \
--batch-size 100 -k 10 --groups test -m latency --force

It then verifies that the set of expected result files
Expand All @@ -63,14 +70,19 @@ def test_run_command_creates_results(temp_datasets_dir: Path):

from cuvs_bench.run.__main__ import main as run_main

skip_diskann = is_arm_cpu()
algorithms = "faiss_gpu_ivf_flat,faiss_gpu_ivf_sq,cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq"
if not skip_diskann:
algorithms += ",cuvs_vamana,diskann_memory"

runner = CliRunner()
run_args = [
"--dataset",
"test-data",
"--dataset-path",
dataset_path_arg,
"--algorithms",
"faiss_gpu_ivf_flat,faiss_gpu_ivf_sq,cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq", # noqa: E501
algorithms,
"--batch-size",
"100",
"-k",
Expand Down Expand Up @@ -105,6 +117,8 @@ def test_run_command_creates_results(temp_datasets_dir: Path):
]

# --- Verify that the expected result files exist and are not empty ---
skip_diskann = is_arm_cpu()

expected_files = {
# Build files:
"test-data/result/build/cuvs_ivf_flat,test.csv": {
Expand Down Expand Up @@ -423,6 +437,143 @@ def test_run_command_creates_results(temp_datasets_dir: Path):
},
}

if not skip_diskann:
expected_files.update(
{
"test-data/result/build/cuvs_vamana,test.csv": {
"header": common_build_header
+ [
"GPU",
"alpha",
"graph_degree",
"visited_size",
],
"rows": 1,
},
"test-data/result/search/cuvs_vamana,test,k10,bs100,raw.csv": {
"header": common_search_header
+ [
"GPU",
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"build GPU",
"alpha",
"graph_degree",
"visited_size",
],
"rows": 1,
},
"test-data/result/search/cuvs_vamana,test,k10,bs100,latency.csv": {
"header": common_search_header
+ [
"GPU",
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"build GPU",
"alpha",
"graph_degree",
"visited_size",
],
"rows": 1,
},
"test-data/result/search/cuvs_vamana,test,k10,bs100,throughput.csv": {
"header": common_search_header
+ [
"GPU",
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"build GPU",
"alpha",
"graph_degree",
"visited_size",
],
"rows": 1,
},
"test-data/result/build/diskann_memory,test.csv": {
"header": common_build_header
+ [
"L_build",
"R",
"alpha",
"num_threads",
],
"rows": 1,
},
"test-data/result/search/diskann_memory,test,k10,bs100,raw.csv": {
"header": common_search_header
+ [
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"L_build",
"R",
"alpha",
"build_num_threads",
],
"rows": 1,
},
"test-data/result/search/diskann_memory,test,k10,bs100,latency.csv": {
"header": common_search_header
+ [
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"L_build",
"R",
"alpha",
"build_num_threads",
],
"rows": 1,
},
"test-data/result/search/diskann_memory,test,k10,bs100,throughput.csv": {
"header": common_search_header
+ [
"L_search",
"end_to_end",
"k",
"n_queries",
"total_queries",
"build time",
"build threads",
"build cpu_time",
"L_build",
"R",
"alpha",
"build_num_threads",
],
"rows": 1,
},
}
)

for rel_path, expectations in expected_files.items():
file_path = temp_datasets_dir / rel_path
assert file_path.exists(), f"Expected file {file_path} does not exist."
Expand All @@ -448,7 +599,8 @@ def test_plot_command_creates_png_files(temp_datasets_dir: Path):

python -m cuvs_bench.plot --dataset test-data --dataset-path datasets/ \
--algorithms faiss_gpu_ivf_flat,faiss_gpu_ivf_sq, \
cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq \
cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq,\
cuvs_vamana,diskann_memory \
--batch-size 100 -k 10 --groups test -m latency

and then verifies that the following files are produced in the
Expand All @@ -463,6 +615,11 @@ def test_plot_command_creates_png_files(temp_datasets_dir: Path):

from cuvs_bench.plot.__main__ import main as plot_main

skip_diskann = is_arm_cpu()
algorithms = "faiss_gpu_ivf_flat,faiss_gpu_ivf_sq,cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq"
if not skip_diskann:
algorithms += ",cuvs_vamana,diskann_memory"

runner = CliRunner()
args = [
"--dataset",
Expand All @@ -472,7 +629,7 @@ def test_plot_command_creates_png_files(temp_datasets_dir: Path):
"--output-filepath",
dataset_path_arg,
"--algorithms",
"faiss_gpu_ivf_flat,faiss_gpu_ivf_sq,cuvs_ivf_flat,cuvs_cagra,ggnn,cuvs_cagra_hnswlib,cuvs_ivf_pq", # noqa: E501
algorithms,
"--batch-size",
"100",
"-k",
Expand Down
Loading