arXiv Science⌕ Search

arXiv · 2611.29092

One Million Tokens in 20GB: Calibration-Free 2-Bit SRFT KV-Cache Compression for Looped MoE Inference on Apple Silicon

Abstract

Long-context inference on unified-memory edge machines is governed by KV-cache capacity and memory bandwidth. On a 32 GB Apple M6 Mac mini (26.8 GB Metal working set, 150 GB/s DRAM), the 26.4B looped Mixture-of-Experts model Inkling-2-Mini (48 logical visits, 1M native context) exhausts memory by 64K tokens in stock oMLX (and by 512K even after fixing its 40 sliding-window visits to bounded ring buffers). We show that three structural properties of modern hybrid NoPE architectures -- bounded sliding windows, a 1,024-token banded relative bias whose tail is identically zero, and unit-RMS value normalization -- combine with an orthonormal Subsampled Randomized Fourier Transform (SRFT) to enable calibration-free, scale-free 2.000-bit Value and 2.125-bit Key Lloyd-Max compression (2.0625 effective bits/coordinate, $7.76\times$ smaller than bf16) on the 8 global visits' far prefix $[0, N-1024)$, merged with the exact bf16 local window and learned sink via online log-sum-exp. A custom GQA-packed Metal decode kernel with a 256-entry half4 LUT and Block-8 lazy exp2 rescaling reaches 73.4 GB/s and runs Inkling-2-Mini at 17.09 tok/s at 256K ($3.36\times$ faster than bf16), 13.81 tok/s at 512K, and 9.52 tok/s at 1,048,576 tokens in 19.49 GiB peak memory (4.37 GiB KV). Across $4\times 4096$ WikiText-2 windows, 3.06-bit SRFT is lossless ($Δ$PPL $= -0.007$), 2.56-bit K3/V2 adds $+0.024$, and 2.06-bit adds $+0.130$ while achieving 100% (3/3) exact 7-digit passkey retrieval at 8K, 16K, and 32K.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Mohamed Amine Bergach. 2026-11-21. One Million Tokens in 20GB: Calibration-Free 2-Bit SRFT KV-Cache Compression for Looped MoE Inference on Apple Silicon. https://arxiv.science/abs/2611.29092

Citations retain the original authors and DOI and include this site’s record URL. If this discovery service contributed to your research, you can also cite arXiv Science by Indiciae: BibTeX · RIS.

KEEP EXPLORING

Related papers

Accelerating Token-and-Duration Transducer ASR Inference: A Production Case Study of Parakeet TDT 0.6B

Token-and-duration transducer (TDT) models enable accurate speech transcription, but translating their model-level efficiency into high-performance GPU serving requires execution strategies tailored to the distinct demands of encoding and decoding. We present an optimized inference engine for Parakeet TDT 0.6B on an NVIDIA H100 GPU. Our stage-specific engine combines row-packed FP8 encoding, shape-specialized fusion and persistent megakernel decoding without per-step launches or host synchronization. It overlaps front-end processing with encoding and applies accuracy-gated frame merging with sequence-length restoration and selective pruning without end-to-end fine-tuning. Evaluated on Parakeet TDT 0.6B at 1,024 utterances per batch, the engine transcribes 50,058 seconds of audio per second, 14 times the throughput of the evaluated TensorRT baseline, with a lower mean word error rate (WER) and an 8.9-fold reduction in GPU energy per audio second.

cs.PF↗

ServeCast: Predicting LLM Serving Throughput and Latency Across Models from Microbenchmarks

Deciding how to deploy an LLM means predicting its throughput and latency under varying load. Benchmarking every candidate model on every GPU is expensive, and prediction is complicated by continuous batching and by request contexts that evolve. We introduce ServeCast, a performance model that follows requests with variable prompt and output lengths through admission, prefill, and decode under limited GPU memory. Its explicit parameters describe the LLM architecture and the clock and memory bandwidth of the GPU, and three timing coefficients are calibrated with microbenchmarks. To predict how a different LLM is served on the same GPU, ServeCast may transfer the performance model. The transfer updates the explicit parameters and keeps the timing coefficients fitted on a different LLM, so no re-profiling is needed. Our extensive numerical evaluation spans three GPUs, six LLMs, and three trace-derived workloads, comparing ServeCast with Vidur, a widely used simulator. When both are calibrated on the target, the aggregate mean absolute percentage error (MAPE) of ServeCast is 6.4% for mean request throughput, 11.9% for time to first token (TTFT), and 7.5% for time per output token (TPOT), against 8.9%, 25.0%, and 8.6% for Vidur, respectively. Under cross-model transfer, throughput and TPOT errors are comparable to those of Vidur, which requires calibration for each model/GPU pair, while ServeCast's aggregate TTFT predictions are still more accurate.

cs.PF↗

Improving Hit Ratios in LLM Serving: From Descriptive Characterization to Prescriptive Optimization

Workflows in modern large language model (LLM) serving systems exhibit prolonged conversations consisting of recursive prompts and responses. Due to the autoregressive nature of LLMs, a new response must be generated based on KV states of the entire conversation history. Therefore, the hit ratio, i.e., the fraction of KV caches reused directly from the memory among all KV caches in one conversation, is a crucial metric that governs the performance and economics of LLM serving. Describing the hit ratio as a function of system primitives is highly nontrivial due to the complex system dynamics; hence prescriptively optimizing the hit ratio is even more challenging. We approach the two problems by formulating the system as a stochastic multi-turn conversation model (MCM). We first characterize the hit ratio of the MCM under the widely used least-recently-used (LRU) policy through a mean-field framework. We prove that as the workflow arrival rate and the memory capacity scale proportionally, the hit ratio converges to an explicit limit. Our descriptive characterization reveals that LRU implicitly leads to a possibly suboptimal workflow quota allocation when the workflow is a mixture of heterogeneous classes. Therefore, we further propose a family of workflow-aware quota LRU (WAQ-LRU) policies that make quota allocation an explicit control decision, among which we identify the optimal quota vector, yielding a policy that dominates LRU in the mean-field limit. Experiments with Qwen3 models on Ascend NPUs fed by real-world conversation datasets validate our resulting hit ratio empirical estimator, and show substantial gains of WAQ-LRU over LRU in both hit ratio and time-to-first-token. Our results provide both descriptive and prescriptive insights into the understanding and improvement of multi-turn LLM serving.

cs.PF↗