Overview of bitsandbytes quantization features
mainbitsandbytes provides k-bit quantization for PyTorch to reduce memory consumption for large language model (LLM) inference and training. It offers three primary features:
- 8-bit optimizers: Uses block-wise quantization to maintain 32-bit performance while significantly reducing memory costs.
- LLM.int8() (8-bit quantization): Enables LLM inference with approximately half the required memory and no performance degradation. It uses vector-wise quantization to quantize most features to 8-bits, while treating outliers separately with 16-bit matrix multiplication.
- QLoRA (4-bit quantization): Enables LLM training using 4-bit quantization combined with trainable low-rank adaptation (LoRA) weights, allowing for memory-efficient training without compromising performance.