Views
No views yet
Code & full documentation: github.com/qubitronlabsdev/llada-quantization
GSAI-ML/LLaDA-8B-Instruct:| File | Quantization | Size | Memory Saved | Speed (A100) |
|---|---|---|---|---|
llada_int8_quantized.pt | INT8 per-row | 8.54 GB | 47% | 9.64 tok/s |
llada_int4_quantized.pt | INT4 packed | 4.79 GB | 70% | 3.39 tok/s |
nn.Linear layers are replaced with custom quantized layers:[-127, 127] integers. Scale factors stored in float32. ~1 byte per weight.[-8, 7] integers. Two values packed per byte (uint8). ~0.5 bytes per weight.1git clone https://github.com/qubitronlabsdev/llada-quantization
2cd llada-quantization
3pip install -r requirements.txt1from inference import load_quantized, generate
2from transformers import AutoTokenizer
3
4tokenizer = AutoTokenizer.from_pretrained(
5 "GSAI-ML/LLaDA-8B-Instruct",
6 trust_remote_code=True
7)
8
9# Download weights from this repo first, then:
10
11# INT8
12model = load_quantized(
13 "llada_int8_quantized.pt",
14 mode="int8",
15 device="cuda"
16)
17
18# INT4
19model = load_quantized(
20 "llada_int4_quantized.pt",
21 mode="int4",
22 device="cuda"
23)
24
25output = generate(model, tokenizer, "What is machine learning?")
26print(output)1from quantize import run_and_save
2
3run_and_save(mode="int8", save_path="llada_int8_quantized.pt")
4run_and_save(mode="int4", save_path="llada_int4_quantized.pt")| Variant | Min VRAM | Recommended |
|---|---|---|
| INT8 | 12 GB | A100 / H100 |
| INT4 | 8 GB | RTX 3090 / A100 |
1@misc{llada-quantization-2026,
2 title = {LLaDA Quantization: INT8 and INT4 for Diffusion Language Models},
3 author = {Dhiraj Choudhary},
4 year = {2026},
5 url = {https://github.com/qubitronlabsdev/llada-quantization}
6}1@article{nie2025large,
2 title = {Large Language Diffusion Models},
3 author = {Nie, Shen and others},
4 year = {2025},
5 url = {https://arxiv.org/abs/2502.09992}
6}