Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
97b36ef
finish up recall computation patch
May 14, 2026
07b3671
Merge branch 'main' of github.com:microsoft/DiskANN
May 15, 2026
eac3ffb
Merge branch 'main' of github.com:microsoft/DiskANN
May 19, 2026
17780f8
fix conflict
May 22, 2026
43eb517
fix conflict
May 22, 2026
1d3a52b
Merge branch 'main' of github.com:microsoft/DiskANN
May 25, 2026
17eac62
Merge branch 'main' of github.com:microsoft/DiskANN
May 26, 2026
0ab4baa
Merge branch 'main' of github.com:microsoft/DiskANN
May 27, 2026
4ddca60
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 2, 2026
54ee01b
fix conflict
Jun 2, 2026
9e1743f
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 5, 2026
93504e6
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 8, 2026
b7c27ce
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 11, 2026
1dafc55
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 12, 2026
33285e2
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 15, 2026
824bdb3
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 16, 2026
826600f
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 26, 2026
1bea9c5
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 30, 2026
fc8acf6
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 30, 2026
6be31f4
Merge branch 'main' of github.com:microsoft/DiskANN
Jun 30, 2026
eff4042
Merge branch 'main' of github.com:microsoft/DiskANN
Jul 6, 2026
08be945
Merge branch 'main' of github.com:microsoft/DiskANN
Jul 7, 2026
8c5f07e
add GroundTruthMode as a SearchSteps argument
Jul 7, 2026
cf7adaa
make GroundTruthMode a required argument instead of optional
Jul 8, 2026
860ccae
make imports nicer
Jul 8, 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
31 changes: 26 additions & 5 deletions diskann-benchmark/src/index/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use diskann::{
};
use diskann_benchmark_core::{
self as benchmark_core,
recall::GroundTruthMode,
streaming::{executors::bigann, Executor},
};
use diskann_benchmark_runner::{
Expand Down Expand Up @@ -470,7 +471,12 @@ impl search::Plugin<FullPrecisionProvider<f32>, SearchPhase, Strategy<common::Fu
inmem::DeterminantDiversity::new(params),
)?;

let steps = search::knn::SearchSteps::new(phase.reps, &phase.num_threads, &phase.runs);
let steps = search::knn::SearchSteps::new(
phase.reps,
&phase.num_threads,
&phase.runs,
GroundTruthMode::Fixed,
);
let results = search::knn::run(&knn, &groundtruth, steps)?;

Ok(AggregatedSearchResults::Topk(results))
Expand Down Expand Up @@ -519,7 +525,12 @@ where
benchmark_core::search::graph::Strategy::broadcast(strategy.inner()),
)?;

let steps = search::knn::SearchSteps::new(topk.reps, &topk.num_threads, &topk.runs);
let steps = search::knn::SearchSteps::new(
topk.reps,
&topk.num_threads,
&topk.runs,
GroundTruthMode::Fixed,
);

let results = search::knn::run(&knn, &groundtruth, steps)?;
Ok(AggregatedSearchResults::Topk(results))
Expand Down Expand Up @@ -634,6 +645,7 @@ where
beta_filter.reps,
&beta_filter.num_threads,
&beta_filter.runs,
GroundTruthMode::Flexible,
);

let result = search::knn::run(&knn, &groundtruth, steps)?;
Expand Down Expand Up @@ -679,8 +691,12 @@ where
let groundtruth =
datafiles::load_range_groundtruth(datafiles::BinFile(&multihop.groundtruth))?;

let steps =
search::knn::SearchSteps::new(multihop.reps, &multihop.num_threads, &multihop.runs);
let steps = search::knn::SearchSteps::new(
multihop.reps,
&multihop.num_threads,
&multihop.runs,
GroundTruthMode::Flexible,
);

let bit_maps = generate_bitmaps(&multihop.query_predicates, &multihop.data_labels)?;

Expand Down Expand Up @@ -737,7 +753,12 @@ where
let groundtruth =
datafiles::load_range_groundtruth(datafiles::BinFile(&inline.groundtruth))?;

let steps = search::knn::SearchSteps::new(inline.reps, &inline.num_threads, &inline.runs);
let steps = search::knn::SearchSteps::new(
inline.reps,
&inline.num_threads,
&inline.runs,
GroundTruthMode::Flexible,
);

