This repository explores quantization methods for Large Language Models (LLMs).
Quantization is a key technique for reducing model size and inference cost, enabling LLMs to run efficiently on consumer hardware or limited GPU memory.
We provide examples and experiments for:
- BitsAndBytes (bnb) β 8-bit / 4-bit quantization using the Hugging Face integration.
- AWQ (Activation-aware Weight Quantization) β a method that preserves accuracy by considering activation statistics.
- GPTQ (Gradient Post-training Quantization) β post-training quantization optimized for autoregressive transformers.
-
Implementation Examples
- Scripts for loading, quantizing, and saving models with each method.
- Examples include small models (
facebook/opt-125m) so you can try things quickly, and notes for scaling to larger models.
-
Benchmarks
- Inference time comparisons before and after quantization.
- Model size reduction (disk footprint in MB/GB).
- VRAM usage snapshots where applicable.
-
Guides & Utilities
- Helper functions for measuring folder size, timing inference, and testing outputs.
- Notes on environment setup for GPU clusters (CUDA / PyTorch / bitsandbytes compatibility).
-
Reproducibility
- Each script is self-contained and documented.
- Expected output snippets are included in the
READMEsections or script comments.