0
stars
2
commits
1
linked in READMEs
May 6, 2025
updated
deepseek-ai/DeepSeek-R1-Distill-Llama-8BThis is a losslessly compressed version of deepseek-ai/DeepSeek-R1-Distill-Llama-8B using our custom DFloat11 format. The outputs of this compressed model are bit-for-bit identical to the original BFloat16 model, while reducing GPU memory consumption by approximately 30%.
DFloat11 compresses model weights using Huffman coding of BFloat16 exponent bits, combined with hardware-aware algorithmic designs that enable efficient on-the-fly decompression directly on the GPU. During inference, the weights remain compressed in GPU memory and are decompressed just before matrix multiplications, then immediately discarded after use to minimize memory footprint.
Key benefits:
Install the DFloat11 pip package (installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed):
pip install dfloat11[cuda12]
# or if you have CUDA version 11:
# pip install dfloat11[cuda11]
To use the DFloat11 model, run the following example code in Python:
import torch
from dfloat11 import DFloat11Model
from transformers import AutoTokenizer
model_id = "DFloat11/DeepSeek-R1-Distill-Llama-8B-DF11"
model = DFloat11Model.from_pretrained(model_id, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token = tokenizer.eos_token
prompt = "Question: What is a binary tree and its applications? Answer:"
inputs = tokenizer(prompt, return_tensors="pt", padding=True).to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
)
print(tokenizer.batch_decode(output, skip_special_tokens=True))
2 commits
0
stars
2
commits
1
linked in READMEs
May 6, 2025
updated
deepseek-ai/DeepSeek-R1-Distill-Llama-8BThis is a losslessly compressed version of deepseek-ai/DeepSeek-R1-Distill-Llama-8B using our custom DFloat11 format. The outputs of this compressed model are bit-for-bit identical to the original BFloat16 model, while reducing GPU memory consumption by approximately 30%.
DFloat11 compresses model weights using Huffman coding of BFloat16 exponent bits, combined with hardware-aware algorithmic designs that enable efficient on-the-fly decompression directly on the GPU. During inference, the weights remain compressed in GPU memory and are decompressed just before matrix multiplications, then immediately discarded after use to minimize memory footprint.
Key benefits:
Install the DFloat11 pip package (installs the CUDA kernel automatically; requires a CUDA-compatible GPU and PyTorch installed):
pip install dfloat11[cuda12]
# or if you have CUDA version 11:
# pip install dfloat11[cuda11]
To use the DFloat11 model, run the following example code in Python:
import torch
from dfloat11 import DFloat11Model
from transformers import AutoTokenizer
model_id = "DFloat11/DeepSeek-R1-Distill-Llama-8B-DF11"
model = DFloat11Model.from_pretrained(model_id, device_map="auto")
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer.pad_token = tokenizer.eos_token
prompt = "Question: What is a binary tree and its applications? Answer:"
inputs = tokenizer(prompt, return_tensors="pt", padding=True).to(model.device)
with torch.no_grad():
output = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
)
print(tokenizer.batch_decode(output, skip_special_tokens=True))
2 commits