arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2405.18628cs.LGcs.CL
收藏

面向硬件感知的并行提示解码:实现内存高效的 LLM 推理加速

Hardware-Aware Parallel Prompt Decoding for Memory-Efficient Acceleration of LLM Inference

Imperial College London, UK(伦敦帝国学院);Hong Kong Polytechnic University, Hong Kong(香港理工大学);Samsung AI Center, Cambridge, UK(三星人工智能中心)

Hao Mark Chen, Wayne Luk, Ka Fai Cedric Yiu, Rui Li, Konstantin Mishchenko, Stylianos I. Venieris, Hongxiang Fan

AI总结:

提出 PPD 并行提示解码与硬件感知动态稀疏树,以极低训练和内存开销提升 LLM 多 token 推理速度,并可正交结合现有推测解码。

摘要:

大语言模型(LLM)的自回归解码会在硬件性能方面造成显著开销。尽管近期研究已经探索了用于多 token 生成的各种推测解码技术,但这些工作主要关注提升吞吐量等处理速度。关键在于,它们往往忽略了实际部署中必不可少的其他指标,例如内存消耗和训练成本。为克服这些限制,我们提出一种新颖的并行提示解码,仅需 0.0002% 的可训练参数,从而能够在单张 A100-40GB GPU 上仅用 16 小时完成高效训练。受人类自然语言生成过程启发,PPD 通过使用多个提示 token 并行近似未来时间步生成的输出。该方法部分恢复了多 token 生成所需的缺失条件依赖信息,使长程预测的接受率最高提升 28%。此外,我们提出一种硬件感知的动态稀疏树技术,自适应地优化该解码方案,以充分利用不同 GPU 上的计算能力。通过在从 MobileLlama 到 Vicuna-13B 的 LLM 以及广泛基准上进行大量实验,我们的方法展现出最高 2.49 倍的加速,并将运行时内存开销维持在仅 0.0004% 的极低水平。更重要的是,我们的并行提示解码可作为一种正交优化,与现有推测解码协同集成,展现出最高 1.22 倍的进一步速度提升。代码位于 https://github.com/hmarkc/parallel-prompt-decoding。

英文摘要:

The auto-regressive decoding of Large Language Models (LLMs) results in significant overheads in their hardware performance. While recent research has investigated various speculative decoding techniques for multi-token generation, these efforts have primarily focused on improving processing speed such as throughput. Crucially, they often neglect other metrics essential for real-life deployments, such as memory consumption and training cost. To overcome these limitations, we propose a novel parallel prompt decoding that requires only $0.0002$% trainable parameters, enabling efficient training on a single A100-40GB GPU in just 16 hours. Inspired by the human natural language generation process, $PPD$ approximates outputs generated at future timesteps in parallel by using multiple prompt tokens. This approach partially recovers the missing conditional dependency information necessary for multi-token generation, resulting in up to a 28% higher acceptance rate for long-range predictions. Furthermore, we present a hardware-aware dynamic sparse tree technique that adaptively optimizes this decoding scheme to fully leverage the computational capacities on different GPUs. Through extensive experiments across LLMs ranging from MobileLlama to Vicuna-13B on a wide range of benchmarks, our approach demonstrates up to 2.49$\times$ speedup and maintains a minimal runtime memory overhead of just $0.0004$%. More importantly, our parallel prompt decoding can serve as an orthogonal optimization for synergistic integration with existing speculative decoding, showing up to $1.22\times$ further speed improvement. Our code is available at https://github.com/hmarkc/parallel-prompt-decoding.

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

↑