Skip to content

Instantly share code, notes, and snippets.

View veritatisquaesitoressumus's full-sized avatar

veritatisquaesitoressumus

View GitHub Profile
@veritatisquaesitoressumus
veritatisquaesitoressumus / ggml_turboquant.c
Created March 25, 2026 14:38
TurboQuant KV Cache Compression for llama.cpp (Zandieh et al., ICLR 2026) — 3-bit, 4.9x compression, 18/18 tests passing
/*
* TurboQuant: CPU Reference Implementation
* ==========================================
* Implements Algorithm 1 (TurboQuant_mse) from Zandieh et al., ICLR 2026.
*
* This is the portable C implementation that runs on CPU.
* The CUDA implementation (ggml_turboquant.cu) mirrors this logic
* with GPU-optimized kernels.
*
* Authors: Jim Sullivan / Claude collaboration