70%サイズ、100%精度:動的長さ浮動小数点による効率的なGPU推論のためのロスレスLLM圧縮
70% Size, 100% Accuracy: Lossless LLM Compression for Efficient GPU Inference via Dynamic-Length Float
April 15, 2025
著者: Tianyi Zhang, Yang Sui, Shaochen Zhong, Vipin Chaudhary, Xia Hu, Anshumali Shrivastava
cs.AI
要旨
大規模言語モデル(LLMs)は急速にサイズが拡大し、リソースが制約されたハードウェア上での効率的なデプロイメントに大きな課題を生み出しています。本論文では、Dynamic-Length Float(DFloat11)という、LLMのサイズを30%削減しながら、元のモデルとビット単位で同一の出力を維持するロスレス圧縮フレームワークを紹介します。DFloat11は、LLMのBFloat16重み表現における低エントロピーに着目し、既存のストレージ形式の非効率性を明らかにすることで動機付けられています。エントロピー符号化を適用することで、DFloat11は重みに頻度に基づいた動的長さのエンコーディングを割り当て、精度を損なうことなく情報理論的に最適に近い圧縮を実現します。動的長さエンコーディングを用いた効率的な推論を可能にするため、高速なオンライン展開のためのカスタムGPUカーネルを開発しました。我々の設計は以下の要素を組み込んでいます:(i) メモリ集約的なルックアップテーブル(LUT)をGPUのSRAMに収まるコンパクトなLUTに分解すること、(ii) 軽量な補助変数を用いてスレッドの読み書き位置を調整する2段階カーネル、(iii) レイテンシを最小化するためのトランスフォーマーブロックレベルの展開。Llama-3.1、Qwen-2.5、Gemma-3などの最新モデルを用いた実験により、DFloat11がビット単位で正確な出力を維持しながら約30%のモデルサイズ削減を達成するという仮説を検証しました。メモリ制約を満たすために非圧縮モデルの一部をCPUにオフロードする代替案と比較して、DFloat11はトークン生成において1.9~38.8倍のスループットを達成しました。固定のGPUメモリ予算において、DFloat11は非圧縮モデルと比べて5.3~13.17倍の長いコンテキスト長を可能にします。特に、我々の手法は810GBのモデルであるLlama-3.1-405Bを、8x80GB GPUを搭載した単一ノード上でロスレス推論することを可能にします。コードとモデルはhttps://github.com/LeanModels/DFloat11で公開されています。
English
Large Language Models (LLMs) have grown rapidly in size, creating significant
challenges for efficient deployment on resource-constrained hardware. In this
paper, we introduce Dynamic-Length Float (DFloat11), a lossless compression
framework that reduces LLM size by 30% while preserving outputs that are
bit-for-bit identical to the original model. DFloat11 is motivated by the low
entropy in the BFloat16 weight representation of LLMs, which reveals
significant inefficiency in existing storage format. By applying entropy
coding, DFloat11 assigns dynamic-length encodings to weights based on
frequency, achieving near information-optimal compression without any loss of
precision. To facilitate efficient inference with dynamic-length encodings, we
develop a custom GPU kernel for fast online decompression. Our design
incorporates the following: (i) decomposition of memory-intensive lookup tables
(LUTs) into compact LUTs that fit in GPU SRAM, (ii) a two-phase kernel for
coordinating thread read/write positions using lightweight auxiliary variables,
and (iii) transformer-block-level decompression to minimize latency.
Experiments on recent models, including Llama-3.1, Qwen-2.5, and Gemma-3,
validates our hypothesis that DFloat11 achieves around 30% model size reduction
while preserving bit-for-bit exact outputs. Compared to a potential alternative
of offloading parts of an uncompressed model to the CPU to meet memory
constraints, DFloat11 achieves 1.9-38.8x higher throughput in token generation.
With a fixed GPU memory budget, DFloat11 enables 5.3-13.17x longer context
lengths than uncompressed models. Notably, our method enables lossless
inference of Llama-3.1-405B, an 810GB model, on a single node equipped with
8x80GB GPUs. Our code and models are available at
https://github.com/LeanModels/DFloat11.Summary
AI-Generated Summary