面向可部署LLM量化的一次速度之旅
A Speed Odyssey for Deployable Quantization of LLMs
AI总结:
针对LLM量化部署难题,提出硬件感知的OdysseyLLM方法,结合FastGEMM内核与组合量化策略,实现高达4倍速度提升且性能几乎无损。
摘要:
大语言模型时代迫切要求更快、更便宜的推理。先前针对LLM的模型压缩工作往往采用以软件为中心的方法,主要关注模拟量化性能。由于忽视了部署的可行性,这些方法在实际应用中通常无法使用。它们常常大幅降低量化位宽以减少计算量,但这可能不被主流硬件支持,或者涉及复杂的算法,引入了额外的计算或内存访问开销。我们认为,在构建量化算法时采用以硬件为中心的方法至关重要。为此,我们致力于在硬件感知的基础上构建我们的压缩方法,消除不切实际的算法选择,同时最大化硬件加速的收益。我们的方法OdysseyLLM配备了一种新颖的W4A8内核实现,称为FastGEMM,以及一种组合的量化策略方案。大量实验证明了我们W4A8方法的优越性,与Hugging Face FP16推理相比,实际速度提升高达4倍;与最先进的推理引擎TensorRT-LLM在FP16下相比,速度提升2.23倍;与TensorRT-LLM在INT8下相比,速度提升1.45倍,同时性能没有显著下降。
英文摘要:
The large language model era urges faster and less costly inference. Prior model compression works on LLMs tend to undertake a software-centric approach primarily focused on the simulated quantization performance. By neglecting the feasibility of deployment, these approaches are typically disabled in real practice. They used to drastically push down the quantization bit range for a reduced computation which might not be supported by the mainstream hardware, or involve sophisticated algorithms that introduce extra computation or memory access overhead. We argue that pursuing a hardware-centric approach in the construction of quantization algorithms is crucial. In this regard, we are driven to build our compression method on top of hardware awareness, eliminating impractical algorithm choices while maximizing the benefit of hardware acceleration. Our method, OdysseyLLM, comes with a novel W4A8 kernel implementation called FastGEMM and a combined recipe of quantization strategies. Extensive experiments manifest the superiority of our W4A8 method which brings the actual speed boosting up to \textbf{4$\times$} compared to Hugging Face FP16 inference and \textbf{2.23$\times$} vs. the state-of-the-art inference engine TensorRT-LLM in FP16, and \textbf{1.45$\times$} vs. TensorRT-LLM in INT8, yet without substantially harming the performance.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。