优化专家模型缓存管理,提升大模型推理效率
Cache Management for Mixture-of-Experts LLMs -- extended version
- 提出分层LRU算法,针对专家模型缓存特性设计
- 在真实数据追踪下,缓存命中率显著高于传统LRU
- 理论证明与实验验证,适合部署大规模专家模型的系统
大型语言模型(LLMs)在多种任务中展现出卓越能力,但其部署面临内存管理挑战,因其通常包含数十亿参数。为降低单个令牌生成时激活的参数量,混合专家(Mixture-of-Experts, MoE)架构被提出,这带来了新的缓存管理难题:频繁使用的专家应优先保留在高速缓存中,而非缓慢的二级存储。本文首次建立了一个专门建模专家管理优化的新页置换问题。该形式化同时考虑了LLM的分层结构与专家高效缓存的需求。我们推导出确定性与随机算法的竞争比下界,表明在合理假设下,类似LRU的策略具有良好的理论性能。随后,我们提出一种面向该问题的分层扩展版LRU算法。在合成数据集和真实MoE使用轨迹上的大量仿真显示,该算法优于经典页置换问题中的标准LRU策略。
原文摘要 · Abstract (English)
Large language models (LLMs) have demonstrated remarkable capabilities across a variety of tasks. One of the main challenges towards the successful deployment of LLMs is memory management, since they typically involve billions of parameters. To this end, architectures based on Mixture-of-Experts have been proposed, which aim to reduce the size of the parameters that are activated when producing a token. This raises the equally critical issue of efficiently managing the limited cache of the system, in that frequently used experts should be stored in the fast cache rather than in the slower secondary memory. In this work, we introduce and study a new paging problem that models expert management optimization. Our formulation captures both the layered architecture of LLMs and the requirement that experts are cached efficiently. We first present lower bounds on the competitive ratio of both deterministic and randomized algorithms, which show that under mild assumptions, LRU-like policies have good theoretical competitive performance. We then propose a layer-based extension of LRU that is tailored to the problem at hand. Extensive simulations on both synthetic datasets and actual traces of MoE usage show that our algorithm outperforms policies for the classic paging problem, such as the standard LRU.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。