Skip to main content

k-bit optimizers and matrix multiplication routines.

Project description

bitsandbytes

Downloads Downloads Downloads

The bitsandbytes library is a lightweight Python wrapper around CUDA custom functions, in particular 8-bit optimizers, matrix multiplication (LLM.int8()), and 8 & 4-bit quantization functions.

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.

There are ongoing efforts to support further hardware backends, i.e. Intel CPU + GPU, AMD GPU, Apple Silicon. Windows support is quite far along and is on its way as well.

Please head to the official documentation page:

https://huggingface.co/docs/bitsandbytes/main

ALPHA TESTERS WANTED: multi-backend-refactor AMD GPU + Intel CPU/GPU specific BNB backend implementations

We're in the process of a complex refactor in order to allow the support of additional hardware backends, other than CUDA, in BNB. The efforts around this are already quite far along and there's plenty of functionality already in place that is in need for users to take a hands-on approach! Mac support will likely soon also see progress. However, I recommend waiting 2 weeks until the device abstraction has further consolidated (breaking changes upcoming).

Currently, you still need to compile from source, after checking out the multi-backend-refactor branch (instructions WIP, but the current docs on the compilation from source are a good starting point; feel free to share tips / input in this Github discussion. We'll soon enable nightly releases to make this much easier for you!

Please give feedback to us in this dedicated Github Discussion space!

We're super excited about these recent developments and grateful for any constructive input or support that you can give to help us make this a reality. BNB is a community project and we're excited for your collaboration 🤗

License

bitsandbytes is MIT licensed.

We thank Fabio Cannizzo for his work on FastBinarySearch which we use for CPU quantization.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

bitsandbytes-0.44.0rc1-py3-none-win_amd64.whl (121.5 MB view details)

Uploaded Python 3Windows x86-64

bitsandbytes-0.44.0rc1-py3-none-manylinux_2_24_x86_64.whl (122.4 MB view details)

Uploaded Python 3manylinux: glibc 2.24+ x86-64

File details

Details for the file bitsandbytes-0.44.0rc1-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for bitsandbytes-0.44.0rc1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 0371c29af0e16822dfd418cc1be52d72677126165d52206155b52c8a460e89e6
MD5 953bcbbbcbec4d4f26e0c668e84b2ea5
BLAKE2b-256 eed0747bf31bf2e4cf0d684026fe922a7e7a34a5533708aebc838379b5253d4e

See more details on using hashes here.

File details

Details for the file bitsandbytes-0.44.0rc1-py3-none-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for bitsandbytes-0.44.0rc1-py3-none-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 7832074aff237b53554acd82ebe7195118ab1b637c0315b8a09480a31fa94a9f
MD5 e6afaf52de48c9b95bc6fabe15b3b9bc
BLAKE2b-256 868a0d4d99b0bb0f6d504a2a8d6a288f41b2dedf2c97235070407dd403635e09

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page