Andy Bell (@andyjsbell) — Local reasoning models

Original post: https://x.com/andyjsbell/status/2117294046310011391
Posted: 2026-11-02T16:33:32Z · Collected: 2026-11-03T15:30:00Z

Why it matters

Concrete performance bug and fix in a Rust local-inference stack.

Summary

@andyjsbell found that a single .contiguous() call made Qwen2 decode 2.4× faster in Candle on Metal (42→102 tok/s at 2K context): after prefill the V tensor is a transposed view, so each cache append copied the whole KV cache. The fix is Candle PR #4077, with a write-up and repro.

Pull quotes

One .contiguous() call makes Qwen2 decode 2.4× faster in Candle on Metal: 42 → 102 tok/s at 2k context. After prefill, V is a transposed view, so each Tensor::cat copies the whole KV cache.

Topics

Keywords

candle, metal, kv cache, rust, performance bug

Archive

Browse