理解并加速大型语言模型推理的内存处理流水线
Understand and Accelerate Memory Processing Pipeline for Large Language Model Inference
AI总结:
本文通过将稀疏注意力、检索增强生成和压缩上下文内存等优化统一为四步内存处理流水线,识别出22%-97%的内存处理开销,并提出使用GPU-FPGA异构系统加速该流水线,实现最高2.2倍加速和4.7倍能效提升。
摘要:
现代大型语言模型(LLMs)越来越依赖于高效的长上下文处理和生成机制,包括稀疏注意力、检索增强生成(RAG)和压缩上下文内存,以支持复杂推理。我们表明这些优化可以统一为一个四步内存处理流水线:准备内存、计算相关性、检索和应用到推理。通过系统分析,我们识别出LLM推理中22%-97%的内存处理开销及其计算特征的强异构性。受此洞察启发,我们认为异构系统非常适合加速内存处理,从而加速端到端推理。我们在GPU-FPGA系统上展示了这种方法,将稀疏、不规则和内存受限的操作卸载到FPGA,同时将计算密集型操作保留在GPU上。在AMD MI210 GPU和Alveo U55C FPGA上评估,我们的系统在多种LLM推理优化中比GPU基线快高达2.2倍,能耗降低高达4.7倍(在NVIDIA A100上结果类似)。这些结果确立了异构系统作为高效LLM内存处理的实用方向,并为未来异构硬件设计提供参考。
英文摘要:
Modern large language models (LLMs) increasingly depends on efficient long-context processing and generation mechanisms, including sparse attention, retrieval-augmented generation (RAG), and compressed contextual memory, to support complex reasoning. We show that these optimizations can be unified into a four-step memory processing pipeline: Prepare Memory, Compute Relevancy, Retrieval, and Apply to Inference. Through systematic profiling, we identify a 22%-97% memory processing overhead in LLM inference and strong heterogeneity in its computational characteristics. Motivated by this insight, we argue that \textbf{heterogeneous systems} are well-suited to accelerate memory processing and thus end-to-end inference. We demonstrate this approach on a GPU-FPGA system by offloading sparse, irregular, and memory-bounded operations to FPGAs while retaining compute-intensive operations on GPUs. Evaluated on an AMD MI210 GPU and an Alveo U55C FPGA, our system is up to $2.2\times$ faster and achieves up to $4.7\times$ less energy across multiple LLM inference optimizations than the GPU baseline (similar results hold on NVIDIA A100). These results establish heterogeneous systems as a practical direction for efficient LLM memory processing and inform future heterogeneous hardware design.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。