针对边缘设备部署MoE模型的量化与协同推理难题,提出高效解决方案。
Efficient Edge LLMs Deployment via HessianAware Quantization and CPU GPU Collaborative
- 基于海森量化的8比特联合量化,缓解激活值异常导致的精度损失。
- 在主流模型上实现接近全精度的推理准确率,显存降低60%。
- 支持CPU-GPU协同调度,适合资源受限的边缘部署场景。
随着大语言模型在自然语言处理和多模态任务中的突破性进展,如何在资源受限的边缘设备上高效部署成为关键挑战。混合专家(MoE)架构通过稀疏激活提升模型容量,但在实际部署中面临两大难题:(1) 激活分布中存在大量异常值,导致激活与权重量化后精度严重下降,显著影响推理性能;(2) 在内存受限条件下,专家模块的高效卸载与协同推理难以平衡延迟与吞吐。为此,本文提出一种基于海森感知量化(HAQ)与CPU-GPU协同推理的高效MoE边缘部署方案。首先,引入平滑海森矩阵量化,实现激活与权重的联合8比特量化,在主流硬件上保持高效性的同时显著缓解异常值带来的精度损失;其次,设计专家级协同卸载与推理机制,结合专家激活路径统计,实现专家模块在CPU与GPU间的高效部署与调度,大幅降低内存占用与推理延迟。大量实验验证了该方法在OPT系列与Mixtral 8*7B等主流大模型上的有效性:在Wikitext2与C4等数据集上,低比特量化模型的推理准确率接近全精度模型,同时显存使用减少约60%,推理延迟显著降低。
原文摘要 · Abstract (English)
With the breakthrough progress of large language models (LLMs) in natural language processing and multimodal tasks, efficiently deploying them on resource-constrained edge devices has become a critical challenge. The Mixture of Experts (MoE) architecture enhances model capacity through sparse activation, but faces two major difficulties in practical deployment: (1) The presence of numerous outliers in activation distributions leads to severe degradation in quantization accuracy for both activations and weights, significantly impairing inference performance; (2) Under limited memory, efficient offloading and collaborative inference of expert modules struggle to balance latency and throughput. To address these issues, this paper proposes an efficient MoE edge deployment scheme based on Hessian-Aware Quantization (HAQ) and CPU-GPU collaborative inference. First, by introducing smoothed Hessian matrix quantization, we achieve joint 8-bit quantization of activations and weights, which significantly alleviates the accuracy loss caused by outliers while ensuring efficient implementation on mainstream hardware. Second, we design an expert-level collaborative offloading and inference mechanism, which, combined with expert activation path statistics, enables efficient deployment and scheduling of expert modules between CPU and GPU, greatly reducing memory footprint and inference latency. Extensive experiments validate the effectiveness of our method on mainstream large models such as the OPT series and Mixtral 8*7B: on datasets like Wikitext2 and C4, the inference accuracy of the low-bit quantized model approaches that of the full-precision model, while GPU memory usage is reduced by about 60%, and inference latency is significantly improved.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。