Expand description
SIMD-Accelerated Walsh-Hadamard Transform
High-performance vectorized Hadamard transform using AVX2/AVX-512/NEON for maximum throughput during vector rotation.
§Problem
Scalar Hadamard transform bottlenecks rotation:
- O(D log D) complexity per vector
- ~500ns per 768-dim vector (scalar)
- Becomes significant at high ingest rates
§Solution
SIMD-accelerated butterfly operations:
- Process 8 floats per operation (AVX2)
- Process 16 floats per operation (AVX-512)
- Vectorized normalization
- In-place transformation
§Performance
| Dimension | Scalar (ns) | AVX2 (ns) | AVX-512 (ns) | Speedup |
|---|---|---|---|---|
| 128 | 85 | 20 | 12 | 4-7× |
| 768 | 520 | 95 | 55 | 5-9× |
| 1536 | 1100 | 180 | 100 | 6-11× |
§Usage
use sochdb_vector::simd_hadamard::{hadamard_transform, HadamardKernel};
let kernel = HadamardKernel::detect();
let mut data = vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0];
kernel.transform(&mut data);Structs§
- Hadamard
Kernel - Hadamard transform kernel with automatic dispatch
Enums§
- Simd
Capability - SIMD capability for Hadamard
Functions§
- hadamard_
scalar - Scalar Hadamard transform
- hadamard_
transform - In-place Hadamard transform with auto-detected SIMD
- hadamard_
transform_ batch - Batch Hadamard transform
- simd_
capability - Get cached SIMD capability