bitsandbytes
enables accessible large language models via k-bit quantization for PyTorch. We provide three main features for dramatically reducing memory consumption for inference and training:
The library includes quantization primitives for 8-bit & 4-bit operations, through bitsandbytes.nn.Linear8bitLt
and bitsandbytes.nn.Linear4bit
and 8-bit optimizers through bitsandbytes.optim
module.
bitsandbytes has the following minimum requirements for all platforms:
Note: this table reflects the status of the current development branch. For the latest stable release, see the document in the 0.47.0 tag.
🚧 = In Development, 〰️ = Partially Supported, ✅ = Supported, ❌ = Not Supported
Platform Accelerator Hardware Requirements LLM.int8() QLoRA 4-bit 8-bit Optimizers 🐧 Linux, glibc >= 2.24 x86-64 ◻️ CPU AVX2 ✅ ✅ ❌ 🟩 NVIDIA GPUcuda
SM50+ minimum
cuda
CDNA: gfx90a, gfx942
xpu
Data Center GPU Max Series
hpu
Gaudi1, Gaudi2, Gaudi3 ✅ 〰️ ❌ aarch64 ◻️ CPU ✅ ✅ ❌ 🟩 NVIDIA GPU
cuda
SM75+ ✅ ✅ ✅ 🪟 Windows 11 / Windows Server 2019+ x86-64 ◻️ CPU AVX2 ✅ ✅ ❌ 🟩 NVIDIA GPU
cuda
SM50+ minimum
xpu
Arc A-Series (Alchemist)
mps
Apple M1+ 🚧 🚧 ❌
The continued maintenance and development of bitsandbytes
is made possible thanks to the generous support of our sponsors. Their contributions help ensure that we can keep improving the project and delivering valuable updates to the community.
bitsandbytes
is MIT licensed.
We thank Fabio Cannizzo for his work on FastBinarySearch which we use for CPU quantization.
If you found this library useful, please consider citing our work:
@article{dettmers2023qlora, title={Qlora: Efficient finetuning of quantized llms}, author={Dettmers, Tim and Pagnoni, Artidoro and Holtzman, Ari and Zettlemoyer, Luke}, journal={arXiv preprint arXiv:2305.14314}, year={2023} }
@article{dettmers2022llmint8, title={LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale}, author={Dettmers, Tim and Lewis, Mike and Belkada, Younes and Zettlemoyer, Luke}, journal={arXiv preprint arXiv:2208.07339}, year={2022} }
@article{dettmers2022optimizers, title={8-bit Optimizers via Block-wise Quantization}, author={Dettmers, Tim and Lewis, Mike and Shleifer, Sam and Zettlemoyer, Luke}, journal={9th International Conference on Learning Representations, ICLR}, year={2022} }
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4