let bit_maps = generate_bitmaps(&inline.query_predicates, &inline.data_labels)?;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ use diskann::{
graph::{DiskANNIndex, InplaceDeleteMethod, SampleableForStart},
utils::{VectorRepr, ONE},
};
use diskann_benchmark_core::{self as benchmark_core, recall::Rows, streaming::executors::bigann};
use diskann_benchmark_core::{
self as benchmark_core,
recall::{GroundTruthMode, Rows},
streaming::executors::bigann,
};
use diskann_benchmark_runner::{
benchmark::{FailureScore, MatchScore},
output::Output,
Expand Down Expand Up @@ -103,6 +107,7 @@ where
self.search.reps,
&self.search.num_threads,
&self.search.runs,
GroundTruthMode::Fixed,
);
let results = knn::run(&knn, groundtruth, steps)?;
Ok(StreamStats::Search(results))
Expand Down
6 changes: 5 additions & 1 deletion diskann-benchmark/src/index/bftree/spherical_streaming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use std::{borrow::Cow, io::Write, num::NonZeroUsize, sync::Arc};
use diskann::graph::{DiskANNIndex, InplaceDeleteMethod};
use diskann::utils::ONE;
use diskann_benchmark_core as benchmark_core;
use diskann_benchmark_core::{recall::Rows, streaming::executors::bigann};
use diskann_benchmark_core::{
recall::{GroundTruthMode, Rows},
streaming::executors::bigann,
};
use diskann_benchmark_runner::{
benchmark::{FailureScore, MatchScore},
output::Output,
Expand Down Expand Up @@ -107,6 +110,7 @@ impl ManagedStream<f32> for BfTreeSQStream {
self.search.reps,
&self.search.num_threads,
&self.search.runs,
GroundTruthMode::Fixed,
);
let results = knn::run(&knn, groundtruth, steps)?;
Ok(StreamStats::Search(results))
Expand Down
25 changes: 20 additions & 5 deletions diskann-benchmark/src/index/inmem/spherical.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ pub(crate) fn register_benchmarks(registry: &mut Registry) -> anyhow::Result<()>
mod imp {
use diskann::graph::{DiskANNIndex, StartPointStrategy};
use diskann_benchmark_core as benchmark_core;
use diskann_benchmark_core::recall::GroundTruthMode;
use diskann_benchmark_runner::{
benchmark::{FailureScore, MatchScore},
utils::{datatype::AsDataType, MicroSeconds},
Expand Down Expand Up @@ -390,7 +391,12 @@ mod imp {
let groundtruth =
datafiles::load_groundtruth(datafiles::BinFile(&topk.groundtruth), Some(max_k))?;

let steps = search::knn::SearchSteps::new(topk.reps, &topk.num_threads, &topk.runs);
let steps = search::knn::SearchSteps::new(
topk.reps,
&topk.num_threads,
&topk.runs,
GroundTruthMode::Fixed,
);

let knn = benchmark_core::search::graph::KNN::new(
index.clone(),
Expand Down Expand Up @@ -477,6 +483,7 @@ mod imp {
betafilter.reps,
&betafilter.num_threads,
&betafilter.runs,
GroundTruthMode::Flexible,
);

let bit_maps = generate_bitmaps(&betafilter.query_predicates, &betafilter.data_labels)?;
Expand Down Expand Up @@ -527,8 +534,12 @@ mod imp {
let groundtruth =
datafiles::load_range_groundtruth(datafiles::BinFile(&multihop.groundtruth))?;

let steps =
search::knn::SearchSteps::new(multihop.reps, &multihop.num_threads, &multihop.runs);
let steps = search::knn::SearchSteps::new(
multihop.reps,
&multihop.num_threads,
&multihop.runs,
GroundTruthMode::Flexible,
);

let bit_maps = generate_bitmaps(&multihop.query_predicates, &multihop.data_labels)?;

Expand Down Expand Up @@ -577,8 +588,12 @@ mod imp {
let groundtruth =
datafiles::load_range_groundtruth(datafiles::BinFile(&inline.groundtruth))?;

let steps =
search::knn::SearchSteps::new(inline.reps, &inline.num_threads, &inline.runs);
let steps = search::knn::SearchSteps::new(
inline.reps,
&inline.num_threads,
&inline.runs,
GroundTruthMode::Flexible,
);

let bit_maps = generate_bitmaps(&inline.query_predicates, &inline.data_labels)?;

Expand Down
21 changes: 17 additions & 4 deletions diskann-benchmark/src/index/search/knn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,21 @@ pub(crate) struct SearchSteps<'a> {
pub reps: NonZeroUsize,
pub num_tasks: &'a [NonZeroUsize],
pub runs: &'a [GraphSearch],
pub groundtruth_mode: GroundTruthMode,
}

impl<'a> SearchSteps<'a> {
pub(crate) fn new(
reps: NonZeroUsize,
num_tasks: &'a [NonZeroUsize],
runs: &'a [GraphSearch],
groundtruth_mode: GroundTruthMode,
) -> Self {
Self {
reps,
num_tasks,
runs,
groundtruth_mode,
}
}
}
Expand Down Expand Up @@ -57,7 +60,13 @@ pub(crate) fn run<I>(
})
.collect();

all.extend(runner.search_all(parameters, groundtruth, run.recall_k, run.search_n)?);
all.extend(runner.search_all(
parameters,
groundtruth,
run.recall_k,
run.search_n,
steps.groundtruth_mode,
)?);
}
}

Expand All @@ -72,6 +81,7 @@ pub(crate) trait Knn<I> {
groundtruth: &dyn benchmark_core::recall::Rows<I>,
recall_k: usize,
recall_n: usize,
groundtruth_mode: GroundTruthMode,
) -> anyhow::Result<Vec<SearchResults>>;
}

Expand All @@ -94,6 +104,7 @@ where
groundtruth: &dyn benchmark_core::recall::Rows<DP::InternalId>,
recall_k: usize,
recall_n: usize,
groundtruth_mode: GroundTruthMode,
) -> anyhow::Result<Vec<SearchResults>> {
let results = core_search::search_all(
self.clone(),
Expand All @@ -102,7 +113,7 @@ where
groundtruth,
recall_k,
recall_n,
GroundTruthMode::Fixed,
groundtruth_mode,
),
)?;

Expand All @@ -125,6 +136,7 @@ where
groundtruth: &dyn benchmark_core::recall::Rows<DP::InternalId>,
recall_k: usize,
recall_n: usize,
groundtruth_mode: GroundTruthMode,
) -> anyhow::Result<Vec<SearchResults>> {
let results = core_search::search_all(
self.clone(),
Expand All @@ -133,7 +145,7 @@ where
groundtruth,
recall_k,
recall_n,
GroundTruthMode::Flexible,
groundtruth_mode,
),
)?;

