Performance optimizations:
- NF4 encode: replace 16-branch scalar lookup + O(16) linear scan with
explicit if-else lookup + O(4) binary search tree; add parallelize +
vectorized abs-max accumulator to encode_nf4/decode_nf4
- INT8 abs-max: vector acc_vec eliminates 47 reduce_max() calls per row in
vectro_standalone, quantizer_simd, and vectro_api
- Binary encode/decode: parallelize[_encode_row/decode_row](n) for linear
core scaling
- Pipe IPC: unsafe_ptr().bitcast[UInt8]() bulk copies replace element-by-
element loops in i8_to_bytes, f32_to_bytes, NF4/binary decode output paths
- vectro_api.mojo _int8_compress/_int8_decompress: resize() init + unsafe_ptr
extraction + SIMD acc + vectorized quant + parallelize (matches standalone)
- compute_kurtosis: restructured to row-major (outer=vectors, inner=dims)
eliminating 3072-byte strides; two-pass vectorized accumulation with per-dim
sum1/meanv/sum2/sum4 arrays
- Adam _adam_step: vectorize[_adam, SIMD_W](size) replaces scalar loop
- Batch buffers: pre-allocate 12 training buffers before epoch loop, free once
after; eliminates ~1562+ malloc/free cycles per training run
- pixi.toml: add build-mojo-native task with --optimization-level 3
Benchmark expansion:
- benchmarks/benchmark_ann_comparison.py: Vectro HNSW vs hnswlib/annoy/usearch
recall@1/5/10, QPS, build time; graceful ImportError per library
- benchmarks/benchmark_real_embeddings_v2.py: downloads GloVe.6B (862 MB),
caches glove_100d.npy; fixes broken PQ-96 path from v1
- benchmarks/benchmark_faiss_comparison.py: add benchmark_int8_multidim()
for d=128/384/768/1536 multi-dimension INT8 analysis
- pyproject.toml: bench-ann dep group (hnswlib, annoy, usearch, requests, tqdm)
Documentation:
- README: 598 tests badge, v3.6.0 roadmap section marked COMPLETE
- CHANGELOG: [3.6.0] section prepended
- PLAN.md: v3.6.0 section, updated next actions
- docs/faiss_comparison_results.md: updated with confirmed Mojo SIMD result
- BACKLOG_v2.1.md: truncated to archive header only
Test results: 598 passing (pre-existing sklearn failures unchanged)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>