Expand description
Rust port of SuperKMeans — a fast k-means clustering library for high-dimensional vector embeddings using BLAS+ADSampling pruning.
The C++ original lives in SuperKMeans/; this crate re-implements the
C++ public API (no Python surface) in pure Rust with no FFI dependencies.
Re-exports§
pub use common::DistanceFunction;pub use common::KnnCandidate;pub use hierarchical::HierarchicalSuperKMeans;pub use hierarchical::HierarchicalSuperKMeansConfig;pub use hierarchical::HierarchicalSuperKMeansIterationStats;pub use superkmeans::ClusterBalanceStats;pub use superkmeans::SuperKMeans;pub use superkmeans::SuperKMeansConfig;pub use superkmeans::SuperKMeansIterationStats;pub use utils::TicToc;pub use utils::compute_l2_squared;pub use utils::compute_norms_row_major;pub use utils::find_nearest_neighbor_brute_force;pub use utils::generate_random_vectors;pub use utils::make_blobs;
Modules§
- adsampling
- ADSampling-style random rotation + per-dimension pruning thresholds.
- batch
- Batched nearest-neighbour search built on top of SGEMM and the pruning kernel.
- common
- Shared constants and small utility types.
- distance
- Squared-L2 distance with a SIMD-friendly reduction.
- gemm
- SGEMM backend. Default: pure-Rust
matrixmultiply. With a BLAS backend feature the same calls route throughcblas_sgemm: - hierarchical
- Hierarchical SuperKMeans: 3-phase clustering for very large k.
- layout
- Centroid layout for the pruning path.
- pdxearch
- Progressive ADSampling-based top-1 nearest-neighbour search.
- superkmeans
- Core SuperKMeans algorithm: BLAS+pruning k-means.
- utils
- Timing, blob data generation, and brute-force reference routines.