Buckets:
| <meta charset="utf-8" /><meta name="hf:doc:metadata" content="{"title":"Installation Guide","local":"installation-guide","sections":[{"title":"Table of Contents","local":"table-of-contents","sections":[],"depth":2},{"title":"System Requirements","local":"requirements","sections":[],"depth":2},{"title":"NVIDIA CUDA","local":"cuda","sections":[{"title":"Installation via PyPI","local":"cuda-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"cuda-compile","sections":[],"depth":3}],"depth":2},{"title":"Intel XPU","local":"xpu","sections":[{"title":"Installation via PyPI","local":"xpu-pip","sections":[],"depth":3}],"depth":2},{"title":"Intel Gaudi","local":"gaudi","sections":[{"title":"Installation from PyPI","local":"gaudi-pip","sections":[],"depth":3}],"depth":2},{"title":"CPU","local":"cpu","sections":[{"title":"Installation from PyPI","local":"cpu-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"cpu-compile","sections":[],"depth":3}],"depth":2},{"title":"AMD ROCm (Preview)","local":"rocm","sections":[{"title":"Installation from PyPI","local":"rocm-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"rocm-compile","sections":[],"depth":3}],"depth":2},{"title":"Preview Wheels","local":"preview-wheels","sections":[],"depth":2}],"depth":1}"> | |
| <link href="/docs/bitsandbytes/main/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/entry/start.c0102f52.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/scheduler.8a2cc2fa.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/singletons.e4f45388.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/index.ed040676.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/paths.21b0001b.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/entry/app.474c9bd3.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/preload-helper.ae26297d.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/index.7079e750.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/nodes/0.f07be6be.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/each.e59479a4.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/nodes/9.ef2459a4.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.09961a82.js"> | |
| <link rel="modulepreload" href="/docs/bitsandbytes/main/en/_app/immutable/chunks/CodeBlock.1f58aa3e.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{"title":"Installation Guide","local":"installation-guide","sections":[{"title":"Table of Contents","local":"table-of-contents","sections":[],"depth":2},{"title":"System Requirements","local":"requirements","sections":[],"depth":2},{"title":"NVIDIA CUDA","local":"cuda","sections":[{"title":"Installation via PyPI","local":"cuda-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"cuda-compile","sections":[],"depth":3}],"depth":2},{"title":"Intel XPU","local":"xpu","sections":[{"title":"Installation via PyPI","local":"xpu-pip","sections":[],"depth":3}],"depth":2},{"title":"Intel Gaudi","local":"gaudi","sections":[{"title":"Installation from PyPI","local":"gaudi-pip","sections":[],"depth":3}],"depth":2},{"title":"CPU","local":"cpu","sections":[{"title":"Installation from PyPI","local":"cpu-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"cpu-compile","sections":[],"depth":3}],"depth":2},{"title":"AMD ROCm (Preview)","local":"rocm","sections":[{"title":"Installation from PyPI","local":"rocm-pip","sections":[],"depth":3},{"title":"Compile from Source","local":"rocm-compile","sections":[],"depth":3}],"depth":2},{"title":"Preview Wheels","local":"preview-wheels","sections":[],"depth":2}],"depth":1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="installation-guide" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#installation-guide"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation Guide</span></h1> <p data-svelte-h="svelte-118o68n">Welcome to the installation guide for the <code>bitsandbytes</code> library! This document provides step-by-step instructions to install <code>bitsandbytes</code> across various platforms and hardware configurations.</p> <p data-svelte-h="svelte-16zrphu">We provide official support for NVIDIA GPUs, CPUs, Intel XPUs, and Intel Gaudi. We also have experimental support for additional platforms such as AMD ROCm and Apple Silicon.</p> <h2 class="relative group"><a id="table-of-contents" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#table-of-contents"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Table of Contents</span></h2> <ul data-svelte-h="svelte-1cxufgb"><li><a href="#requirements">System Requirements</a></li> <li><a href="#cuda">NVIDIA CUDA</a> <ul><li><a href="#cuda-pip">Installation via PyPI</a></li> <li><a href="#cuda-compile">Compile from Source</a></li></ul></li> <li><a href="#xpu">Intel XPU</a> <ul><li><a href="#xpu-pip">Installation via PyPI</a></li></ul></li> <li><a href="#gaudi">Intel Gaudi</a> <ul><li><a href="#gaudi-pip">Installation via PyPI</a></li></ul></li> <li><a href="#cpu">CPU</a> <ul><li><a href="#cpu-pip">Installation via PyPI</a></li> <li><a href="#cpu-compile">Compile from Source</a></li></ul></li> <li><a href="#rocm">AMD ROCm (Preview)</a> <ul><li><a href="#rocm-pip">Installation via PyPI</a></li> <li><a href="#rocm-compile">Compile from Source</a></li></ul></li> <li><a href="#preview-wheels">Preview Wheels</a></li></ul> <h2 class="relative group"><a id="requirements" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#requirements"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>System Requirements</span></h2> <p data-svelte-h="svelte-1jd2hl">These are the minimum requirements for <code>bitsandbytes</code> across all platforms. Please be aware that some compute platforms may impose more strict requirements.</p> <ul data-svelte-h="svelte-cox154"><li>Python >= 3.10</li> <li>PyTorch >= 2.3</li></ul> <h2 class="relative group"><a id="cuda" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cuda"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>NVIDIA CUDA</span></h2> <p data-svelte-h="svelte-1cwf52b"><code>bitsandbytes</code> is currently supported on NVIDIA GPUs with <a href="https://developer.nvidia.com/cuda-gpus" rel="nofollow">Compute Capability</a> 6.0+. | |
| The library can be built using CUDA Toolkit versions as old as <strong>11.8</strong>.</p> <table data-svelte-h="svelte-7ka1gp"><thead><tr><th><strong>Feature</strong></th> <th><strong>CC Required</strong></th> <th><strong>Example Hardware Requirement</strong></th></tr></thead> <tbody><tr><td>LLM.int8()</td> <td>7.5+</td> <td>Turing (RTX 20 series, T4) or newer GPUs</td></tr> <tr><td>8-bit optimizers/quantization</td> <td>6.0+</td> <td>Pascal (GTX 10X0 series, P100) or newer GPUs</td></tr> <tr><td>NF4/FP4 quantization</td> <td>6.0+</td> <td>Pascal (GTX 10X0 series, P100) or newer GPUs</td></tr></tbody></table> <h3 class="relative group"><a id="cuda-pip" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cuda-pip"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation via PyPI</span></h3> <p data-svelte-h="svelte-1f6ncvc">This is the most straightforward and recommended installation option.</p> <p data-svelte-h="svelte-9wkc2z">The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table data-svelte-h="svelte-1fiphak"><thead><tr><th><strong>OS</strong></th> <th><strong>CUDA Toolkit</strong></th> <th><strong>Host Compiler</strong></th> <th><strong>Targets</strong></th></tr></thead> <tbody><tr><td><strong>Linux x86-64</strong></td> <td>11.8 - 12.6</td> <td>GCC 11.2</td> <td>sm60, sm70, sm75, sm80, sm86, sm89, sm90</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>12.8 - 12.9</td> <td>GCC 11.2</td> <td>sm70, sm75, sm80, sm86, sm89, sm90, sm100, sm120</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>13.0</td> <td>GCC 11.2</td> <td>sm75, sm80, sm86, sm89, sm90, sm100, sm120</td></tr> <tr><td><strong>Linux aarch64</strong></td> <td>11.8 - 12.6</td> <td>GCC 11.2</td> <td>sm75, sm80, sm90</td></tr> <tr><td><strong>Linux aarch64</strong></td> <td>12.8 - 13.0</td> <td>GCC 11.2</td> <td>sm75, sm80, sm90, sm100, sm110, sm120, sm121</td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>11.8 - 12.6</td> <td>MSVC 19.43+ (VS2022)</td> <td>sm50, sm60, sm75, sm80, sm86, sm89, sm90</td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>12.8 - 12.9</td> <td>MSVC 19.43+ (VS2022)</td> <td>sm70, sm75, sm80, sm86, sm89, sm90, sm100, sm120</td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>13.0</td> <td>MSVC 19.43+ (VS2022)</td> <td>sm75, sm80, sm86, sm89, sm90, sm100, sm120</td></tr></tbody></table> <p data-svelte-h="svelte-8wq6s4">The Linux build has a minimum glibc version of 2.24.</p> <p data-svelte-h="svelte-49q16t">Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->pip install bitsandbytes<!-- HTML_TAG_END --></pre></div> <blockquote class="warning" data-svelte-h="svelte-zwu4gi"><p><strong>NVIDIA Jetson (L4T / JetPack) — source build required.</strong> The <code>Linux aarch64</code> wheels above are built on aarch64-sbsa runners (server-class ARM with the standard CUDA Toolkit). They are <strong>not compatible</strong> with the L4T runtime on Jetson devices (Orin Nano / NX / AGX, Xavier, Thor on CUDA 12), even though both are aarch64 and even though the cubins are binary-compatible with the device’s compute capability (e.g., <code>sm_80</code> cubin runs on <code>sm_87</code> hardware via Ampere-family binary compat — see <a href="https://developer.nvidia.com/blog/understanding-ptx-the-assembly-language-of-cuda-gpu-computing/#binary_compatibility" rel="nofollow">NVIDIA’s docs on binary compatibility</a>). The mismatch is at the CUDA library / ABI layer (JetPack ships its own CUDA Toolkit and system libraries), and surfaces as a runtime symbol-resolution error like <code>Error named symbol not found in /src/csrc/ops.cu</code> on the first CUDA op.</p> <p><strong>Two working options on Jetson:</strong></p> <ol><li><strong>Source build on-device.</strong> Use the <a href="#cuda-compile">Compile from Source</a> instructions below, passing your device’s compute capability explicitly (sm_87 for Orin family, sm_72 for Xavier). On an Orin Nano Super: <code>cmake -DCOMPUTE_BACKEND=cuda -DCOMPUTE_CAPABILITY=87 . && make -j4 && pip install .</code></li> <li><strong>Third-party prebuilt</strong> from <a href="https://pypi.jetson-ai-lab.io/" rel="nofollow">Jetson AI Lab’s package index</a> (e.g., <code>pypi.jetson-ai-lab.io/jp6/cu126/bitsandbytes/</code>).</li></ol></blockquote> <h3 class="relative group"><a id="cuda-compile" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cuda-compile"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Compile from Source</span></h3> <blockquote class="tip" data-svelte-h="svelte-v822tl"><p>Don’t hesitate to compile from source! The process is pretty straight forward and resilient. This might be needed for older CUDA Toolkit versions or Linux distributions, or other less common configurations.</p></blockquote> <p data-svelte-h="svelte-1ovl1gx">For Linux and Windows systems, compiling from source allows you to customize the build configurations. See below for detailed platform-specific instructions (see the <code>CMakeLists.txt</code> if you want to check the specifics and explore some additional options):</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">Linux </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">Windows </div></div> <div class="language-select"><p data-svelte-h="svelte-62t1s">To compile from source, you need CMake >= <strong>3.22.1</strong> and Python >= <strong>3.10</strong> installed. Make sure you have a compiler installed to compile C++ (<code>gcc</code>, <code>make</code>, headers, etc.). It is recommended to use GCC 11 or newer.</p> <p data-svelte-h="svelte-noyxvz">For example, to install a compiler and CMake on Ubuntu:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->apt-get install -y build-essential cmake<!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-kc1jbt">You should also install CUDA Toolkit by following the <a href="https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html" rel="nofollow">NVIDIA CUDA Installation Guide for Linux</a> guide. The current minimum supported CUDA Toolkit version that we support is <strong>11.8</strong>.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| cmake -DCOMPUTE_BACKEND=cuda -S . | |
| make | |
| pip install -e . <span class="hljs-comment"># `-e` for "editable" install, when developing BNB (otherwise leave that out)</span><!-- HTML_TAG_END --></pre></div> <blockquote class="tip" data-svelte-h="svelte-1ayoph"><p>If you have multiple versions of the CUDA Toolkit installed or it is in a non-standard location, please refer to CMake CUDA documentation for how to configure the CUDA compiler.</p></blockquote> </div> <h2 class="relative group"><a id="xpu" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#xpu"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Intel XPU</span></h2> <ul data-svelte-h="svelte-5zaimx"><li>A compatible PyTorch version with Intel XPU support is required. The current minimum is <strong>PyTorch 2.6.0</strong>. It is recommended to use the latest stable release. See <a href="https://docs.pytorch.org/docs/stable/notes/get_start_xpu.html" rel="nofollow">Getting Started on Intel GPU</a> for guidance.</li></ul> <h3 class="relative group"><a id="xpu-pip" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#xpu-pip"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation via PyPI</span></h3> <p data-svelte-h="svelte-1f6ncvc">This is the most straightforward and recommended installation option.</p> <p data-svelte-h="svelte-9wkc2z">The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table data-svelte-h="svelte-1biik1x"><thead><tr><th><strong>OS</strong></th> <th><strong>oneAPI Toolkit</strong></th> <th><strong>Kernel Implementation</strong></th></tr></thead> <tbody><tr><td><strong>Linux x86-64</strong></td> <td>2025.1.3</td> <td>SYCL + Triton</td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>2025.1.3</td> <td>SYCL + Triton</td></tr></tbody></table> <p data-svelte-h="svelte-dxuv01">The Linux build has a minimum glibc version of 2.34.</p> <p data-svelte-h="svelte-49q16t">Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->pip install bitsandbytes<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="gaudi" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#gaudi"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Intel Gaudi</span></h2> <ul data-svelte-h="svelte-1ol1nb2"><li>A compatible PyTorch version with Intel Gaudi support is required. The current minimum is <strong>Gaudi v1.21</strong> with <strong>PyTorch 2.6.0</strong>. It is recommended to use the latest stable release. See the Gaudi software <a href="https://docs.habana.ai/en/latest/Installation_Guide/index.html" rel="nofollow">installation guide</a> for guidance.</li></ul> <h3 class="relative group"><a id="gaudi-pip" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#gaudi-pip"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation from PyPI</span></h3> <p data-svelte-h="svelte-49q16t">Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->pip install bitsandbytes<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="cpu" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cpu"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>CPU</span></h2> <h3 class="relative group"><a id="cpu-pip" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cpu-pip"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation from PyPI</span></h3> <p data-svelte-h="svelte-1f6ncvc">This is the most straightforward and recommended installation option.</p> <p data-svelte-h="svelte-9wkc2z">The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table data-svelte-h="svelte-grs6yy"><thead><tr><th><strong>OS</strong></th> <th><strong>Host Compiler</strong></th> <th>Hardware Minimum</th></tr></thead> <tbody><tr><td><strong>Linux x86-64</strong></td> <td>GCC 11.4</td> <td>AVX2</td></tr> <tr><td><strong>Linux aarch64</strong></td> <td>GCC 11.4</td> <td></td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>MSVC 19.43+ (VS2022)</td> <td>AVX2</td></tr> <tr><td><strong>macOS arm64</strong></td> <td>Apple Clang 17</td> <td></td></tr></tbody></table> <p data-svelte-h="svelte-8wq6s4">The Linux build has a minimum glibc version of 2.24.</p> <p data-svelte-h="svelte-49q16t">Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->pip install bitsandbytes<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="cpu-compile" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#cpu-compile"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Compile from Source</span></h3> <p data-svelte-h="svelte-am5kx9">To compile from source, simply install the package from source using <code>pip</code>. The package will be built for CPU only at this time.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| pip install -e .<!-- HTML_TAG_END --></pre></div> <h2 class="relative group"><a id="rocm" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#rocm"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>AMD ROCm (Preview)</span></h2> <ul data-svelte-h="svelte-toq1xs"><li>Support for AMD GPUs is currently in a preview state.</li> <li>All features are supported for both consumer RDNA devices and Data Center CDNA products.</li> <li>A compatible PyTorch version with AMD ROCm support is required. It is recommended to use the latest stable release. On Linux, see <a href="https://rocm.docs.amd.com/projects/install-on-linux/en/latest/install/3rd-party/pytorch-install.html" rel="nofollow">PyTorch on ROCm</a> for guidance. On Windows, ROCm-enabled PyTorch wheels are available from: | |
| <ul><li><a href="https://repo.radeon.com/rocm/windows/" rel="nofollow">repo.radeon.com/rocm/windows/</a> — official AMD releases</li> <li><a href="https://repo.amd.com/rocm/whl/" rel="nofollow">repo.amd.com/rocm/whl/</a> — <a href="https://github.com/ROCm/TheRock" rel="nofollow">TheRock</a> release builds</li> <li><a href="https://rocm.nightlies.amd.com/v2" rel="nofollow">rocm.nightlies.amd.com/v2</a> — TheRock nightly builds</li></ul></li></ul> <h3 class="relative group"><a id="rocm-pip" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#rocm-pip"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Installation from PyPI</span></h3> <p data-svelte-h="svelte-1f6ncvc">This is the most straightforward and recommended installation option.</p> <p data-svelte-h="svelte-1fyy1ua">The currently distributed <code>bitsandbytes</code> are built with the following configurations:</p> <table data-svelte-h="svelte-1lvuxxg"><thead><tr><th><strong>OS</strong></th> <th><strong>ROCm</strong></th> <th><strong>Targets</strong></th></tr></thead> <tbody><tr><td><strong>Linux x86-64</strong></td> <td>6.2.4</td> <td>CDNA: gfx90a, gfx942 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>6.3.4</td> <td>CDNA: gfx90a, gfx942 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>6.4.4</td> <td>CDNA: gfx90a, gfx942 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, gfx1153, gfx1200, gfx1201</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>7.0.2</td> <td>CDNA: gfx90a, gfx942, gfx950 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, gfx1153, gfx1200, gfx1201</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>7.1.1</td> <td>CDNA: gfx90a, gfx942, gfx950 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, gfx1153, gfx1200, gfx1201</td></tr> <tr><td><strong>Linux x86-64</strong></td> <td>7.2.3</td> <td>CDNA: gfx90a, gfx942, gfx950 / RDNA: gfx1100, gfx1101, gfx1102, gfx1103, gfx1150, gfx1151, gfx1152, gfx1153, gfx1200, gfx1201</td></tr> <tr><td><strong>Windows x86-64</strong></td> <td>7.2.1</td> <td>RDNA: gfx1100, gfx1101, gfx1102, gfx1150, gfx1151, gfx1200, gfx1201</td></tr></tbody></table> <p data-svelte-h="svelte-49q16t">Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START -->pip install bitsandbytes<!-- HTML_TAG_END --></pre></div> <h3 class="relative group"><a id="rocm-compile" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#rocm-compile"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Compile from Source</span></h3> <p data-svelte-h="svelte-1vr3y6m">bitsandbytes can be compiled from ROCm 6.2 - ROCm 7.2.3. See the <code>CMakeLists.txt</code> for additional options.</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">Linux </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">Windows </div></div> <div class="language-select"><p data-svelte-h="svelte-3khjtw">To compile from source, you need CMake >= <strong>3.31.6</strong> and Python >= <strong>3.10</strong> installed. Make sure you have a compiler installed to compile C++ (<code>gcc</code>, <code>make</code>, headers, etc.).</p> <p data-svelte-h="svelte-1v5j4ex">You should also have a ROCm installation (system-wide or via Docker). The current minimum supported version is <strong>6.2</strong>.</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># Install bitsandbytes from source</span> | |
| <span class="hljs-comment"># Clone bitsandbytes repo</span> | |
| git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| <span class="hljs-comment"># Compile & install</span> | |
| apt-get install -y build-essential cmake <span class="hljs-comment"># install build tools dependencies, unless present</span> | |
| cmake -DCOMPUTE_BACKEND=hip -S . <span class="hljs-comment"># Use -DBNB_ROCM_ARCH="gfx90a;gfx942" to target specific gpu arch</span> | |
| make | |
| pip install -e . <span class="hljs-comment"># `-e` for "editable" install, when developing BNB (otherwise leave that out)</span><!-- HTML_TAG_END --></pre></div> </div> <h2 class="relative group"><a id="preview-wheels" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#preview-wheels"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>Preview Wheels</span></h2> <p data-svelte-h="svelte-1fhfips">If you would like to use new features even before they are officially released and help us test them, feel free to install the wheel directly from our CI (<em>the wheel links will remain stable!</em>):</p> <div class="flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd border-gray-800 bg-black dark:bg-gray-700 text-white">Linux </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">Windows </div><div class="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm">macOS </div></div> <div class="language-select"><div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class="language-bash "><!-- HTML_TAG_START --><span class="hljs-comment"># Note: if you don't want to reinstall our dependencies, append the `--no-deps` flag!</span> | |
| <span class="hljs-comment"># x86_64 (most users)</span> | |
| pip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-manylinux_2_24_x86_64.whl | |
| <span class="hljs-comment"># ARM/aarch64</span> | |
| pip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-manylinux_2_24_aarch64.whl<!-- HTML_TAG_END --></pre></div> </div> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/installation.mdx" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p> | |
| <script> | |
| { | |
| __sveltekit_7q78dx = { | |
| assets: "/docs/bitsandbytes/main/en", | |
| base: "/docs/bitsandbytes/main/en", | |
| env: {} | |
| }; | |
| const element = document.currentScript.parentElement; | |
| const data = [null,null]; | |
| Promise.all([ | |
| import("/docs/bitsandbytes/main/en/_app/immutable/entry/start.c0102f52.js"), | |
| import("/docs/bitsandbytes/main/en/_app/immutable/entry/app.474c9bd3.js") | |
| ]).then(([kit, app]) => { | |
| kit.start(app, element, { | |
| node_ids: [0, 9], | |
| data, | |
| form: null, | |
| error: null | |
| }); | |
| }); | |
| } | |
| </script> | |
Xet Storage Details
- Size:
- 57.3 kB
- Xet hash:
- 574c931bf56ccbf0d18bdf9cb36c5def27c70d93a37d7621a818371d985adaf0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.