arXiv:2608.23962cs.AI2026-08

在大模型服务中,压缩缓存比增加显卡更省成本,尤其适合小模型。

More GPUs or a Smaller Cache? Tensor Parallelism versus KV Compression for Memory-Bound LLM Serving

论文配图:More GPUs or a Smaller Cache? Tensor Parallelism versus KV Compression for Memory-Bound LLM Serving
图 1 · 摘自论文原文
  • 用量化与淘汰策略压缩KV缓存,节省显存
  • 压缩方案比扩展显卡低1.2到2倍成本
  • 小模型(<36B)用压缩更划算,大模型需并行

当大模型服务部署遭遇KV缓存不足时,有两种主流方案:一是通过张量并行将权重和缓存分摊至多块显卡,代价是每层需全归约通信且硬件成本随设备数上升;二是直接在本地压缩缓存,如使用KV量化与淘汰机制,在保持单卡的前提下牺牲少量质量。现有研究分别报告内存压缩比与并行扩展吞吐曲线,却少有在同一成本轴上对比。本文在A100、A40、H100硬件上校准的模拟器中,将并行度1~8与16/8/4位量化及保留率最低0.25的压缩配置统一在‘每百万token成本-延迟’坐标系下比较。结果表明二者无成本交叉点:在7B与70B Llama-2模型、三种GPU类型、多种内存缓解方案下,压缩始终更便宜,降幅1.20x至2.00x。7B模型在80GB设备上无法耗尽其上下文窗口内的缓存预算,策略选择的关键阈值为模型参数量与设备内存之比,约36B参数对应80GB显卡。低于此值,压缩主导,额外显卡为浪费;高于此值,张量并行成为必要条件,因权重是瓶颈,压缩无效。并行可降低延迟(压缩使单令牌延迟恶化8%~93%,源于批处理竞争),而压缩是唯一能提升单位美元容量的手段(16.5倍对比并行1.21倍)。

原文摘要 · Abstract (English)

When an LLM serving deployment runs out of KVcache room, there are two well-established ways out. Tensor parallelism shards the weights and the KV cache across two, four, or eight devices, buying memory headroom at the price of an all-reduce on every layer and a hardware bill that grows with the device count. The algorithms community shrinks the cache in place, with KV quantisation and eviction keeping a single GPU and spending a little quality instead. Compression papers report memory ratios, parallel-scaling papers report throughput curves, and almost nobody puts the two on the same cost axis. We place tensor-parallel configurations (degree 1 to 8) and KV-compressed configurations (16/8/4-bit, keep-ratios down to 0.25) on one costnormalised axis, cost per million tokens against latency, using a profiled simulator calibrated on A100, A40, and H100 hardware, and we go looking for the cost-equivalence crossover. We do not find one. Across two models (Llama-2 at 7B and 70B), three GPU types, and every level of memory relief we could construct, compression is cheaper by 1.20x to 2.00x. A 7B model on an 80 GB device cannot exhaust its KV budget within its own context window, and the boundary that decides between the strategies is model size relative to device memory, at roughly 36B parameters for an 80 GB card. Below that wall, compression dominates and extra GPUs are largely wasted spend; above it, tensor parallelism stops being a choice and becomes an entry ticket: Llama-2-70B is infeasible on one A100 at any KV setting, because the binding resource is weights, which KV compression does not touch. Tensor parallelism is the only lever that improves latency (compression makes per-token latency worse, by 8 to 93%, through batching contention), while compression is the only lever that multiplies capacity per dollar (16.5x, against 1.21x for an eightfold spend on GPUs).

大模型推理内存优化缓存压缩张量并行

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。