C++ embedding and latent representation library for dense, vision, and late-interaction models.
cennan is designed to provide zero-copy feature extraction directly into vector search engines like secan.
- Dense Models: BERT, MiniLM, BGE, ModernBERT
- Multi-Vector / Late Interaction: ColBERT v2
- Vision Models: SigLIP, ViT, ColPali
- Zero-Copy Ingestion: POSIX
mmapSafetensors reader
Multi-dimensional tensor abstraction supporting owned contiguous heap buffers and zero-copy non-owning memory views.
RAII-managed zero-copy binary and weight loader with madvise page hints (MADV_SEQUENTIAL, MADV_WILLNEED).
Vectorized AVX2 + FMA rms_norm_f32 (Root Mean Square Normalization for LLaMA / Mistral / ColBERT) and layer_norm_f32.
cennan::Embedding: Zero-copy token embedding matrix lookup supporting both contiguous sequences and multi-vector outputs.cennan::LinearBlock: Pre-layer normalization (LayerNorm) fused with AVX2 GEMM linear projection and in-place non-linear activations (GELU/SiLU).
# Configure Release build
cmake -B build -DCMAKE_BUILD_TYPE=Release
# Build library, executable, and tests
cmake --build build -j$(nproc)
# Run full test suite
ctest --test-dir build --output-on-failure- Modern C++20 CMake Build Harness (
-O3 -march=native -mavx2 -mfma) - Multi-Dimensional Tensor Abstraction (
cennan::Tensor) - Zero-Copy POSIX
MMapLoaderwithslice()view semantics - Vectorized AVX2 + FMA
RMSNormandLayerNormKernels - Vectorized In-Place Activations (
GELU,SwiGLU,SiLU,Sigmoid) - AVX2 GEMV & 2D Register-Blocked AVX2 GEMM (
$4 \times 16$ unrolled) - Zero-Copy
EmbeddingTable Lookup Layer - Fused Pre-Norm
LinearBlockwith AVX2 GEMM + Activations - Safetensors 8-Byte JSON Header Parser
- Multi-Head Self-Attention (FlashAttention CPU kernel)
- Standalone C++ WordPiece / BPE Tokenizer
MIT License. Copyright (c) 2026 Adheeb Ahmed.