arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.02556cs.LGcs.ARcs.PF
收藏

快速的NF4去量化内核用于大语言模型推理

Fast NF4 Dequantization Kernels for Large Language Model Inference

University of Southern California(南加州大学)

Xiangbo Qi, Chaoyi Jiang, Murali Annavaram

AI总结:

本文提出了一种轻量级共享内存优化方法,通过利用内存层次结构提升性能,实现大语言模型推理的加速,展示了在不同模型上的显著速度提升。

摘要:

大语言模型(LLMs)已超越单个GPU设备的内存容量,需要量化技术进行实际部署。虽然NF4(4位NormalFloat)量化可实现4倍的内存减少,但当前NVIDIA GPU(如Ampere A100)上的推理需要昂贵的去量化回FP16格式,成为性能瓶颈。本文提出了一种轻量级共享内存优化,通过原理性的内存层次结构利用,保持完整的生态系统兼容性。我们对比了我们的技术与开源的BitsAndBytes实现,在三个模型(Gemma 27B、Qwen3 32B和Llama3.3 70B)上实现了2.0-2.2倍的内核加速,并通过共享内存相对于全局内存访问的12-15倍延迟优势,实现了高达1.54倍的端到端改进。我们的优化通过简化索引逻辑减少了指令数量,仅使用64字节的共享内存每线程块,证明了轻量级优化可通过最小的工程努力带来显著的性能提升。本文的工作为HuggingFace生态系统提供了一种即插即用的解决方案,使先进模型在现有GPU基础设施上更易获得。

英文摘要:

Large language models (LLMs) have grown beyond the memory capacity of single GPU devices, necessitating quantization techniques for practical deployment. While NF4 (4-bit NormalFloat) quantization enables 4$\times$ memory reduction, inference on current NVIDIA GPUs (e.g., Ampere A100) requires expensive dequantization back to FP16 format, creating a critical performance bottleneck. This paper presents a lightweight shared memory optimization that addresses this gap through principled memory hierarchy exploitation while maintaining full ecosystem compatibility. We compare our technique against the open-source BitsAndBytes implementation, achieving 2.0--2.2$\times$ kernel speedup across three models (Gemma 27B, Qwen3 32B, and Llama3.3 70B) and up to 1.54$\times$ end-to-end improvement by leveraging the 12--15$\times$ latency advantage of shared memory over global memory access. Our optimization reduces instruction counts through simplified indexing logic while using only 64 bytes of shared memory per thread block, demonstrating that lightweight optimizations can deliver substantial performance gains with minimal engineering effort. This work provides a plug-and-play solution for the HuggingFace ecosystem that democratizes access to advanced models on existing GPU infrastructure.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