| Crates.io | innr |
| lib.rs | innr |
| version | 0.1.0 |
| created_at | 2026-01-18 14:53:33.734271+00 |
| updated_at | 2026-01-18 14:53:33.734271+00 |
| description | SIMD-accelerated vector similarity primitives (dot, cosine, norm, maxsim, matryoshka, clifford rotors) |
| homepage | https://github.com/arclabs561/innr |
| repository | https://github.com/arclabs561/innr |
| max_upload_size | |
| id | 2052436 |
| size | 269,207 |
SIMD-accelerated vector similarity primitives.
Dual-licensed under MIT or Apache-2.0.
use innr::{dot, cosine, norm};
let a = [1.0_f32, 0.0, 0.0];
let b = [0.707, 0.707, 0.0];
let d = dot(&a, &b); // 0.707
let c = cosine(&a, &b); // 0.707
let n = norm(&a); // 1.0
| Function | Description |
|---|---|
dot |
Inner product |
norm |
L2 norm |
cosine |
Cosine similarity |
l2_distance |
Euclidean distance |
sparse_dot |
Sparse vector dot (sparse feature) |
maxsim |
ColBERT late interaction (maxsim feature) |
| Architecture | Instructions | Detection |
|---|---|---|
| x86_64 | AVX2 + FMA | Runtime |
| aarch64 | NEON | Always |
| Other | Portable | LLVM auto-vec |
Vectors < 16 dimensions use portable code.
sparse — sparse vector operationsmaxsim — ColBERT late interaction scoringfull — all featuresFor maximum performance, build with native CPU features:
RUSTFLAGS="-C target-cpu=native" cargo build --release
Or specify a portable baseline with SIMD:
# AVX2 (89% of x86_64 CPUs)
RUSTFLAGS="-C target-cpu=x86-64-v3" cargo build --release
# SSE2 only (100% compatible)
RUSTFLAGS="-C target-cpu=x86-64" cargo build --release
Run benchmarks:
cargo bench
Generate flamegraphs (requires cargo-flamegraph):
./scripts/profile.sh dense