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
12 changes: 6 additions & 6 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ dashmap = "6.1.0"
futures-util = { version = "0.3.31", default-features = false }
half = "2.6.0"
hashbrown = "0.16.0"
iai-callgrind = "0.14.0"
iai-callgrind = "0.16.1"
itertools = "0.13.0"
num-traits = "0.2.15"
num_cpus = "1.16.0"
Expand Down
2 changes: 1 addition & 1 deletion diskann-benchmark/src/inputs/graph_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ impl IndexLoad {
save_and_load::get_graph_max_observed_degree(&storage_provider, &self.load_path)?;

let metadata =
load_metadata_from_file(&storage_provider, &format!("{}.data", &self.load_path))?;
load_metadata_from_file(&storage_provider, &format!("{}.data", self.load_path))?;

let distance: diskann_vector::distance::Metric = self.distance.into();
let config = config::Builder::new(
Expand Down
7 changes: 2 additions & 5 deletions diskann-disk/benches/bench_main_iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@

use benchmarks_iai::aligned_file_reader_bench_iai::aligned_file_reader_bench_iai;
use benchmarks_iai::kmeans_bench_iai::kmeans_bench_iai;
use iai_callgrind::{main, EventKind, LibraryBenchmarkConfig, RegressionConfig};
use iai_callgrind::{main, Callgrind, EventKind, LibraryBenchmarkConfig};

mod benchmarks_iai;

main!(
config = LibraryBenchmarkConfig::default()
.regression(
RegressionConfig::default()
.limits([(EventKind::Ir, 5.0), (EventKind::EstimatedCycles, 5.0)])
);
.tool(Callgrind::default().soft_limits([(EventKind::Ir, 5.0), (EventKind::EstimatedCycles, 5.0)]));
library_benchmark_groups =
aligned_file_reader_bench_iai,
kmeans_bench_iai,
Expand Down
12 changes: 4 additions & 8 deletions diskann-label-filter/src/parser/query_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ fn parse_query_filter_with_depth(
if let Some(arr) = obj.get("$and").and_then(|v| v.as_array()) {
let mut exprs = Vec::new();
for v in arr {
match parse_query_filter_with_depth(v, depth + 1) {
Ok(expr) => exprs.push(expr),
Err(e) => return Err(e),
}
let expr = parse_query_filter_with_depth(v, depth + 1)?;
exprs.push(expr)
}
if exprs.is_empty() {
return Err(QueryFilterError::ParseFailure(
Expand All @@ -100,10 +98,8 @@ fn parse_query_filter_with_depth(
if let Some(arr) = obj.get("$or").and_then(|v| v.as_array()) {
let mut exprs = Vec::new();
for v in arr {
match parse_query_filter_with_depth(v, depth + 1) {
Ok(expr) => exprs.push(expr),
Err(e) => return Err(e),
}
let expr = parse_query_filter_with_depth(v, depth + 1)?;
exprs.push(expr)
}
if exprs.is_empty() {
return Err(QueryFilterError::ParseFailure(
Expand Down
6 changes: 3 additions & 3 deletions diskann-quantization/src/minmax/quantizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,9 +504,9 @@ mod minmax_quantizer_tests {
assert!(
(reconstruction_error / norm) <= relative_err,
"Expected vector : {:?} to be reconstructed within error {} but instead got : {:?}, with error {} for dim : {}",
&vector,
vector,
relative_err,
&reconstructed,
reconstructed,
reconstruction_error / norm,
dim,
);
Expand All @@ -522,7 +522,7 @@ mod minmax_quantizer_tests {
"Encoded vector with dim : {dim} is {:?}, got error : {} for vector : {:?}",
encoded.reborrow(),
(code_sum - expected_code_sum).abs(),
&vector,
vector,
);
let recon_norm_sq = reconstructed.iter().map(|x| x * x).sum::<f32>();
assert!((encoded.reborrow().meta().norm_squared - recon_norm_sq).abs() <= 1e-3);
Expand Down
4 changes: 2 additions & 2 deletions diskann-tools/src/utils/compute_bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl QueryAccelerator for InvertedIndexAccelerator {

fn universe(&self) -> BitSet {
let mut result = BitSet::new();
for (_, bits) in self.map.iter() {
for bits in self.map.values() {
result.extend(bits);
}
result
Expand Down Expand Up @@ -121,7 +121,7 @@ impl QueryAccelerator for BTreeAccelerator {

fn universe(&self) -> BitSet {
let mut result = BitSet::new();
for (_, ids) in self.map.iter() {
for ids in self.map.values() {
result.extend(ids.iter().cloned());
}
result
Expand Down
8 changes: 3 additions & 5 deletions diskann-vector/benches/bench_main_vector_iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,14 @@
*/

use benchmarks_iai::{contains_bench_iai::*, cosine_iai::*, cosine_normalized_iai::*, l2_iai::*};
use iai_callgrind::{main, EventKind, LibraryBenchmarkConfig, RegressionConfig};
use iai_callgrind::{main, Callgrind, EventKind, LibraryBenchmarkConfig};
mod benchmarks_iai;
pub(crate) mod utils;

main!(
config = LibraryBenchmarkConfig::default()
.regression(
RegressionConfig::default()
.limits([(EventKind::Ir, 5.0), (EventKind::EstimatedCycles, 5.0), (EventKind::TotalRW, 5.0), (EventKind::L1hits, 5.0)])
);
.tool(Callgrind::default().soft_limits([(EventKind::Ir, 5.0), (EventKind::EstimatedCycles, 5.0), (EventKind::TotalRW, 5.0), (EventKind::L1hits, 5.0)]));

library_benchmark_groups =
benchmark_contains_bench_iai,
cosine_f16_iai,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Licensed under the MIT license.
*/
use diskann_vector::contains::ContainsSimd;
use iai_callgrind::black_box;
use rand::{distr::Uniform, prelude::Distribution, rngs::StdRng, Rng, SeedableRng};
use std::hint::black_box;

iai_callgrind::library_benchmark_group!(
name = benchmark_contains_bench_iai;
Expand Down
2 changes: 1 addition & 1 deletion diskann-vector/benches/benchmarks_iai/cosine_iai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::num::NonZeroUsize;

use diskann_vector::{distance::Cosine, DistanceFunction};
use half::f16;
use iai_callgrind::black_box;
use rand::{rngs::StdRng, SeedableRng};
use rand_distr::{Distribution, Normal, StandardUniform};
use std::hint::black_box;

use crate::utils::{AlignedDataset, AlignedVector, DatasetArgs, InlineBarrier, Static};
iai_callgrind::library_benchmark_group!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ use std::num::NonZeroUsize;

use diskann_vector::distance::CosineNormalized;
use half::f16;
use iai_callgrind::black_box;
use rand::{rngs::StdRng, SeedableRng};
use rand_distr::{Distribution, Normal};
use std::hint::black_box;

use crate::utils::{AlignedDataset, AlignedVector, DatasetArgs, InlineBarrier, Static};

Expand Down
6 changes: 5 additions & 1 deletion diskann-wide/src/test_utils/distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,11 @@ macro_rules! finite {
// infinity/NaN).
//
// The mantissa is allowed to be all zeros.
(<$T>::EXPONENT_MASK | <$T>::MANTISSA_MASK, false, true)
(
<$T as Layout>::EXPONENT_MASK | <$T as Layout>::MANTISSA_MASK,
false,
true,
)
} else if kind < NORMAL_WEIGHT + SUBNORMAL_WEIGHT {
// Generate a subnormal floating point number.
//
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.95"
channel = "1.97.1"
components = ["rust-src"]
Loading