Zero-Dependency C99 BitNet Inference Hits 36 tok/s on Intel Xeon CPU
shifu_legend · reddit · 2026-08-09
A developer built a CPU-first inference engine from scratch in pure C99, running BitNet 1.58-bit ternary models natively without Python, CUDA, or BLAS.
Core Tech & Performance:
- Achieves 36.25 tok/s on BitNet b1.58-2B-4T using 4 threads on an Intel Xeon.
- Native ternary SIMD: Weights are packed 4 per byte; custom AVX2/AVX-512 routines with VNNI instructions accumulate directly into integer registers, avoiding float32 unpacking overhead.
- Minimal runtime: Thread pool uses C11 atomics with spin-then-yield backoff for near-zero sync overhead. Compiles to a standalone binary serving an OpenAI-compatible API.
Bottleneck & Takeaways:
- Hits the DRAM bandwidth ceiling. At batch size 1, decode speed is memory-bound. Running at 95% of theoretical memory bandwidth, further compute kernel optimizations won't improve end-to-end latency.
More from Infra
- Chess Transformer hits 2545 Elo after 260x training speedup — realSharonZhou · 2026-11-30
- Tokens/sec alone is misleading: quantized LLM speed hides quality costs — OrganizationAgile361 · 2026-11-30
- Samsung's new memory chief warns record quarters don't mean competitiveness is back — tengyanAI · 2026-11-30
- Which free local AI model to download for your GPU, from 6GB to 24GB VRAM — alex_verem · 2026-11-30
- tqLLM 1.9.0: C++ LLM engine claims 4.6x Strata on 16GB, adds AMD RX 580 support — pmttyji · 2026-11-30
- oMLX 0.8.4 doubles Inkling 2 Mini decode speed on Mac, adds concurrent MTP — pcuenq · 2026-11-30