提出可动态切换的块浮点量化加速器,提升大模型在边缘设备上的推理速度。
F-BFQ: Flexible Block Floating-Point Quantization Accelerator for LLMs
- 设计支持两种块浮点变体动态切换的专用加速器
- 在三个量化模型上平均提速1.4倍,达到5.2词/秒
- 适合需要高效部署LLM的边缘计算场景
大型语言模型(LLMs)在日常任务中日益重要,从语音转文字到游戏帧生成。借助llama.cpp等推理框架的支持,如KV缓存和量化优化,如今在边缘设备上部署LLMs比以往更便捷。量化是使LLMs在资源受限设备上运行的关键技术,llama.cpp采用块浮点(BFP)量化显著降低权重与输入张量的位宽、内存占用及计算功耗。通常对模型各层采用混合BFP量化以减少量化带来的精度损失。因此,为高效加速多层BFP量化后的LLMs,专用加速器需支持不同BFP变体而无需重新配置。为此,我们提出灵活的块浮点量化加速器(F-BFQ),可动态切换两种BFP量化变体并执行矩阵乘法操作。初步设计部署于AMD Kria开发板,在三个BFP量化LLM上相比基于Arm NEON的CPU执行平均提速1.4倍,达到5.2令牌/秒(约3.9词/秒)。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have become increasingly prominent for daily tasks, from improving sound-totext translation to generating additional frames for the latest video games. With the help of LLM inference frameworks, such as llama.cpp, which support optimizations such as KV-caching and quantization, it is now easier than ever to deploy LLMs on edge devices. Quantization is fundamental to enable LLMs on resource-constrained edge devices, and llama.cpp utilizes block floating point (BFP) quantization to drastically reduce the bit width of weights and input tensors, the memory footprint, and the computational power required to run LLMs. LLMs are typically quantized with mixed BFP quantization across the model layers to reduce the loss of model accuracy due to quantization. Therefore, to efficiently accelerate across the layers of BFP-quantized LLMs, specialized accelerators need to support different BFP variants without reconfiguration. To address this issue, we propose a Flexible Block FloatingPoint Quantization (F-BFQ) accelerator, which can dynamically switch between two BFP quantization variants and perform matrix multiplication (MatMul) operations. Our initial F-BFQ accelerator design, deployed on the AMD Kria board, reduces inference time by 1.4x on average over the Arm NEON-based CPU execution across three BFP quantized LLMs while achieving 5.2 tokens per second (~3.9 words per second).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。