Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions diskann-benchmark-core/src/streaming/executors/bigann/runbook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,21 @@ impl ScanDirectory {

Ok(Self { directory, files })
}

/// Returns the expected BigANN groundtruth file name for a stage.
///
/// Files follow the `step<stage>.gt<suffix>` naming convention.
pub fn groundtruth_filename(stage: usize, suffix: &str) -> String {
format!("step{}.{}", stage, suffix)
}

/// Returns the expected BigANN groundtruth path for a stage.
///
/// See also: [`Self::groundtruth_filename`].
pub fn groundtruth_path(&self, stage: usize, suffix: &str) -> PathBuf {
self.directory
.join(Self::groundtruth_filename(stage, suffix))
}
}

impl FindGroundtruth for ScanDirectory {
Expand All @@ -402,7 +417,7 @@ impl FindGroundtruth for ScanDirectory {
///
/// Returns an error if no matching file is found or if multiple matches exist.
fn find_groundtruth(&mut self, stage: usize) -> anyhow::Result<PathBuf> {
let prefix = format!("step{}.gt", stage);
let prefix = Self::groundtruth_filename(stage, "gt");

enum Matches<'a> {
None,
Expand Down Expand Up @@ -437,10 +452,10 @@ impl FindGroundtruth for ScanDirectory {
match matches {
Matches::One(m) => Ok(self.directory.join(m)),
Matches::None => Err(anyhow::anyhow!(
"No groundtruth found for step {} in \"{}\", expected pattern: \"step{}.gt[0-9]*\"",
"No groundtruth found for step {} in \"{}\", expected pattern: \"{}[0-9]*\"",
stage,
self.directory.display(),
stage,
prefix,
)),
Matches::Many(matches) => Err(anyhow::anyhow!(
"Multiple groundtruth files found for step {} in \"{}\": {:?}",
Expand Down
1 change: 1 addition & 0 deletions diskann-tools/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ clap = { workspace = true, features = ["derive"] }
diskann-providers = { workspace = true, default-features = false } # see `linalg/Cargo.toml`
diskann-vector = { workspace = true }
diskann-utils = { workspace = true }
diskann-benchmark-core = { workspace = true, features = ["bigann"] }
bytemuck.workspace = true
Comment thread
magdalendobson marked this conversation as resolved.
num_cpus.workspace = true
rayon.workspace = true
Expand Down
Loading
Loading