HA-RAG: 基于热度感知的混合精度与数据放置的RAG加速
HA-RAG: Hotness-Aware RAG Acceleration via Mixed Precision and Data Placement
AI总结:
本文提出HA-RAG,通过热度感知的混合精度压缩与数据放置策略,优化RAG推理中的KV块加载与存储,相比TurboRAG实现最高10.49倍的TTFT加速且精度损失极小。
摘要:
检索增强生成(RAG)通过利用外部知识库提高模型输出的准确性,是解决大型语言模型(LLMs)中幻觉问题和知识更新延迟的有效方案。然而,外部知识库的引入使RAG面临长上下文处理的挑战,显著增加了内存消耗和推理延迟。现有研究通过预计算知识库的键值对(KV)并在推理过程中按需加载来加速推理。基于外部知识库中不同KV块被访问的频率,本文提出了一种热度感知的RAG(HA-RAG)推理优化系统。首先,利用KV块的数值分布,我们引入了一种热度感知的混合精度压缩和加载方法,以减少磁盘I/O和内存访问开销。其次,我们设计了一种热度感知的数据放置策略,优先将频繁访问的KV块存储在高速度内存中,以提高数据访问效率。实验结果表明,与TurboRAG相比,所提出的HA-RAG在首令牌时间(TTFT)上实现了平均2.10倍、最大10.49倍的加速,且精度损失可忽略不计。
英文摘要:
Retrieval-Augmented Generation (RAG) improves model output accuracy by leveraging external knowledge bases, serving as an effective solution to address hallucination issues and knowledge-update delays in Large Language Models (LLMs). However, the introduction of external knowledge bases presents RAG with challenges in long-context processing, significantly increasing memory consumption and inference latency. Existing research accelerates inference by precomputing Key and Value (KV) of the knowledge base and loading them on-demand during inference. Based on the access frequency of different KV chunks within the external knowledge base, this paper proposes a hotness-aware RAG (HA-RAG) inference optimization system. First, leveraging the numerical distribution of KV chunks, we introduce a hotness-aware mixed-precision compressing and loading method to reduce disk I/O and memory access overhead. Second, we design a hotness-aware data placement strategy that prioritizes storing frequently accessed KV chunks in high-speed memory to improve data access efficiency. Experimental results demonstrate that, compared with TurboRAG, the proposed HA-RAG achieves an average speedup of 2.10x and maximum speedup of 10.49x in Time-To-First-Token (TTFT) with negligible accuracy loss.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。