arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.26666cs.LG
收藏

PersistentKV: 面向商用GPU上长上下文LLM服务的页面感知解码调度

PersistentKV: Page-Aware Decode Scheduling for Long-Context LLM Serving on Commodity GPUs

Muhammad Ahmed(穆罕默德·阿赫姆)

Muhammad Ahmed

AI总结:

针对长上下文LLM服务中KV缓存移动成为瓶颈的问题,提出PersistentKV引擎,通过页面感知调度和分组查询注意力优化解码,在RTX 3060上实现1.06-1.40倍吞吐提升。

摘要:

自回归大语言模型(LLM)服务日益受到键值(KV)缓存移动而非密集矩阵乘法的限制。现代分页注意力系统减少了KV缓存碎片,而诸如FlashInfer等成熟内核提供了高度优化的原生分页解码注意力。然而,最佳的单内核实现并不总是最佳的服务调度:低活跃度的长上下文解码可能未充分利用商用GPU,而混合序列长度在精确长度启动和粗粒度填充批次之间引入了权衡。我们提出了PersistentKV,一个原生块表解码注意力引擎和面向分组查询注意力(GQA)的页面感知调度研究。PersistentKV按KV头组映射工作,设计用于跨分组查询头重用K、V块,支持原生页表,并添加了一个紧凑的工作队列调度,仅执行非空的行-KV头-序列-拆分任务。在RTX 3060上,使用FP16、页大小16、Hq=32、Hkv=8、d=128,以及与FlashInfer相同的正确性容差,一个校准的自适应策略为小活跃批次选择FlashInfer,为B1长上下文步骤选择PersistentKV序列拆分,为B8长上下文步骤选择PersistentKV工作队列调度。在固定校准轨迹上的阈值和拆分计数下,一个保留的轨迹种子在B8双峰、均匀和Zipf类工作负载上实现了1.063-1.265倍的同步墙吞吐提升,在B1分桶轨迹上实现了1.399倍提升。在B4双峰边界情况下,该策略通过选择FlashInfer避免了PersistentKV的回归。这些结果确定了自适应页面感知解码调度的具体系统适用场景,并表明工作分配(而非仅注意力计算)是决定性的服务系统变量。

英文摘要:

Autoregressive large language model (LLM) serving is increasingly limited by key-value (KV) cache movement rather than dense matrix multiplication. Modern paged-attention systems reduce fragmentation, and mature kernels like FlashInfer provide highly optimized decode attention. However, the best single-kernel implementation is not always the best serving schedule: low-active long-context decode can under-utilize GPUs, while mixed sequence lengths introduce tension between many exact-length launches and coarse padded batches. We present PersistentKV, a native block-table decode attention engine and page-aware scheduling study for grouped-query attention (GQA). PersistentKV maps work by KV-head group, executes directly over native page tables, and adds a compact workqueue schedule executing only non-empty row-KV-head-sequence-split tasks. On an RTX 3060 (FP16, page size 16, Hq=32, Hkv=8, d=128), a calibrated roofline-style policy selects FlashInfer for small active batches, PersistentKV sequence splitting for batch size 1 (B1) long-context steps, and PersistentKV workqueue scheduling for supported B8 long-context GQA steps. With cost-model constants fixed on calibration traces, five held-out seeds improve mean wall decode-token throughput by 1.04x to 1.08x on B8 bimodal, uniform, and Zipf-like workloads, and by 1.40x on a B1 bucketed trace. For the B4 boundary case and uncalibrated GQA ratios, the policy avoids regressions by routing to FlashInfer. We also report an attention-plus-MLP timing proxy and workload counters showing workqueue scheduling reduces launch fan-out from 16.00 to 2.00 launches per step on held-out bimodal B8. These results show that work assignment is a decisive serving-system variable.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