Dev builds paged LLM inference engine for Apple Silicon, cuts attention memory 128x

Accomplished_Row1433 · reddit · 2026-09-20

The author open-sourced PagedServe, an experimental LLM inference runtime for Apple Silicon tackling KV-cache fragmentation: fixed-size physical KV blocks, logical-to-physical block tables, direct blockwise attention with online softmax, copy-on-write prefix sharing, continuous batching, and an experimental Metal decode kernel.

Benchmark results:

Caveat: the Metal kernel is currently 2.43x slower than the PyTorch blockwise path; profiling suggests the bottleneck is Python recreating Metal buffers and encoding a command buffer on every dispatch, not the attention math itself. The full runtime, benchmarks, and 283 tests are open-sourced, and the author seeks feedback on persistent Metal buffers and command-buffer reuse.

Repo: github.com/vermasarthak/pagedserve

Original post →

More from coding & agent

coding & agent channel →