Expand All @@ -156,6 +168,7 @@ where
groundtruth: &dyn benchmark_core::recall::Rows<DP::InternalId>,
recall_k: usize,
recall_n: usize,
groundtruth_mode: GroundTruthMode,
) -> anyhow::Result<Vec<SearchResults>> {
let results = core_search::search_all(
self.clone(),
Expand All @@ -164,7 +177,7 @@ where
groundtruth,
recall_k,
recall_n,
GroundTruthMode::Flexible,
groundtruth_mode,
),
)?;

Expand Down
3 changes: 2 additions & 1 deletion diskann-benchmark/src/index/streaming/full_precision.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use diskann::{
utils::{VectorRepr, ONE},
ANNError, ANNErrorKind, ANNResult,
};
use diskann_benchmark_core::recall::Rows;
use diskann_benchmark_core::recall::{GroundTruthMode, Rows};
use diskann_providers::model::graph::provider::async_::{
common,
inmem::{self, DefaultProvider},
Expand Down Expand Up @@ -103,6 +103,7 @@ where
self.search.reps,
&self.search.num_threads,
&self.search.runs,
GroundTruthMode::Fixed,
);
let results = knn::run(&knn, groundtruth, steps)?;
Ok(StreamStats::Search(results))
Expand Down
4 changes: 3 additions & 1 deletion diskann-benchmark/src/utils/recall.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub(crate) fn compute_multiple_recalls<T>(
where
T: benchmark_core::recall::RecallCompatible,
{
use diskann_benchmark_core::recall::GroundTruthMode;

let mut result = Vec::new();
for k in recall_k {
for n in recall_n {
Expand All @@ -62,7 +64,7 @@ where
results,
*k,
*n,
benchmark_core::recall::GroundTruthMode::Fixed,
GroundTruthMode::Fixed,
)?;
result.push((&recall).into());
}
Expand Down
Loading