Anda:利用可变长度分组激活数据格式释放高效 LLM 推理潜力
Anda: Unlocking Efficient LLM Inference with a Variable-Length Grouped Activation Data Format
AI总结:
本文提出 Anda 可变长度分组激活数据格式、训练后精度搜索算法及配套硬件优化,以降低 FP-INT GeMM 瓶颈并显著提升 LLM 推理的速度、面积与能源效率。
摘要:
广泛使用的仅权重量化大型语言模型(LLM)采用低位整数(INT)权重并保留浮点(FP)激活,从而在保持精度的同时降低存储需求。然而,这会将能耗和延迟瓶颈转移到 FP 激活上,而 FP 激活伴随着高成本的内存访问和计算。现有 LLM 加速器主要关注计算优化,忽视了联合优化 FP 计算与数据移动的潜力,尤其是在 LLM 推理中占主导地位的 FP-INT GeMM 操作方面。为应对这些挑战,我们研究了不同 LLM 模块中激活精度的敏感性及其对整体模型精度的影响。基于研究发现,我们首先提出 Anda 数据类型:一种具有组共享指数位和动态尾数位分配的自适应数据格式。其次,我们开发了一种迭代式训练后自适应精度搜索算法,用于优化不同 LLM 模块的位宽,以平衡模型精度、能源效率和推理速度。最后,我们提出一整套硬件优化技术,以最大限度发挥 Anda 格式的优势。这些技术包括基于位平面的数据组织方案、具备位串行计算能力的 Anda 增强处理单元,以及运行时位平面 Anda 压缩器,用于同时优化存储、计算和内存占用。我们针对 FPINT GeMM 操作的评估表明,与类似 GPU 的 FP-FP 基线相比,Anda 在包括 OPT、LLaMA 和 LLaMA-2 系列在内的主流 LLM 上平均实现 2.4 倍加速、4.0 倍面积效率和 3.1 倍能源效率提升。Anda 在各种应用场景、精度要求和系统性能下展现出很强的适应性,可在广泛部署场景中实现高效 LLM 推理。
英文摘要:
The widely-used, weight-only quantized large language models (LLMs), which leverage low-bit integer (INT) weights and retain floating-point (FP) activations, reduce storage requirements while maintaining accuracy. However, this shifts the energy and latency bottlenecks towards the FP activations that are associated with costly memory accesses and computations. Existing LLM accelerators focus primarily on computation optimizations, overlooking the potential of jointly optimizing FP computations and data movement, particularly for the dominant FP-INT GeMM operations in LLM inference. To address these challenges, we investigate the sensitivity of activation precision across various LLM modules and its impact on overall model accuracy. Based on our findings, we first propose the Anda data type: an adaptive data format with group-shared exponent bits and dynamic mantissa bit allocation. Secondly, we develop an iterative post-training adaptive precision search algorithm that optimizes the bit-width for different LLM modules to balance model accuracy, energy efficiency, and inference speed. Lastly, a suite of hardware optimization techniques is proposed to maximally exploit the benefits of the Anda format. These include a bit-plane-based data organization scheme, Anda-enhanced processing units with bit-serial computation, and a runtime bit-plane Anda compressor to simultaneously optimize storage, computation, and memory footprints. Our evaluations on FPINT GeMM operations show that Anda achieves a 2.4x speedup, 4.0x area efficiency, and 3.1x energy efficiency improvement on average for popular LLMs including OPT, LLaMA, and LLaMA-2 series over the GPU-like FP-FP baseline. Anda demonstrates strong adaptability across various application scenarios, accuracy requirements, and system performance, enabling efficient LLM inference across a wide range of deployment scenarios.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。