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

BitDecoding: 通过低精度KV缓存解锁Tensor Cores用于长上下文LLM

BitDecoding: Unlocking Tensor Cores for Long-Context LLMs with Low-Bit KV Cache

University of Edinburgh(爱丁堡大学);Microsoft Research(微软研究院);Institute for AI Industry Research (AIR), Tsinghua University(清华大学人工智能产业研究院)

Dayou Du, Shijie Cao, Jianyi Cheng, Luo Mai, Ting Cao, Mao Yang

AI总结:

BitDecoding通过协同利用CUDA核心和Tensor Core,实现低精度KV缓存的高效解码,提升长上下文LLM的解码速度。

摘要:

长上下文大语言模型(LLM)的发展显著增加了自回归解码过程中内存和带宽的压力,因为Key-Value(KV)缓存不断扩展。尽管保留精度的KV缓存量化(例如4位或2位)可以减少内存占用,但现有系统通过仅依赖CUDA核心进行解码,未能充分利用GPU上的主导计算资源Tensor Cores。我们提出了BitDecoding,这是首个能够高效解码低精度KV缓存的推理系统,通过协同利用CUDA核心和Tensor Cores。BitDecoding智能地诱导适合Tensor-Core的布局,引入 warp级去量化并行性,并通过查询转换、高性能张量和通道级量化以及软件流水线化的去量化内核提供统一的系统支持,从而实现混合精度执行。架构意识的优化进一步利用Hopper的warpgroup张量指令和Blackwell的NVFP4(MXFP4)张量格式。在Blackwell、Hopper和Ampere GPU上评估,BitDecoding在FP16 FlashDecoding-v2上平均提速7.5倍,最高在Blackwell上达到8.6倍,且在最先进方法上最高达到4.3倍。在LLaMA-3.1-8B 128K上下文上,BitDecoding将单批次解码延迟减少3倍。BitDecoding在https://github.com/OpenBitSys/BitDecoding上开源。

英文摘要:

The growth of long-context Large Language Models (LLMs) significantly increases memory and bandwidth pressure during autoregressive decoding due to the expanding Key-Value (KV) cache. While accuracy-preserving KV-cache quantization (e.g., 4-bit or 2-bit) reduces memory footprint, existing systems decode inefficiently by relying solely on CUDA cores, underutilizing Tensor Cores-the dominant compute resource on GPUs. We present BitDecoding, the first inference system to efficiently decode low-bit KV caches by cooperatively leveraging CUDA cores and Tensor Cores. BitDecoding smartly induces Tensor-Core-friendly layouts, introduces warp-level dequantization parallelism, and provides unified system support through query transformation, high-performance tensor- and channel-wise quantization, and a software-pipelined dequantization kernel enabling mixed-precision execution. Architecture-aware optimizations further leverage Hopper's warpgroup tensor instructions and Blackwell's NVFP4 (MXFP4) tensor formats. Evaluated on Blackwell, Hopper, and Ampere GPUs, BitDecoding achieves an average 7.5x decoding speedup over FP16 FlashDecoding-v2, up to 8.6x on Blackwell with NVFP4, and up to 4.3x over state-of-the-art approaches. On LLaMA-3.1-8B with a 128K context, BitDecoding reduces single-batch decoding latency by 3x. BitDecoding is open-sourced at https://github.com/OpenBitSys/BitDecoding.

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

↑