Skip to content
thlurtePublic

About

embedding runtime for vector search.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

11 Commits

Folders and files

Repository files navigation

cennan

C++ embedding and latent representation library for dense, vision, and late-interaction models.

Architecture

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 mmap Safetensors reader

Core Components

1. cennan::Tensor

Multi-dimensional tensor abstraction supporting owned contiguous heap buffers and zero-copy non-owning memory views.

2. cennan::MMapLoader

RAII-managed zero-copy binary and weight loader with madvise page hints (MADV_SEQUENTIAL, MADV_WILLNEED).

3. SIMD Normalization Kernels

Vectorized AVX2 + FMA rms_norm_f32 (Root Mean Square Normalization for LLaMA / Mistral / ColBERT) and layer_norm_f32.

4. Vectorized Micro-Blocks & Model Layers

  • 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).

Build & Test

# 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

Roadmap

  • Modern C++20 CMake Build Harness (-O3 -march=native -mavx2 -mfma)
  • Multi-Dimensional Tensor Abstraction (cennan::Tensor)
  • Zero-Copy POSIX MMapLoader with slice() view semantics
  • Vectorized AVX2 + FMA RMSNorm and LayerNorm Kernels
  • Vectorized In-Place Activations (GELU, SwiGLU, SiLU, Sigmoid)
  • AVX2 GEMV & 2D Register-Blocked AVX2 GEMM ($4 \times 16$ unrolled)
  • Zero-Copy Embedding Table Lookup Layer
  • Fused Pre-Norm LinearBlock with AVX2 GEMM + Activations
  • Safetensors 8-Byte JSON Header Parser
  • Multi-Head Self-Attention (FlashAttention CPU kernel)
  • Standalone C++ WordPiece / BPE Tokenizer

License

MIT License. Copyright (c) 2026 Adheeb Ahmed.

About

embedding runtime for vector search.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages