Skip to content
Open
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: 0 additions & 1 deletion .github/workflows/disk-benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ on:
- 'diskann-vector/**'
- 'diskann-wide/**'
- 'diskann-utils/**'
- 'diskann-platform/**'
- 'diskann-label-filter/**'
- 'diskann-benchmark/**'
- 'diskann-benchmark-runner/**'
Expand Down
14 changes: 1 addition & 13 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ members = [
"diskann-linalg",
"diskann-utils",
"diskann-quantization",
"diskann-platform",
# Algorithm
"diskann",
# Providers
Expand Down Expand Up @@ -55,7 +54,6 @@ diskann-vector = { path = "diskann-vector", version = "0.54.0" }
diskann-linalg = { path = "diskann-linalg", version = "0.54.0" }
diskann-utils = { path = "diskann-utils", default-features = false, version = "0.54.0" }
diskann-quantization = { path = "diskann-quantization", default-features = false, version = "0.54.0" }
diskann-platform = { path = "diskann-platform", version = "0.54.0" }
# Algorithm
diskann = { path = "diskann", version = "0.54.0" }
# Providers
Expand Down
1 change: 0 additions & 1 deletion agents.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ The repository uses a Cargo workspace with crates organized into functional tier
**Tier 1: Foundation**
- `diskann-wide/` - Low-level SIMD, bit manipulation, type width abstractions
- `diskann-vector/` - Vector primitives and operations
- `diskann-platform/` - Platform-specific utilities

**Tier 2: Core Libraries**
- `diskann-linalg/` - Linear algebra operations
Expand Down
1 change: 0 additions & 1 deletion diskann-benchmark/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ bftree = ["dep:diskann-bftree"]
# Enable Disk Index benchmarks
disk-index = [
"diskann-disk/perf_test",
"diskann-providers/perf_test",
"diskann-tools/perf_test",
"dep:diskann-disk",
"dep:opentelemetry",
Expand Down
6 changes: 3 additions & 3 deletions diskann-benchmark/src/disk_index/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use diskann_disk::{
disk_vertex_provider_factory::DiskVertexProviderFactory,
},
storage::disk_index_reader::DiskIndexReader,
utils::{instrumentation::PerfLogger, statistics, AlignedFileReaderFactory, QueryStatistics},
utils::{instrumentation::PerfLogger, statistics, QueryStatistics},
};
use diskann_providers::storage::StorageReadProvider;
use diskann_providers::{
Expand Down Expand Up @@ -218,8 +218,8 @@ where
CachingStrategy::None
};

let reader_factory = AlignedFileReaderFactory::new(disk_index_path);
let vertex_provider_factory = DiskVertexProviderFactory::new(reader_factory, caching_strategy)?;
let vertex_provider_factory =
DiskVertexProviderFactory::from_disk_index_path(disk_index_path, caching_strategy)?;

let searcher = &DiskIndexSearcher::<AdHoc<T>, _>::new(
search_params.num_threads,
Expand Down
17 changes: 16 additions & 1 deletion diskann-disk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ cfg-if.workspace = true
futures-util = { workspace = true, default-features = false }
hashbrown.workspace = true
half = { workspace = true, features = ["bytemuck", "num-traits"] }
diskann-platform = { workspace = true }
rand.workspace = true
rayon.workspace = true
serde = { workspace = true, features = ["derive"] }
Expand All @@ -47,8 +46,24 @@ opentelemetry = { workspace = true, optional = true }

[target.'cfg(target_os = "linux")'.dependencies]
io-uring = "0.6.4"

[target.'cfg(unix)'.dependencies]
libc = "0.2.148"

[target.'cfg(target_os = "windows")'.dependencies.windows-sys]
version = "0.61.2"
features = [
"Win32_Foundation",
"Win32_Security",
"Win32_Storage",
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Win32_System_Threading",
"Win32_System_WindowsProgramming",
"Win32_System_ProcessStatus",
"Win32_System_SystemInformation"
]

[dev-dependencies]
rstest.workspace = true
tempfile.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use std::time::Duration;

use criterion::Criterion;
use diskann_disk::utils::aligned_file_reader::{
use diskann_disk::search::provider::aligned_file_reader::{
traits::{AlignedFileReader, AlignedReaderFactory},
AlignedFileReaderFactory, AlignedRead,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Licensed under the MIT license.
*/

use diskann_disk::utils::aligned_file_reader::{
use diskann_disk::search::provider::aligned_file_reader::{
traits::{AlignedFileReader, AlignedReaderFactory},
AlignedFileReaderFactory, AlignedRead,
};
Expand Down
15 changes: 9 additions & 6 deletions diskann-disk/src/build/builder/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,17 +626,20 @@ impl<'a> MergedVamanaIndexWorkflow<'a> {
pub(crate) mod disk_index_builder_tests {
use std::{io::Read, sync::Arc};

use crate::test_utils::{GraphDataF32VectorU32Data, GraphDataF32VectorUnitData};
use crate::{
test_utils::{GraphDataF32VectorU32Data, GraphDataF32VectorUnitData},
utils::instrumentation::Timer,
};
use diskann::{
graph::config,
utils::{IntoUsize, VectorRepr, ONE},
ANNResult,
};
use diskann_providers::storage::VirtualStorageProvider;
use diskann_providers::{
storage::{get_compressed_pq_file, get_disk_index_file, get_pq_pivot_file},
utils::Timer,
use diskann_providers::storage::{
get_compressed_pq_file, get_disk_index_file, get_pq_pivot_file,
};

use diskann_utils::test_data_root;
use diskann_vector::{
distance::Metric::{self, L2},
Expand All @@ -651,11 +654,11 @@ pub(crate) mod disk_index_builder_tests {
data_model::{CachingStrategy, GraphHeader},
disk_index_build_parameter::{DiskIndexBuildParameters, MemoryBudget, NumPQChunks},
search::provider::{
disk_provider::DiskIndexSearcher,
aligned_file_reader::VirtualAlignedReaderFactory, disk_provider::DiskIndexSearcher,
disk_vertex_provider_factory::DiskVertexProviderFactory,
},
storage::disk_index_reader::DiskIndexReader,
utils::{QueryStatistics, VirtualAlignedReaderFactory},
utils::QueryStatistics,
};
const DEFAULT_DISK_SECTOR_LEN: usize = 4096;
pub const TEST_DATA_FILE: &str = "/sift/siftsmall_learn_256pts.fbin";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
use diskann::ANNResult;

#[cfg(all(not(miri), target_os = "linux"))]
use super::LinuxAlignedFileReader;
use crate::search::provider::aligned_file_reader::reader::LinuxAlignedFileReader;
#[cfg(any(miri, target_os = "macos"))]
use super::StorageProviderAlignedFileReader;
use crate::search::provider::aligned_file_reader::reader::StorageProviderAlignedFileReader;
#[cfg(all(not(miri), target_os = "windows"))]
use super::WindowsAlignedFileReader;
use crate::utils::aligned_file_reader::traits::AlignedReaderFactory;
use crate::search::provider::aligned_file_reader::reader::WindowsAlignedFileReader;
use crate::search::provider::aligned_file_reader::traits::AlignedReaderFactory;

#[cfg(any(miri, target_os = "macos"))]
use diskann_providers::storage::FileStorageProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/

//! Concrete [`AlignedReaderFactory`](super::traits::AlignedReaderFactory) implementations.

mod file;
pub use file::AlignedFileReaderFactory;

#[cfg(test)]
mod virtual_storage;
#[cfg(test)]
pub(crate) use virtual_storage::VirtualAlignedReaderFactory;
Comment thread
suri-kumkaran marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ use diskann::ANNResult;
use diskann_providers::storage::VirtualStorageProvider;
use vfs::{FileSystem, MemoryFS};

use super::{traits::AlignedReaderFactory, StorageProviderAlignedFileReader};
use crate::search::provider::aligned_file_reader::{
reader::StorageProviderAlignedFileReader, traits::AlignedReaderFactory,
};

pub struct VirtualAlignedReaderFactory<P: FileSystem = MemoryFS> {
pub file_path: String,
Expand Down
24 changes: 24 additions & 0 deletions diskann-disk/src/search/provider/aligned_file_reader/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/

pub mod traits;

mod aligned_read;
pub use aligned_read::{AlignedRead, Alignment, A1, A512};

#[cfg(all(not(miri), any(target_os = "linux", target_os = "windows")))]
mod platform;

mod reader;
#[cfg(all(not(miri), target_os = "linux"))]
pub use reader::LinuxAlignedFileReader;
pub use reader::StorageProviderAlignedFileReader;
#[cfg(all(not(miri), target_os = "windows"))]
pub use reader::WindowsAlignedFileReader;

mod factory;
pub use factory::AlignedFileReaderFactory;
#[cfg(test)]
pub(crate) use factory::VirtualAlignedReaderFactory;
Comment thread
suri-kumkaran marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ use io_uring::IoUring;

// The IOContext struct for disk I/O. One for each thread.
pub struct IOContext {
// Kept alive so the file descriptor registered with the io_uring ring stays valid;
// the fd is used via `register_files`, so this field is never read directly.
#[allow(dead_code)]
pub file_handle: File,
pub ring: IoUring,
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*
* Copyright (c) Microsoft Corporation.
* Licensed under the MIT license.
*/

//! Platform-specific I/O primitives backing the native aligned file readers.

#[cfg(target_os = "linux")]
mod linux;
#[cfg(target_os = "linux")]
pub use linux::IOContext;

#[cfg(target_os = "windows")]
mod windows;
#[cfg(target_os = "windows")]
pub use windows::{
get_queued_completion_status, read_file_to_slice, FileHandle, IOCompletionPort, IOContext,
DWORD, OVERLAPPED, ULONG_PTR,
};
Loading
Loading