MEADOW通过新数据流与权重压缩,显著降低边缘设备大模型推理时的内存访问延迟。
MEADOW: Memory-efficient Dataflow and Data Packing for Low Power Edge LLMs
- 采用令牌并行、头顺序处理的数据流,减少中间结果频繁存取
- 通过无损分解大权重矩阵,降低权重读取延迟1.5倍以上
- 适合低功耗边缘设备部署,实测推理延迟降低超40%
大型语言模型(LLMs)的计算与内存挑战催生了多种优化方法。尽管现有量化和稀疏加速技术在高功耗平台(如GPU、服务器级FPGA)上有效缓解了内存与计算瓶颈,但其基于通用矩阵乘法(GEMM)的执行方式在低功耗边缘设备上表现不佳——受限于有限的片外内存带宽,频繁地将大量中间激活数据存回片外内存导致注意力计算延迟激增。此外,从带宽受限的内存中读取权重矩阵进一步加剧内存瓶颈。为此,本文提出MEADOW框架,采用新型令牌并行头顺序(TPHS)数据流,显著减少片外内存访问;同时引入无损权重打包技术,将大权重矩阵分解为唯一元素,降低权重读取延迟。在功耗低于10W的Xilinx ZCU102 FPGA平台上,相较于传统GEMM实现,MEADOW使解码延迟降低1.5倍、预填充延迟降低2.5倍,端到端延迟提升超40%,优于现有优化方案。
原文摘要 · Abstract (English)
The computational and memory challenges of large language models (LLMs) have sparked several optimization approaches towards their efficient implementation. While prior LLM-targeted quantization, and prior works on sparse acceleration have significantly mitigated the memory and computation bottleneck, they do so assuming high power platforms such as GPUs and server-class FPGAs with large off-chip memory bandwidths and employ a generalized matrix multiplication (GEMM) execution of all the layers in the decoder. In such a GEMM-based execution, data is fetched from an off-chip memory, computed and stored back. However, at reduced off-chip memory capacities, as is the case with low-power edge devices, this implementation strategy significantly increases the attention computation latency owing to the repeated storage and fetch of large intermediate tokens to and from the off-chip memory. Moreover, fetching the weight matrices from a bandwidth constrained memory further aggravates the memory bottleneck problem. To this end, we introduce MEADOW, a framework that significantly reduces the off-chip memory access for LLMs with a novel token-parallel head-sequential (TPHS) dataflow. Additionally, MEADOW applies weight packing that performs loss-less decomposition of large weight matrices to their unique elements thereby, reducing the enormous weight fetch latency. MEADOW demonstrates 1.5x and 2.5x lower decode and prefill latency, respectively, compared to a GEMM-based LLM implementation on the low power Xilinx ZCU102 FPGA platform that consumes less than 10W. Additionally, MEADOW achieves an end-to-end latency improvement of over 40%, compared to prior LLM optimization works.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。