From 96d4767d85770ac0719d97d9e2e9a3ebce054077 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Simhadri Date: Sat, 2 May 2026 13:10:47 -0700 Subject: [PATCH 1/3] Rename async to graph-index in diskann-benchmark Replace misleading 'async' prefix with 'graph-index' across all benchmark registration names, display strings, JSON config files, and documentation. - Rename src/inputs/async_.rs to graph_index.rs and update module references - Rename 7 input tags (e.g. async-index-build -> graph-index-build) - Rename ~25 backend registration names across benchmarks.rs, product.rs, scalar.rs, spherical.rs - Fix bug: scalar.rs stub used 'async-pq' (copy-paste from product.rs), corrected to 'graph-index-sq' - Rename 10 JSON example/perf_test files and update their type fields - Update 3 test function names and file references in main.rs - Update README.md benchmark documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- diskann-benchmark/README.md | 24 ++++----- ...-dynamic.json => graph-index-dynamic.json} | 2 +- ...raph-index-filter-ground-truth-small.json} | 2 +- ...n => graph-index-filter-ground-truth.json} | 2 +- ...nc-filter.json => graph-index-filter.json} | 2 +- ...x-multihop-filter-ground-truth-small.json} | 2 +- ...> graph-index-no-filter-ground-truth.json} | 2 +- ...sync-range.json => graph-index-range.json} | 2 +- .../example/{async.json => graph-index.json} | 12 ++--- diskann-benchmark/example/product.json | 2 +- diskann-benchmark/example/scalar.json | 8 +-- .../example/spherical-filter.json | 10 ++-- diskann-benchmark/example/spherical.json | 10 ++-- ...json => graph_index_scalar_oai_large.json} | 6 +-- .../src/backend/index/benchmarks.rs | 20 +++---- diskann-benchmark/src/backend/index/build.rs | 2 +- .../src/backend/index/product.rs | 10 ++-- diskann-benchmark/src/backend/index/scalar.rs | 24 ++++----- .../src/backend/index/search/knn.rs | 2 +- .../src/backend/index/search/range.rs | 2 +- .../src/backend/index/spherical.rs | 6 +-- .../backend/index/streaming/full_precision.rs | 2 +- .../src/inputs/{async_.rs => graph_index.rs} | 54 +++++++++---------- diskann-benchmark/src/inputs/mod.rs | 4 +- diskann-benchmark/src/main.rs | 20 +++---- 25 files changed, 116 insertions(+), 116 deletions(-) rename diskann-benchmark/example/{async-dynamic.json => graph-index-dynamic.json} (97%) rename diskann-benchmark/example/{async-filter-ground-truth-small.json => graph-index-filter-ground-truth-small.json} (97%) rename diskann-benchmark/example/{async-filter-ground-truth.json => graph-index-filter-ground-truth.json} (97%) rename diskann-benchmark/example/{async-filter.json => graph-index-filter.json} (97%) rename diskann-benchmark/example/{async-multihop-filter-ground-truth-small.json => graph-index-multihop-filter-ground-truth-small.json} (97%) rename diskann-benchmark/example/{async-no-filter-ground-truth.json => graph-index-no-filter-ground-truth.json} (96%) rename diskann-benchmark/example/{async-range.json => graph-index-range.json} (96%) rename diskann-benchmark/example/{async.json => graph-index.json} (96%) rename diskann-benchmark/perf_test_inputs/{async_scalar_oai_large.json => graph_index_scalar_oai_large.json} (96%) rename diskann-benchmark/src/inputs/{async_.rs => graph_index.rs} (97%) diff --git a/diskann-benchmark/README.md b/diskann-benchmark/README.md index 6e072b7577..ccb7353226 100644 --- a/diskann-benchmark/README.md +++ b/diskann-benchmark/README.md @@ -93,17 +93,17 @@ cargo run --release --package diskann-benchmark -- inputs which will list something like ``` Available input kinds are listed below: - async-index-build - async-index-build-pq + graph-index-build + graph-index-build-pq ``` To obtain the JSON schema for an input, add its name to the query like ```sh -cargo run --release --package diskann-benchmark -- inputs async-index-build +cargo run --release --package diskann-benchmark -- inputs graph-index-build ``` which will generate something like ```json { - "type": "async_index_build", + "type": "graph-index-build", "content": { "data_type": "float32", "data": "path/to/data", @@ -186,9 +186,9 @@ cargo run --release --package diskann-benchmark -- benchmarks Example output is shown below: ``` Registered Benchmarks: - async-full-precision-f32: tag: "async-index-build", float32 - async-full-precision-f16: tag: "async-index-build", float16 - async-pq-f32: tag: "async-index-build-pq", float32 + graph-index-full-precision-f32: tag: "graph-index-build", float32 + graph-index-full-precision-f16: tag: "graph-index-build", float16 + graph-index-pq-f32: tag: "graph-index-build-pq", float32 ``` The keyword after "tag" corresponds to the type of input that the benchmark accepts. @@ -196,7 +196,7 @@ The keyword after "tag" corresponds to the type of input that the benchmark acce Benchmarks are run with ```sh -cargo run --release --package diskann-benchmark -- run --input-file ./diskann-benchmark/example/async.json --output-file output.json +cargo run --release --package diskann-benchmark -- run --input-file ./diskann-benchmark/example/graph-index.json --output-file output.json ``` A benchmark run happens in several phases. @@ -237,10 +237,10 @@ First, set up the runbook and ground truth for the desired workload. Refer to th Benchmarks are run with ```sh -cargo run --release --package diskann-benchmark -- run --input-file ./diskann-benchmark/example/async-dynamic.json --output-file dynamic-output.json +cargo run --release --package diskann-benchmark -- run --input-file ./diskann-benchmark/example/graph-index-dynamic.json --output-file dynamic-output.json ``` -Note in the example json that the benchmark is registered under `async-dynamic-index-run`, -instead of `async-index-build` etc.. +Note in the example json that the benchmark is registered under `graph-index-dynamic-run`, +instead of `graph-index-build` etc.. A streaming run happens in several phases. First, the input file is parsed and data is checked for its validity. The check consists of @@ -284,7 +284,7 @@ input, a `DispatchRule` from the `dispatcher` crate (via registered `diskann_benchmark_runner::Inputs`. The rule can be as simple as checking a down cast or as complicated such as lifting run-time -information to the type/compile time realm, as is done for the async index tests for the data +information to the type/compile time realm, as is done for the graph index tests for the data type. Once this is complete, the benchmark will be reachable by its input and can live peacefully diff --git a/diskann-benchmark/example/async-dynamic.json b/diskann-benchmark/example/graph-index-dynamic.json similarity index 97% rename from diskann-benchmark/example/async-dynamic.json rename to diskann-benchmark/example/graph-index-dynamic.json index bedf862c93..2d785f4ba1 100644 --- a/diskann-benchmark/example/async-dynamic.json +++ b/diskann-benchmark/example/graph-index-dynamic.json @@ -5,7 +5,7 @@ ], "jobs": [ { - "type": "async-dynamic-index-run", + "type": "graph-index-dynamic-run", "content": { "build": { "data_type": "float32", diff --git a/diskann-benchmark/example/async-filter-ground-truth-small.json b/diskann-benchmark/example/graph-index-filter-ground-truth-small.json similarity index 97% rename from diskann-benchmark/example/async-filter-ground-truth-small.json rename to diskann-benchmark/example/graph-index-filter-ground-truth-small.json index c5ba23ee5b..19a3b58293 100644 --- a/diskann-benchmark/example/async-filter-ground-truth-small.json +++ b/diskann-benchmark/example/graph-index-filter-ground-truth-small.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/async-filter-ground-truth.json b/diskann-benchmark/example/graph-index-filter-ground-truth.json similarity index 97% rename from diskann-benchmark/example/async-filter-ground-truth.json rename to diskann-benchmark/example/graph-index-filter-ground-truth.json index c8cd25d4e0..46e80aaf6d 100644 --- a/diskann-benchmark/example/async-filter-ground-truth.json +++ b/diskann-benchmark/example/graph-index-filter-ground-truth.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/async-filter.json b/diskann-benchmark/example/graph-index-filter.json similarity index 97% rename from diskann-benchmark/example/async-filter.json rename to diskann-benchmark/example/graph-index-filter.json index f0e9bf5c65..b13ab58b7a 100644 --- a/diskann-benchmark/example/async-filter.json +++ b/diskann-benchmark/example/graph-index-filter.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/async-multihop-filter-ground-truth-small.json b/diskann-benchmark/example/graph-index-multihop-filter-ground-truth-small.json similarity index 97% rename from diskann-benchmark/example/async-multihop-filter-ground-truth-small.json rename to diskann-benchmark/example/graph-index-multihop-filter-ground-truth-small.json index eed4fce0b8..03c6888b82 100644 --- a/diskann-benchmark/example/async-multihop-filter-ground-truth-small.json +++ b/diskann-benchmark/example/graph-index-multihop-filter-ground-truth-small.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/async-no-filter-ground-truth.json b/diskann-benchmark/example/graph-index-no-filter-ground-truth.json similarity index 96% rename from diskann-benchmark/example/async-no-filter-ground-truth.json rename to diskann-benchmark/example/graph-index-no-filter-ground-truth.json index 82683c83c8..48a5b84e29 100644 --- a/diskann-benchmark/example/async-no-filter-ground-truth.json +++ b/diskann-benchmark/example/graph-index-no-filter-ground-truth.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "data_type": "uint8", "data": "base.100k.u8bin", diff --git a/diskann-benchmark/example/async-range.json b/diskann-benchmark/example/graph-index-range.json similarity index 96% rename from diskann-benchmark/example/async-range.json rename to diskann-benchmark/example/graph-index-range.json index cda204bb8a..a5c763be00 100644 --- a/diskann-benchmark/example/async-range.json +++ b/diskann-benchmark/example/graph-index-range.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/async.json b/diskann-benchmark/example/graph-index.json similarity index 96% rename from diskann-benchmark/example/async.json rename to diskann-benchmark/example/graph-index.json index c0fa4c2618..a19ffaf108 100644 --- a/diskann-benchmark/example/async.json +++ b/diskann-benchmark/example/graph-index.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", @@ -43,7 +43,7 @@ } }, { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Load", @@ -74,7 +74,7 @@ } }, { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", @@ -118,7 +118,7 @@ } }, { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", @@ -160,7 +160,7 @@ } }, { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", @@ -204,7 +204,7 @@ } }, { - "type": "async-index-build", + "type": "graph-index-build", "content": { "source": { "index-source": "Build", diff --git a/diskann-benchmark/example/product.json b/diskann-benchmark/example/product.json index eb8e45239b..ad6430dd2b 100644 --- a/diskann-benchmark/example/product.json +++ b/diskann-benchmark/example/product.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build-pq", + "type": "graph-index-build-pq", "content": { "index_operation": { "source":{ diff --git a/diskann-benchmark/example/scalar.json b/diskann-benchmark/example/scalar.json index b8414155d6..2490376e28 100644 --- a/diskann-benchmark/example/scalar.json +++ b/diskann-benchmark/example/scalar.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "index_operation": { "source": { @@ -48,7 +48,7 @@ } }, { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "index_operation": { "source": { @@ -92,7 +92,7 @@ } }, { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "index_operation": { "source": { @@ -136,7 +136,7 @@ } }, { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "index_operation": { "source": { diff --git a/diskann-benchmark/example/spherical-filter.json b/diskann-benchmark/example/spherical-filter.json index 5e4cb9512a..8407bd39ab 100644 --- a/diskann-benchmark/example/spherical-filter.json +++ b/diskann-benchmark/example/spherical-filter.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -64,7 +64,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -124,7 +124,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -186,7 +186,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -246,7 +246,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", diff --git a/diskann-benchmark/example/spherical.json b/diskann-benchmark/example/spherical.json index e1487333ec..695b1d0414 100644 --- a/diskann-benchmark/example/spherical.json +++ b/diskann-benchmark/example/spherical.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -61,7 +61,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -118,7 +118,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -177,7 +177,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", @@ -234,7 +234,7 @@ } }, { - "type": "async-index-build-spherical-quantization", + "type": "graph-index-build-spherical-quantization", "content": { "build": { "data_type": "float32", diff --git a/diskann-benchmark/perf_test_inputs/async_scalar_oai_large.json b/diskann-benchmark/perf_test_inputs/graph_index_scalar_oai_large.json similarity index 96% rename from diskann-benchmark/perf_test_inputs/async_scalar_oai_large.json rename to diskann-benchmark/perf_test_inputs/graph_index_scalar_oai_large.json index efe0002c9c..09752477ae 100644 --- a/diskann-benchmark/perf_test_inputs/async_scalar_oai_large.json +++ b/diskann-benchmark/perf_test_inputs/graph_index_scalar_oai_large.json @@ -4,7 +4,7 @@ ], "jobs": [ { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "build": { "data_type": "float16", @@ -40,7 +40,7 @@ } }, { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "build": { "data_type": "float16", @@ -76,7 +76,7 @@ } }, { - "type": "async-index-build-sq", + "type": "graph-index-build-sq", "content": { "build": { "data_type": "float16", diff --git a/diskann-benchmark/src/backend/index/benchmarks.rs b/diskann-benchmark/src/backend/index/benchmarks.rs index ad7fd697aa..cceecf36a3 100644 --- a/diskann-benchmark/src/backend/index/benchmarks.rs +++ b/diskann-benchmark/src/backend/index/benchmarks.rs @@ -42,7 +42,7 @@ use crate::{ result::{AggregatedSearchResults, BuildResult}, streaming::{self, managed, stats::StreamStats, FullPrecisionStream, Managed}, }, - inputs::async_::{DynamicIndexRun, IndexBuild, IndexOperation, IndexSource, SearchPhase}, + inputs::graph_index::{DynamicIndexRun, IndexBuild, IndexOperation, IndexSource, SearchPhase}, utils::{ self, datafiles::{self}, @@ -56,26 +56,26 @@ use crate::{ pub(super) fn register_benchmarks(benchmarks: &mut diskann_benchmark_runner::registry::Benchmarks) { // Full Precision - benchmarks.register("async-full-precision-f32", FullPrecision::::new()); - benchmarks.register("async-full-precision-f16", FullPrecision::::new()); - benchmarks.register("async-full-precision-u8", FullPrecision::::new()); - benchmarks.register("async-full-precision-i8", FullPrecision::::new()); + benchmarks.register("graph-index-full-precision-f32", FullPrecision::::new()); + benchmarks.register("graph-index-full-precision-f16", FullPrecision::::new()); + benchmarks.register("graph-index-full-precision-u8", FullPrecision::::new()); + benchmarks.register("graph-index-full-precision-i8", FullPrecision::::new()); // Dynamic Full Precision benchmarks.register( - "async-dynamic-full-precision-f32", + "graph-index-dynamic-full-precision-f32", DynamicFullPrecision::::new(), ); benchmarks.register( - "async-dynamic-full-precision-f16", + "graph-index-dynamic-full-precision-f16", DynamicFullPrecision::::new(), ); benchmarks.register( - "async-dynamic-full-precision-u8", + "graph-index-dynamic-full-precision-u8", DynamicFullPrecision::::new(), ); benchmarks.register( - "async-dynamic-full-precision-i8", + "graph-index-dynamic-full-precision-i8", DynamicFullPrecision::::new(), ); @@ -192,7 +192,7 @@ where } } -// Async Dynamic Run +// Graph Index Dynamic Run pub(super) struct DynamicFullPrecision { _type: std::marker::PhantomData, } diff --git a/diskann-benchmark/src/backend/index/build.rs b/diskann-benchmark/src/backend/index/build.rs index 137628db71..c528abdcf0 100644 --- a/diskann-benchmark/src/backend/index/build.rs +++ b/diskann-benchmark/src/backend/index/build.rs @@ -28,7 +28,7 @@ use diskann_utils::{ use indicatif::{ProgressBar, ProgressStyle}; use serde::Serialize; -use crate::inputs::async_::IndexBuild; +use crate::inputs::graph_index::IndexBuild; /////////////////////////////// // Start Point Configuration // diff --git a/diskann-benchmark/src/backend/index/product.rs b/diskann-benchmark/src/backend/index/product.rs index a7514c041d..095e252bf8 100644 --- a/diskann-benchmark/src/backend/index/product.rs +++ b/diskann-benchmark/src/backend/index/product.rs @@ -6,20 +6,20 @@ use diskann_benchmark_runner::registry::Benchmarks; // Create a stub-module if the "spherical-quantization" feature is disabled. -crate::utils::stub_impl!("product-quantization", inputs::async_::IndexPQOperation); +crate::utils::stub_impl!("product-quantization", inputs::graph_index::IndexPQOperation); pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { #[cfg(feature = "product-quantization")] { use half::f16; - benchmarks.register("async-pq-f32", imp::ProductQuantized::::new()); - benchmarks.register("async-pq-f16", imp::ProductQuantized::::new()); + benchmarks.register("graph-index-pq-f32", imp::ProductQuantized::::new()); + benchmarks.register("graph-index-pq-f16", imp::ProductQuantized::::new()); } // Stub implementation #[cfg(not(feature = "product-quantization"))] - imp::register("async-pq", benchmarks); + imp::register("graph-index-pq", benchmarks); } #[cfg(feature = "product-quantization")] @@ -46,7 +46,7 @@ mod imp { build::{self, load_index, save_index, single_or_multi_insert, BuildStats}, result::QuantBuildResult, }, - inputs::async_::{IndexPQOperation, IndexSource}, + inputs::graph_index::{IndexPQOperation, IndexSource}, utils::{self, datafiles}, }; diff --git a/diskann-benchmark/src/backend/index/scalar.rs b/diskann-benchmark/src/backend/index/scalar.rs index 85c230605d..3adf9a7288 100644 --- a/diskann-benchmark/src/backend/index/scalar.rs +++ b/diskann-benchmark/src/backend/index/scalar.rs @@ -6,7 +6,7 @@ use diskann_benchmark_runner::registry::Benchmarks; // Create a stub-module if the "scalar-quantization" feature is disabled. -crate::utils::stub_impl!("scalar-quantization", inputs::async_::IndexSQOperation); +crate::utils::stub_impl!("scalar-quantization", inputs::graph_index::IndexSQOperation); pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { #[cfg(feature = "scalar-quantization")] @@ -14,22 +14,22 @@ pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { use half::f16; // f32 - benchmarks.register("async-sq-8-bit-f32", imp::ScalarQuantized::<8, f32>::new()); - benchmarks.register("async-sq-4-bit-f32", imp::ScalarQuantized::<4, f32>::new()); - benchmarks.register("async-sq-2-bit-f32", imp::ScalarQuantized::<2, f32>::new()); - benchmarks.register("async-sq-1-bit-f32", imp::ScalarQuantized::<1, f32>::new()); + benchmarks.register("graph-index-sq-8-bit-f32", imp::ScalarQuantized::<8, f32>::new()); + benchmarks.register("graph-index-sq-4-bit-f32", imp::ScalarQuantized::<4, f32>::new()); + benchmarks.register("graph-index-sq-2-bit-f32", imp::ScalarQuantized::<2, f32>::new()); + benchmarks.register("graph-index-sq-1-bit-f32", imp::ScalarQuantized::<1, f32>::new()); // f16 - benchmarks.register("async-sq-8-bit-f16", imp::ScalarQuantized::<8, f16>::new()); - benchmarks.register("async-sq-4-bit-f16", imp::ScalarQuantized::<4, f16>::new()); - benchmarks.register("async-sq-2-bit-f16", imp::ScalarQuantized::<2, f16>::new()); - benchmarks.register("async-sq-1-bit-f16", imp::ScalarQuantized::<1, f16>::new()); + benchmarks.register("graph-index-sq-8-bit-f16", imp::ScalarQuantized::<8, f16>::new()); + benchmarks.register("graph-index-sq-4-bit-f16", imp::ScalarQuantized::<4, f16>::new()); + benchmarks.register("graph-index-sq-2-bit-f16", imp::ScalarQuantized::<2, f16>::new()); + benchmarks.register("graph-index-sq-1-bit-f16", imp::ScalarQuantized::<1, f16>::new()); // i8 - benchmarks.register("async-sq-1-bit-i8", imp::ScalarQuantized::<1, i8>::new()); + benchmarks.register("graph-index-sq-1-bit-i8", imp::ScalarQuantized::<1, i8>::new()); } // Stub implementation #[cfg(not(feature = "scalar-quantization"))] - imp::register("async-pq", benchmarks); + imp::register("graph-index-sq", benchmarks); } #[cfg(feature = "scalar-quantization")] @@ -59,7 +59,7 @@ mod imp { build::{self, load_index, only_single_insert, save_index, BuildStats}, result::QuantBuildResult, }, - inputs::async_::{IndexSQOperation, IndexSource}, + inputs::graph_index::{IndexSQOperation, IndexSource}, utils::{self, datafiles}, }; diff --git a/diskann-benchmark/src/backend/index/search/knn.rs b/diskann-benchmark/src/backend/index/search/knn.rs index 915b8eca6a..b50e690102 100644 --- a/diskann-benchmark/src/backend/index/search/knn.rs +++ b/diskann-benchmark/src/backend/index/search/knn.rs @@ -7,7 +7,7 @@ use std::{num::NonZeroUsize, sync::Arc}; use diskann_benchmark_core::{self as benchmark_core, search as core_search}; -use crate::{backend::index::result::SearchResults, inputs::async_::GraphSearch}; +use crate::{backend::index::result::SearchResults, inputs::graph_index::GraphSearch}; #[derive(Debug, Clone, Copy)] pub(crate) struct SearchSteps<'a> { diff --git a/diskann-benchmark/src/backend/index/search/range.rs b/diskann-benchmark/src/backend/index/search/range.rs index 8acd97b521..7b6ebf7ef5 100644 --- a/diskann-benchmark/src/backend/index/search/range.rs +++ b/diskann-benchmark/src/backend/index/search/range.rs @@ -7,7 +7,7 @@ use std::{num::NonZeroUsize, sync::Arc}; use diskann_benchmark_core::{self as benchmark_core, search as core_search}; -use crate::{backend::index::result::RangeSearchResults, inputs::async_::GraphRangeSearch}; +use crate::{backend::index::result::RangeSearchResults, inputs::graph_index::GraphRangeSearch}; #[derive(Debug, Clone, Copy)] pub(crate) struct RangeSearchSteps<'a> { diff --git a/diskann-benchmark/src/backend/index/spherical.rs b/diskann-benchmark/src/backend/index/spherical.rs index 507337da7a..2c681507d5 100644 --- a/diskann-benchmark/src/backend/index/spherical.rs +++ b/diskann-benchmark/src/backend/index/spherical.rs @@ -8,11 +8,11 @@ use diskann_benchmark_runner::registry::Benchmarks; // Create a stub-module if the "spherical-quantization" feature is disabled. crate::utils::stub_impl!( "spherical-quantization", - inputs::async_::SphericalQuantBuild + inputs::graph_index::SphericalQuantBuild ); pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { - const NAME: &str = "async-spherical-quantization"; + const NAME: &str = "graph-index-spherical-quantization"; #[cfg(feature = "spherical-quantization")] { @@ -57,7 +57,7 @@ mod imp { search, }, inputs::{ - async_::{SearchPhase, SphericalQuantBuild}, + graph_index::{SearchPhase, SphericalQuantBuild}, exhaustive, }, utils::{ diff --git a/diskann-benchmark/src/backend/index/streaming/full_precision.rs b/diskann-benchmark/src/backend/index/streaming/full_precision.rs index 2ef68d06d0..3ce4de1ebc 100644 --- a/diskann-benchmark/src/backend/index/streaming/full_precision.rs +++ b/diskann-benchmark/src/backend/index/streaming/full_precision.rs @@ -31,7 +31,7 @@ use crate::{ build::{BuildKind, BuildStats}, search::knn, }, - inputs::async_::TopkSearchPhase, + inputs::graph_index::TopkSearchPhase, }; type FullPrecisionIndex = Arc< diff --git a/diskann-benchmark/src/inputs/async_.rs b/diskann-benchmark/src/inputs/graph_index.rs similarity index 97% rename from diskann-benchmark/src/inputs/async_.rs rename to diskann-benchmark/src/inputs/graph_index.rs index c76fdb5943..2e0b2c7484 100644 --- a/diskann-benchmark/src/inputs/async_.rs +++ b/diskann-benchmark/src/inputs/graph_index.rs @@ -316,7 +316,7 @@ impl Example for MultiInsert { } } -// This constant is used to ensure that summaries of async-index related jobs properly have +// This constant is used to ensure that summaries of graph-index related jobs properly have // their field descriptions aligned. const PRINT_WIDTH: usize = 18; @@ -359,7 +359,7 @@ pub(crate) struct IndexLoad { impl IndexLoad { pub(crate) const fn tag() -> &'static str { - "async-index-load" + "graph-index-load" } pub(crate) fn to_config(&self) -> Result { @@ -421,7 +421,7 @@ impl CheckDeserialization for IndexLoad { impl std::fmt::Display for IndexLoad { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async Full-Precision Index Load\n")?; + writeln!(f, "Graph Index Full-Precision Load\n")?; write_field!(f, "tag", Self::tag())?; @@ -482,7 +482,7 @@ pub(crate) struct IndexBuild { impl IndexBuild { pub(crate) const fn tag() -> &'static str { - "async-index-builder" + "graph-index-builder" } fn exact_max_degree(&self) -> usize { @@ -614,7 +614,7 @@ impl Example for IndexBuild { impl std::fmt::Display for IndexBuild { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async Full-Precision Index Build\n")?; + writeln!(f, "Graph Index Full-Precision Build\n")?; write_field!(f, "tag", Self::tag())?; @@ -655,7 +655,7 @@ pub(crate) struct IndexOperation { impl IndexOperation { pub(crate) const fn tag() -> &'static str { - "async-index-build" + "graph-index-build" } } @@ -680,7 +680,7 @@ impl Example for IndexOperation { impl std::fmt::Display for IndexOperation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async Full-Precision Index Build\n")?; + writeln!(f, "Graph Index Full-Precision Build\n")?; write_field!(f, "tag", Self::tag())?; @@ -688,9 +688,9 @@ impl std::fmt::Display for IndexOperation { } } -//////////////////// -// Async Build PQ // -//////////////////// +////////////////////////////// +// Graph Index Build PQ // +////////////////////////////// #[derive(Debug, Serialize, Deserialize)] pub(crate) struct IndexPQOperation { @@ -703,7 +703,7 @@ pub(crate) struct IndexPQOperation { impl IndexPQOperation { pub(crate) const fn tag() -> &'static str { - "async-index-build-pq" + "graph-index-build-pq" } #[cfg(feature = "product-quantization")] @@ -761,7 +761,7 @@ impl Example for IndexPQOperation { impl std::fmt::Display for IndexPQOperation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async PQ Index Build")?; + writeln!(f, "Graph Index PQ Build")?; write_field!(f, "tag", Self::tag())?; write_field!(f, "PQ Chunks", self.num_pq_chunks)?; const MAX_FP_VECS: &str = "Max FP Vecs"; @@ -778,9 +778,9 @@ impl std::fmt::Display for IndexPQOperation { } } -//////////////////// -// Async Build SQ // -//////////////////// +////////////////////////////// +// Graph Index Build SQ // +////////////////////////////// #[derive(Debug, Serialize, Deserialize)] pub(crate) struct IndexSQOperation { @@ -792,7 +792,7 @@ pub(crate) struct IndexSQOperation { impl IndexSQOperation { pub(crate) const fn tag() -> &'static str { - "async-index-build-sq" + "graph-index-build-sq" } #[cfg(feature = "scalar-quantization")] @@ -854,7 +854,7 @@ impl Example for IndexSQOperation { impl std::fmt::Display for IndexSQOperation { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async SQ Index Build")?; + writeln!(f, "Graph Index SQ Build")?; write_field!(f, "tag", Self::tag())?; write_field!(f, "SQ bits", self.num_bits)?; write_field!(f, "StdDev", self.standard_deviations)?; @@ -868,9 +868,9 @@ impl std::fmt::Display for IndexSQOperation { } } -/////////////////////////// -// Async Build Spherical // -/////////////////////////// +///////////////////////////////////// +// Graph Index Build Spherical // +///////////////////////////////////// #[derive(Debug, Serialize, Deserialize)] pub(crate) struct SphericalQuantBuild { @@ -885,7 +885,7 @@ pub(crate) struct SphericalQuantBuild { impl SphericalQuantBuild { pub(crate) const fn tag() -> &'static str { - "async-index-build-spherical-quantization" + "graph-index-build-spherical-quantization" } #[cfg(feature = "spherical-quantization")] @@ -962,7 +962,7 @@ impl Example for SphericalQuantBuild { impl std::fmt::Display for SphericalQuantBuild { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async Spherically Quantized Index Build")?; + writeln!(f, "Graph Index Spherical Quantization Build")?; if cfg!(not(feature = "spherical-quantization")) { writeln!(f, "Requires the `spherical-quantization` feature")?; } @@ -1147,9 +1147,9 @@ impl std::fmt::Display for DynamicRunbookParams { } } -/////////////////// -// Async Dynamic // -/////////////////// +/////////////////////////// +// Graph Index Dynamic // +/////////////////////////// #[derive(Debug, Serialize, Deserialize)] pub(crate) struct DynamicIndexRun { @@ -1160,7 +1160,7 @@ pub(crate) struct DynamicIndexRun { impl DynamicIndexRun { pub(crate) const fn tag() -> &'static str { - "async-dynamic-index-run" + "graph-index-dynamic-run" } pub(crate) fn try_as_config(&self, insert_l: usize) -> anyhow::Result { @@ -1201,7 +1201,7 @@ impl Example for DynamicIndexRun { impl std::fmt::Display for DynamicIndexRun { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "Async Dynamic Index Run")?; + writeln!(f, "Graph Index Dynamic Run")?; write_field!(f, "tag", Self::tag())?; writeln!(f, "Runbook Parameters:")?; write!(f, "{}", self.runbook_params)?; diff --git a/diskann-benchmark/src/inputs/mod.rs b/diskann-benchmark/src/inputs/mod.rs index f5f6c015a8..8e058db036 100644 --- a/diskann-benchmark/src/inputs/mod.rs +++ b/diskann-benchmark/src/inputs/mod.rs @@ -3,7 +3,7 @@ * Licensed under the MIT license. */ -pub(crate) mod async_; +pub(crate) mod graph_index; pub(crate) mod disk; pub(crate) mod exhaustive; pub(crate) mod filters; @@ -12,7 +12,7 @@ pub(crate) mod save_and_load; pub(crate) fn register_inputs( registry: &mut diskann_benchmark_runner::registry::Inputs, ) -> anyhow::Result<()> { - async_::register_inputs(registry)?; + graph_index::register_inputs(registry)?; exhaustive::register_inputs(registry)?; disk::register_inputs(registry)?; filters::register_inputs(registry)?; diff --git a/diskann-benchmark/src/main.rs b/diskann-benchmark/src/main.rs index 723a8b14f1..657fdd67c2 100644 --- a/diskann-benchmark/src/main.rs +++ b/diskann-benchmark/src/main.rs @@ -258,17 +258,17 @@ mod tests { } } - // Async Build Integration Test. + // Graph Index Build Integration Test. #[test] - fn async_integration() { + fn graph_index_integration() { // First, parse and modify the input file to establish paths relative to the // directory building the dispatcher. - let mut raw = value_from_file(&example_directory().join("async.json")); + let mut raw = value_from_file(&example_directory().join("graph-index.json")); prefix_search_directories(&mut raw, &root_directory()); let tempdir = tempfile::tempdir().unwrap(); - let input_path = tempdir.path().join("async.json"); + let input_path = tempdir.path().join("graph-index.json"); save_to_file(&input_path, &raw); let output_path = tempdir.path().join("output.json"); @@ -558,15 +558,15 @@ mod tests { } #[test] - fn async_filter_integration() { + fn graph_index_filter_integration() { // First, parse and modify the input file to establish paths relative to the // directory building the dispatcher. - let mut raw = value_from_file(&example_directory().join("async-filter.json")); + let mut raw = value_from_file(&example_directory().join("graph-index-filter.json")); prefix_search_directories(&mut raw, &root_directory()); let tempdir = tempfile::tempdir().unwrap(); - let input_path = tempdir.path().join("async-filter.json"); + let input_path = tempdir.path().join("graph-index-filter.json"); save_to_file(&input_path, &raw); let output_path = tempdir.path().join("output.json"); @@ -596,7 +596,7 @@ mod tests { } #[test] - fn async_filter_integration_with_gt_compute() { + fn graph_index_filter_integration_with_gt_compute() { let storage_provider = FileStorageProvider; let disk_index_search_path = root_directory().join("test_data/disk_index_search"); @@ -645,12 +645,12 @@ mod tests { }; let mut raw = - value_from_file(&example_directory().join("async-filter-ground-truth-small.json")); + value_from_file(&example_directory().join("graph-index-filter-ground-truth-small.json")); prefix_search_directories(&mut raw, &root_directory()); let tempdir = tempfile::tempdir().unwrap(); - let input_path = tempdir.path().join("async-filter-ground-truth-small.json"); + let input_path = tempdir.path().join("graph-index-filter-ground-truth-small.json"); save_to_file(&input_path, &raw); let output_path = tempdir.path().join("output.json"); From 62d4dcd189e6ad139435ba0e057f43135af8b30d Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Simhadri Date: Sat, 2 May 2026 16:48:28 -0700 Subject: [PATCH 2/3] cargo fmt --- .../src/backend/index/benchmarks.rs | 10 ++++- .../src/backend/index/product.rs | 5 ++- diskann-benchmark/src/backend/index/scalar.rs | 45 +++++++++++++++---- .../src/backend/index/spherical.rs | 2 +- diskann-benchmark/src/inputs/mod.rs | 2 +- diskann-benchmark/src/main.rs | 9 ++-- 6 files changed, 56 insertions(+), 17 deletions(-) diff --git a/diskann-benchmark/src/backend/index/benchmarks.rs b/diskann-benchmark/src/backend/index/benchmarks.rs index cceecf36a3..e6d6274e65 100644 --- a/diskann-benchmark/src/backend/index/benchmarks.rs +++ b/diskann-benchmark/src/backend/index/benchmarks.rs @@ -56,8 +56,14 @@ use crate::{ pub(super) fn register_benchmarks(benchmarks: &mut diskann_benchmark_runner::registry::Benchmarks) { // Full Precision - benchmarks.register("graph-index-full-precision-f32", FullPrecision::::new()); - benchmarks.register("graph-index-full-precision-f16", FullPrecision::::new()); + benchmarks.register( + "graph-index-full-precision-f32", + FullPrecision::::new(), + ); + benchmarks.register( + "graph-index-full-precision-f16", + FullPrecision::::new(), + ); benchmarks.register("graph-index-full-precision-u8", FullPrecision::::new()); benchmarks.register("graph-index-full-precision-i8", FullPrecision::::new()); diff --git a/diskann-benchmark/src/backend/index/product.rs b/diskann-benchmark/src/backend/index/product.rs index 095e252bf8..4a9ca1f5fc 100644 --- a/diskann-benchmark/src/backend/index/product.rs +++ b/diskann-benchmark/src/backend/index/product.rs @@ -6,7 +6,10 @@ use diskann_benchmark_runner::registry::Benchmarks; // Create a stub-module if the "spherical-quantization" feature is disabled. -crate::utils::stub_impl!("product-quantization", inputs::graph_index::IndexPQOperation); +crate::utils::stub_impl!( + "product-quantization", + inputs::graph_index::IndexPQOperation +); pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { #[cfg(feature = "product-quantization")] diff --git a/diskann-benchmark/src/backend/index/scalar.rs b/diskann-benchmark/src/backend/index/scalar.rs index 3adf9a7288..7f11ec3ad0 100644 --- a/diskann-benchmark/src/backend/index/scalar.rs +++ b/diskann-benchmark/src/backend/index/scalar.rs @@ -14,17 +14,44 @@ pub(super) fn register_benchmarks(benchmarks: &mut Benchmarks) { use half::f16; // f32 - benchmarks.register("graph-index-sq-8-bit-f32", imp::ScalarQuantized::<8, f32>::new()); - benchmarks.register("graph-index-sq-4-bit-f32", imp::ScalarQuantized::<4, f32>::new()); - benchmarks.register("graph-index-sq-2-bit-f32", imp::ScalarQuantized::<2, f32>::new()); - benchmarks.register("graph-index-sq-1-bit-f32", imp::ScalarQuantized::<1, f32>::new()); + benchmarks.register( + "graph-index-sq-8-bit-f32", + imp::ScalarQuantized::<8, f32>::new(), + ); + benchmarks.register( + "graph-index-sq-4-bit-f32", + imp::ScalarQuantized::<4, f32>::new(), + ); + benchmarks.register( + "graph-index-sq-2-bit-f32", + imp::ScalarQuantized::<2, f32>::new(), + ); + benchmarks.register( + "graph-index-sq-1-bit-f32", + imp::ScalarQuantized::<1, f32>::new(), + ); // f16 - benchmarks.register("graph-index-sq-8-bit-f16", imp::ScalarQuantized::<8, f16>::new()); - benchmarks.register("graph-index-sq-4-bit-f16", imp::ScalarQuantized::<4, f16>::new()); - benchmarks.register("graph-index-sq-2-bit-f16", imp::ScalarQuantized::<2, f16>::new()); - benchmarks.register("graph-index-sq-1-bit-f16", imp::ScalarQuantized::<1, f16>::new()); + benchmarks.register( + "graph-index-sq-8-bit-f16", + imp::ScalarQuantized::<8, f16>::new(), + ); + benchmarks.register( + "graph-index-sq-4-bit-f16", + imp::ScalarQuantized::<4, f16>::new(), + ); + benchmarks.register( + "graph-index-sq-2-bit-f16", + imp::ScalarQuantized::<2, f16>::new(), + ); + benchmarks.register( + "graph-index-sq-1-bit-f16", + imp::ScalarQuantized::<1, f16>::new(), + ); // i8 - benchmarks.register("graph-index-sq-1-bit-i8", imp::ScalarQuantized::<1, i8>::new()); + benchmarks.register( + "graph-index-sq-1-bit-i8", + imp::ScalarQuantized::<1, i8>::new(), + ); } // Stub implementation diff --git a/diskann-benchmark/src/backend/index/spherical.rs b/diskann-benchmark/src/backend/index/spherical.rs index 2c681507d5..6049a676cc 100644 --- a/diskann-benchmark/src/backend/index/spherical.rs +++ b/diskann-benchmark/src/backend/index/spherical.rs @@ -57,8 +57,8 @@ mod imp { search, }, inputs::{ - graph_index::{SearchPhase, SphericalQuantBuild}, exhaustive, + graph_index::{SearchPhase, SphericalQuantBuild}, }, utils::{ self, datafiles, diff --git a/diskann-benchmark/src/inputs/mod.rs b/diskann-benchmark/src/inputs/mod.rs index 8e058db036..856412e2a0 100644 --- a/diskann-benchmark/src/inputs/mod.rs +++ b/diskann-benchmark/src/inputs/mod.rs @@ -3,10 +3,10 @@ * Licensed under the MIT license. */ -pub(crate) mod graph_index; pub(crate) mod disk; pub(crate) mod exhaustive; pub(crate) mod filters; +pub(crate) mod graph_index; pub(crate) mod save_and_load; pub(crate) fn register_inputs( diff --git a/diskann-benchmark/src/main.rs b/diskann-benchmark/src/main.rs index 657fdd67c2..424e63bb74 100644 --- a/diskann-benchmark/src/main.rs +++ b/diskann-benchmark/src/main.rs @@ -644,13 +644,16 @@ mod tests { } }; - let mut raw = - value_from_file(&example_directory().join("graph-index-filter-ground-truth-small.json")); + let mut raw = value_from_file( + &example_directory().join("graph-index-filter-ground-truth-small.json"), + ); prefix_search_directories(&mut raw, &root_directory()); let tempdir = tempfile::tempdir().unwrap(); - let input_path = tempdir.path().join("graph-index-filter-ground-truth-small.json"); + let input_path = tempdir + .path() + .join("graph-index-filter-ground-truth-small.json"); save_to_file(&input_path, &raw); let output_path = tempdir.path().join("output.json"); From c0fa512daffcd26208f37fd90a7cae05ef37de79 Mon Sep 17 00:00:00 2001 From: Harsha Vardhan Simhadri Date: Mon, 4 May 2026 10:59:55 -0700 Subject: [PATCH 3/3] updating sample output in diskann-benchmarks/readme.md --- diskann-benchmark/README.md | 55 +++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/diskann-benchmark/README.md b/diskann-benchmark/README.md index ccb7353226..63353a432c 100644 --- a/diskann-benchmark/README.md +++ b/diskann-benchmark/README.md @@ -105,53 +105,48 @@ which will generate something like { "type": "graph-index-build", "content": { - "data_type": "float32", - "data": "path/to/data", - "distance": "squared_l2", - "max_degree": 32, - "l_build": 50, - "alpha": 1.2, - "backedge_ratio": 1.0, - "num_threads": 1, - "num_start_points": 10, - "num_insert_attempts": 2, - "saturate_inserts": true, - "multi_insert": { - "batch_size": 128, - "batch_parallelism": 32 - }, "search_phase": { - "search-type": "topk", - "queries": "path/to/queries", "groundtruth": "path/to/groundtruth", - "reps": 5, "num_threads": [ 1, 2, 4, 8 ], + "queries": "path/to/queries", + "reps": 5, "runs": [ { - "enhanced_metrics": false, - "search_k": 10, + "recall_k": 10, "search_l": [ 10, 20, 30, 40 ], - "target_recall": [ - { - "target": [50, 90, 95, 98, 99], - "percentile": [0.5, 0.75, 0.9, 0.95], - "max_search_l": 1000, - "calibration_size": 1000, - }, - ], - "recall_n": 10 + "search_n": 10 } - ] + ], + "search-type": "topk" + }, + "source": { + "alpha": 1.2000000476837158, + "backedge_ratio": 1.0, + "data": "path/to/data", + "data_type": "float32", + "distance": "squared_l2", + "index-source": "Build", + "insert_retry": null, + "l_build": 50, + "max_degree": 32, + "multi_insert": { + "batch_parallelism": 32, + "batch_size": 128, + "intra_batch_candidates": "none" + }, + "num_threads": 1, + "save_path": null, + "start_point_strategy": "medoid" } } }