LeanModels/DFloat11
DFloat11 [NeurIPS '25]: Lossless Compression of LLMs and DiTs for Efficient GPU Inference
What it solves
Large language models and diffusion models are often too big to fit in the GPU memory of commonly available hardware, forcing trade-offs between quality and speed. DFloat11 reduces the model size by roughly 30% without any loss of accuracy — the compressed model produces outputs that are bit-for-bit identical to the original. This lets you run models like Qwen3-8B, FLUX.1, or Wan2.1 on GPUs with far less VRAM, enabling practical inference on resource-constrained setups.
How it works
DFloat11 compresses model weights by applying Huffman coding to the exponent bits of BFloat16 numbers, a compact representation used in many neural networks. The compressed weights stay in GPU memory and are decompressed just before each matrix multiplication, then immediately discarded. All decompression happens on the GPU with no CPU involvement or host-device transfers. The decompression overhead is constant per forward pass and independent of batch size, so the relative cost shrinks as batch size grows. At batch size 1, inference is about 2× slower than the original BF16 model, but the gap narrows with larger batches. The framework also supports CPU offloading, which can dramatically cut peak GPU memory (for instance, running FLUX.1-Krea-dev drops from 17.5 GB to 9.8 GB).
Who it's for
DFloat11 is for anyone who needs to deploy large LLMs or diffusion models on GPUs with limited memory — whether that's a researcher running experiments on a single consumer GPU, a developer building a text-to-image service, or a team working with multimodal models like video generation (Wan2.1). It's also useful for organizations that want to reduce inference cost without sacrificing output quality.
Highlights
- Lossless compression: outputs are bit-for-bit identical to the original model.
- ~30% size reduction, allowing models like Qwen3-8B to run in as little as 2.3 GB VRAM with CPU offloading.
- All decompression is done on the GPU, avoiding slow CPU transfers.
- Compressed models are stored in safetensors format for safe, fast loading.
- Supports a wide range of models: Qwen, Gemma, Phi, Llama, DeepSeek, FLUX.1, Wan2.1, and more.
- The decompression kernel is 20–40% faster in recent updates.
- Open source with a pip package (
dfloat11[cuda12]) and pre-compressed models on Hugging Face.
Related
- Project
- Project
- Project
- Project