arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2411.02820cs.MAcs.AIcs.CLcs.LG
收藏

DroidSpeak:面向跨LLM通信与多LLM服务的KV缓存共享

DroidSpeak: KV Cache Sharing for Cross-LLM Communication and Multi-LLM Serving

University of Chicago(芝加哥大学);Microsoft(微软公司)

Yuhan Liu, Yuyang Huang, Jiayi Yao, Shaoting Feng, Zhuohan Gu, Kuntai Du, Hanchen Li, Yihua Cheng, Junchen Jiang, Shan Lu, Madan Musuvathi, Esha Choukse

AI总结:

提出首个支持跨相同架构LLM分布式推理节点重用KV缓存的系统DroidSpeak,通过选择性重计算部分层级并流水线化加载,实现高达4倍吞吐量和3.1倍预填充加速且质量损失可忽略。

摘要:

复合AI系统(如智能体系统)是大规模企业环境中的一种新兴趋势,其中多个针对不同用户、任务和/或角色进行专门化的LLM协同工作。在这些场景中,不同的模型通常处理共享相同上下文前缀的输入。尽管过去已有许多工作实现了在单个模型的输入之间重用前缀KV缓存,但如何让一个模型重用另一个不同模型的前缀KV缓存仍然是一个悬而未决的问题。我们提出了DroidSpeak,这是首个支持在运行不同LLM推理的分布式节点之间重用KV缓存的分布式LLM推理系统,前提是这些LLM具有相同的架构。我们首次开展了旨在理解在不同LLM之间共享KV缓存的影响,以及这种共享是否/何时会影响质量的研究。受这些发现的启发,我们提出了DroidSpeak,它选择性地重新计算由另一个LLM产生的KV缓存的几层,并重用剩余的层,且质量损失可忽略不计。此外,将逐层重计算与重用KV缓存的加载进行仔细的流水线化,进一步提升了推理性能。在多样化数据集和模型对上的实验表明,与不允许跨模型共享的基线相比,DroidSpeak实现了高达4倍的吞吐量提升和约3.1倍的预填充(首字时间)加速,且在F1分数、Rouge-L或代码相似度分数上质量损失可忽略不计。

英文摘要:

Compound AI systems, such as agentic systems, are an emerging trend in large-scale enterprise settings, with multiple LLMs specialized for different users, tasks, and/or roles working together. In these scenarios, different models often process inputs that share the same context prefix. Although much work was done in the past to enable the reuse of prefix KV caches across inputs for a single model, how to enable one model to reuse the prefix KV caches of a different model remains an open question. We introduce DroidSpeak, the first distributed LLM inference system that enables KV cache reuse across distributed nodes running inference of different LLMs, so long as the LLMs have the same architecture. We present the first study that aims at understanding the impact of sharing KV caches across different LLMs, and if/when such sharing affects quality. Inspired by the findings, we present DroidSpeak, which selectively recomputes a few layers of the KV cache produced by another LLM and reuses the remaining layers, with negligible quality loss. Moreover, carefully pipelining the layer-wise re-computation and the loading of reused KV cache further improves the inference performance. Experiments on diverse datasets and model pairs demonstrate that DroidSpeak achieves up to 4x throughput improvement and about 3.1x faster prefill (time to first token), with negligible loss of quality in F1 scores, Rouge-L or code similarity score, compared to the baseline which does not allow any sharing across models.

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

↑