SPARQLe: 用于量化LLM推理的子精度激活表示
SPARQLe: Sub-Precision Activation Representation for Quantized LLM Inference
AI总结:
针对LLM推理中激活值高精度需求导致的硬件开销,提出SPARQLe软硬件协同设计框架,利用激活值低位稀疏性,将高精度张量分解为密集低位和稀疏高位部分,在保持精度的同时降低内存访问和计算能耗。
摘要:
大型语言模型(LLM)规模的快速增长导致推理过程中计算和内存成本高昂。量化是解决这一挑战的重要途径。在追求量化极限的过程中,静态的权重通常可以被激进量化(例如4位),而激活值通常需要更高精度(例如8位)以保持准确性,这迫使硬件使用更高精度的数据通路。我们利用激活值中很大一部分集中在零附近的统计特性,导致高阶位稀疏。我们的提议SPARQLe是一个软硬件协同设计框架,利用任何给定量化模型中的这种子精度冗余。SPARQLe将每个2k位激活张量表示为密集的k位最低有效位(LSB)张量和压缩的稀疏k位最高有效位(MSB)张量(使用精度位图),并提出一种轻量级算法来增加MSB稀疏性。SPARQLe减少了激活内存流量,并支持在k位数据通路上进行高效计算,同时保持2k位激活精度。SPARQLe包含一个直接在这种混合格式上操作的加速器,具有最小的控制开销。在BitNet 3B、Llama2 7B和Llama3 8B模型上,SPARQLe将预填充延迟降低了16-24.3%,解码延迟降低了13.5-23.4%,预填充和解码能耗分别降低了17-26.7%和6.5-14.2%。SPARQLe表明,子精度激活稀疏性为高效LLM推理提供了一条有效且互补的途径。
英文摘要:
The rapid growth in sizes of Large language models (LLMs) results in high compute and memory costs during inference. Quantization has been a significant pathway to addressing this challenge. In the quest to push the limits of quantization, weights, which are static, can often be quantized aggressively (e.g. 4 bits), while activations often require higher precision (e.g., 8 bits) to preserve accuracy, forcing hardware to operate with higher-precision datapaths. We leverage the statistical property that a significant fraction of activations are concentrated around zero, resulting in sparsity in the higher-order bits. Our proposal, SPARQLe, is a hardware-software co-design framework that exploits this sub-precision redundancy in any given quantized model. SPARQLe represents each 2k-bit activation tensor as a dense k-bit LSB tensor and a sparse k-bit MSB tensor compressed with a precision bitmap, and proposes a lightweight algorithm to increase MSB sparsity. SPARQLe reduces activation memory traffic and enables efficient computation on k-bit datapaths while preserving 2k-bit activation accuracy. SPARQLe includes an accelerator that operates directly on this hybrid format with minimal control overheads. Across the BitNet 3B, Llama2 7B, and Llama3 8B models, SPARQLe reduces prefill latency by 16-24.3% and decode latency by 13.5-23.4%, with 17-26.7% and 6.5-14.2% lower prefill and decode energy, respectively. SPARQLe demonstrates that sub-precision activation sparsity offers an effective and complementary pathway towards efficient LLM inference.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。