@no_stp_on_snek: anyone still talking about mlx-swift-lm? said i was taking the day off... cleaned the chicken coop, got a workout in, f…
Summary
The author describes implementing TurboQuant KV-cache compression into Apple's mlx-swift-lm, achieving 2.7x compression with quality on par with 8-bit, and 3-4x decode speed improvements via a fused Metal kernel.
View Cached Full Text
Cached at: 07/16/26, 06:17 PM
anyone still talking about mlx-swift-lm?
said i was taking the day off… cleaned the chicken coop, got a workout in, felt like a balanced human for about two hours. then i opened the laptop to check one thing. it is never one thing.
spent the “day off” getting TurboQuant KV-cache compression into Apple’s mlx-swift-lm.
it’s an asymmetric scheme by design. keys barely tolerate compression (softmax amplifies their error) so you keep K near-lossless, and values compress almost for free, so you squeeze V hard. result: 2.7x KV compression at quality on par with 8-bit, validated across 6 model families (1.7B up to a 30B MoE and a 32B) by KL-divergence against the fp16 cache. measured, not vibes.
the fun part was decode speed. first pass ran at ~20% of fp16, and the bottleneck wasn’t the math. it was re-materializing the entire cache every single token: full-cache f32 casts, GQA tensor expansion, 17 GPU dispatches where fp16 does 3.
so i ported my llama.cpp fork’s fused single-kernel decode into Metal. score, softmax, and inline dequant in one SIMD-parallel dispatch, K read once in its native basis. decode jumped 3 to 4x. now fp16-competitive at a quarter of the KV bytes.
been slowly trickling in some swift work upstream. this one is a larger pr.
Similar Articles
@no_stp_on_snek: busy evening in custom rust kernel and swift dispatch land. 3 of the 9 PRs are genuine new or changed metal kernels. th…
在自定义Rust内核和Swift调度逻辑的优化下,Qwen3.6-35b-A3B模型的预填速度在2k提示下从255 tok/s提升到1058 tok/s,实现了约4倍的加速,解码和困惑度未受影响。
@no_stp_on_snek: got it here if ya want to try it out:
A fork of llama.cpp integrating TurboQuant+ for advanced KV-cache and weight quantization, with cross-backend kernel support (Apple Silicon, NVIDIA CUDA, AMD ROCm, Vulkan) and used in production by LocalAI, Chronara, and AtomicChat.
@no_stp_on_snek: meanwhile the rest of us just plug away. im trying to solve sparse attention for mlx-swift-lm right now. making good pr…
Developer reports progress implementing sparse attention for mlx-swift-lm, achieving only +4% overhead vs dense attention on M5 Max.
llama.cpp PR reports up to 169% faster quantized-KV decode at 118K context on Intel Battlemage from one SYCL kernel switch
A llama.cpp PR proposes switching quantized-KV decode from the VEC to TILE SYCL kernel on Intel Battlemage, reportedly delivering up to ~169% faster decode at 118K context. The PR is open with caveats and limited independent verification.
Llama cpp metal moe optimization
A developer shared a Metal optimization for llama.cpp that improves decode speed for IQ3_XXS models on Apple Silicon, with a GitHub pull request and a request for community testing.