响应长度感知与序列调度:一种由LLM赋能的LLM推理流水线
Response Length Perception and Sequence Scheduling: An LLM-Empowered LLM Inference Pipeline
AI总结:
本文提出利用LLM预测响应长度并将相似长度查询分组调度的推理流水线,在LLaMA模型上实现86%的吞吐量提升,且与FlashAttention、量化等现有加速技术正交兼容。
摘要:
大型语言模型(LLMs)已经彻底改变了人工智能领域,在各种任务中展现出前所未有的能力。然而,LLMs的推理过程伴随着显著的计算成本。在本文中,我们提出了一种高效的LLM推理流水线,该流水线利用了LLMs自身的能力。我们的方法首先挖掘LLMs在仅需极小开销的情况下准确感知和预测响应长度的潜力。通过利用这一信息,我们引入了一种高效的序列调度技术,将具有相似响应长度的查询分组到微批次中。我们使用基于LLaMA的模型在真实世界的指令数据集上评估了我们的方法,结果表明推理吞吐量提升了86%,且没有牺牲有效性。值得注意的是,我们的方法与其他推理加速技术是正交的,这使其成为许多现有LLM推理工具包(例如FlashAttention、量化)的有价值的补充。
英文摘要:
Large language models (LLMs) have revolutionized the field of AI, demonstrating unprecedented capacity across various tasks. However, the inference process for LLMs comes with significant computational costs. In this paper, we propose an efficient LLM inference pipeline that harnesses the power of LLMs. Our approach begins by tapping into the potential of LLMs to accurately perceive and predict the response length with minimal overhead. By leveraging this information, we introduce an efficient sequence scheduling technique that groups queries with similar response lengths into micro-batches. We evaluate our approach on real-world instruction datasets using the LLaMA-based model, and our results demonstrate an impressive 86% improvement in inference throughput without compromising effectiveness. Notably, our method is orthogonal to other inference acceleration techniques, making it a valuable addition to many existing toolkits (e.g., FlashAttention, Quantization) for LLM inference.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。