Skip to main content

Module index_builder

Module index_builder 

Source
Expand description

GPU-accelerated HNSW index construction

This module implements HNSW graph construction with a GPU-oriented batched pipeline that runs as an efficient Pure Rust CPU implementation. Real CUDA kernels live in the quarantined oxirs-vec-adapter-cuda crate.

§Architecture

The GPU index builder works in phases:

  1. Vector Upload: Transfer vectors to GPU memory in batches
  2. Distance Matrix Computation: Compute all-pairs distances via CUDA kernels
  3. Neighbor Selection: Apply heuristic neighbor selection on GPU
  4. Graph Assembly: Assemble the HNSW graph structure from GPU results

§Pure Rust Policy

This module is 100% Pure Rust. Real CUDA code is quarantined in the oxirs-vec-adapter-cuda crate (publish = false).

§Module Layout

Re-exports§

pub use crate::gpu::index_builder_phases::BatchSizeCalculator;
pub use crate::gpu::index_builder_phases::ComputedBatch;
pub use crate::gpu::index_builder_phases::GpuBatchDistanceComputer;
pub use crate::gpu::index_builder_phases::GpuHnswIndexBuilder;
pub use crate::gpu::index_builder_phases::GpuIndexOptimizer;
pub use crate::gpu::index_builder_phases::GpuMemoryBudget;
pub use crate::gpu::index_builder_phases::IncrementalGpuIndexBuilder;
pub use crate::gpu::index_builder_phases::IndexedBatch;
pub use crate::gpu::index_builder_phases::PipelinedIndexBuilder;
pub use crate::gpu::index_builder_phases::PreparedBatch;
pub use crate::gpu::index_builder_types::ComputationCache;
pub use crate::gpu::index_builder_types::GpuDistanceMetric;
pub use crate::gpu::index_builder_types::GpuIndexBuildStats;
pub use crate::gpu::index_builder_types::GpuIndexBuilderConfig;
pub use crate::gpu::index_builder_types::HnswGraph;
pub use crate::gpu::index_builder_types::HnswNode;