Transformers PR halves KV cache for looped layers: 8.76GB to 4.38GB at 262K tokens

art_zucker · x · 2026-11-25

Hugging Face Transformers engineer ArthurZucker opened PR #51161 adding a lastloop KV cache mode for Inkling-2-Mini's looped layers. The model loops 12 of its 24 layers three times; under the default perloop mode each pass writes its own KV cache (48 caches total). With lastloop, only the final pass writes the real caches while earlier passes read through a read-only view, cutting this to 24 and decoupling cache growth from pass count.

Original post →

More from Infra

Infra channel →