Buckets:

HuggingFaceDocBuilder's picture
download
raw
32.6 kB
import"../chunks/DsnmJJEf.js";import{aI as tt,i as et,h as lt,C as ot,H as o,a as s,aJ as j,E as st,s as at}from"../chunks/DdsaYIhL.js";import{p as O,l as $,f as i,a,b as q,m as it,q as nt,g as dt,o as rt,s as t,d as m,n as v}from"../chunks/Cq6T2TQD.js";import{s as ct}from"../chunks/D8iZ9eWD.js";import{i as pt}from"../chunks/S93A39nX.js";function p(I,b){O(b,!0);const U=()=>it(tt,"$selectedHfOptions",T),[T,J]=nt();var M=$(),G=i(M);{var R=y=>{var w=$(),C=i(w);ct(C,()=>b.children??dt),a(y,w)};pt(G,y=>{U()[b.id]===b.option&&y(R)})}a(I,M),q(),J()}const mt='{"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}';var ht=m('<meta name="hf:doc:metadata"/>'),ut=m('<p>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>For example, to install a compiler and CMake on Ubuntu:</p> <!> <p>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> <!> <blockquote class="tip"><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>',1),bt=m('<p>Compilation from source on Windows systems require Visual Studio with C++ support as well as an installation of the CUDA Toolkit.</p> <p>To compile from source, you need CMake >= <strong>3.22.1</strong> and Python >= <strong>3.10</strong> installed. You should also install CUDA Toolkit by following the <a href="https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html" rel="nofollow">CUDA Installation Guide for Windows</a> guide from NVIDIA. The current minimum supported CUDA Toolkit version that we support is <strong>11.8</strong>.</p> <!> <p>Big thanks to <a href="https://github.com/wkpark" rel="nofollow">wkpark</a>, <a href="https://github.com/Jamezo97" rel="nofollow">Jamezo97</a>, <a href="https://github.com/rickardp" rel="nofollow">rickardp</a>, <a href="https://github.com/akx" rel="nofollow">akx</a> for their amazing contributions to make bitsandbytes compatible with Windows.</p>',1),E=m("<!> <!>",1),yt=m("<p>Requires Visual Studio 2022 or 2026.</p> <!>",1),gt=m('<p>Requires Visual Studio 2022 or 2026 with the <strong>ARM64 C++ build tools</strong> component, Python >= <strong>3.12</strong>, and PyTorch >= <strong>2.12</strong>.</p> <!> <blockquote class="note"><p>The build system will detect the ARM64 architecture automatically via CMake. Only the CPU backend is supported on Windows ARM64 at this time (no CUDA).</p></blockquote>',1),Mt=m("<!> <!> <!>",1),wt=m("<p>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>You should also have a ROCm installation (system-wide or via Docker). The current minimum supported version is <strong>6.2</strong>.</p> <!>",1),ft=m('<p>Compilation on Windows requires Visual Studio 2022 with C++ support, CMake, Ninja, and Python >= <strong>3.10</strong>.</p> <p>Instead of a system-wide ROCm installation, you can use the pip-installable ROCm SDK wheels from <a href="https://repo.radeon.com/rocm/windows/" rel="nofollow">repo.radeon.com</a>:</p> <!>',1),Ut=m("<!> <!> <!> <!>",1),Tt=m(`<p></p> <!> <!> <p>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>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> <!> <ul><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> <!> <p>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><li>Python >= 3.10</li> <li>PyTorch >= 2.4</li></ul> <blockquote class="note"><p>Windows ARM64 requires Python >= 3.12, as earlier Python versions do not provide official ARM64 Windows builds.</p></blockquote> <!> <p><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><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> <!> <p>This is the most straightforward and recommended installation option.</p> <p>The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table><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>The Linux build has a minimum glibc version of 2.24.</p> <p>Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <!> <blockquote class="warning"><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> <!> <blockquote class="tip"><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>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> <!> <!> <ul><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> <!> <p>This is the most straightforward and recommended installation option.</p> <p>The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table><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>The Linux build has a minimum glibc version of 2.34.</p> <p>Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <!> <!> <ul><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> <!> <p>Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <!> <!> <!> <p>This is the most straightforward and recommended installation option.</p> <p>The currently distributed <code>bitsandbytes</code> packages are built with the following configurations:</p> <table><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.51+ (VS2026)</td><td>AVX2</td></tr><tr><td><strong>Windows arm64</strong></td><td>MSVC 19.43+ (VS2022)</td><td>ARM NEON</td></tr><tr><td><strong>macOS arm64</strong></td><td>Apple Clang 17</td><td></td></tr></tbody></table> <p>The Linux build has a minimum glibc version of 2.24.</p> <p>Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <!> <!> <p>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> <!> <!> <ul><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> <!> <p>This is the most straightforward and recommended installation option.</p> <p>The currently distributed <code>bitsandbytes</code> are built with the following configurations:</p> <table><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.4</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>Use <code>pip</code> or <code>uv</code> to install the latest release:</p> <!> <!> <p>bitsandbytes can be compiled from ROCm 6.2 - ROCm 7.2.4. See the <code>CMakeLists.txt</code> for additional options.</p> <!> <!> <p>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> <!> <!> <p></p>`,1);function vt(I,b){O(b,!1),rt(()=>{new URLSearchParams(window.location.search).get("fw")}),et();var U=Tt();lt("t06thp",h=>{var g=ht();at(g,"content",mt),a(h,g)});var T=t(i(U),2);ot(T,{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"});var J=t(T,2);o(J,{title:"Installation Guide",local:"installation-guide",headingTag:"h1"});var M=t(J,6);o(M,{title:"Table of Contents",local:"table-of-contents",headingTag:"h2"});var G=t(M,4);o(G,{title:"System Requirements",local:"requirements",headingTag:"h2"});var R=t(G,8);o(R,{title:"NVIDIA CUDA",local:"cuda",headingTag:"h2"});var y=t(R,6);o(y,{title:"Installation via PyPI",local:"cuda-pip",headingTag:"h3"});var w=t(y,12);s(w,{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",lang:"bash",wrap:!1});var C=t(w,4);o(C,{title:"Compile from Source",local:"cuda-compile",headingTag:"h3"});var x=t(C,6);j(x,{id:"source",options:["Linux","Windows"],children:(h,g)=>{var d=E(),r=i(d);p(r,{id:"source",option:"Linux",children:(n,c)=>{var e=ut(),l=t(i(e),4);s(l,{code:"YXB0LWdldCUyMGluc3RhbGwlMjAteSUyMGJ1aWxkLWVzc2VudGlhbCUyMGNtYWtl",highlighted:"apt-get install -y build-essential cmake",lang:"bash",wrap:!1});var f=t(l,4);s(f,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQWNtYWtlJTIwLURDT01QVVRFX0JBQ0tFTkQlM0RjdWRhJTIwLVMlMjAuJTBBbWFrZSUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4lMjAlMjAlMjAlMjMlMjAlNjAtZSU2MCUyMGZvciUyMCUyMmVkaXRhYmxlJTIyJTIwaW5zdGFsbCUyQyUyMHdoZW4lMjBkZXZlbG9waW5nJTIwQk5CJTIwKG90aGVyd2lzZSUyMGxlYXZlJTIwdGhhdCUyMG91dCk=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
cmake -DCOMPUTE_BACKEND=cuda -S .
make
pip install -e . <span class="hljs-comment"># \`-e\` for &quot;editable&quot; install, when developing BNB (otherwise leave that out)</span>`,lang:"bash",wrap:!1}),v(2),a(n,e)},$$slots:{default:!0}});var u=t(r,2);p(u,{id:"source",option:"Windows",children:(n,c)=>{var e=bt(),l=t(i(e),4);s(l,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQWNtYWtlJTIwLURDT01QVVRFX0JBQ0tFTkQlM0RjdWRhJTIwLVMlMjAuJTBBY21ha2UlMjAtLWJ1aWxkJTIwLiUyMC0tY29uZmlnJTIwUmVsZWFzZSUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4lMjAlMjAlMjAlMjMlMjAlNjAtZSU2MCUyMGZvciUyMCUyMmVkaXRhYmxlJTIyJTIwaW5zdGFsbCUyQyUyMHdoZW4lMjBkZXZlbG9waW5nJTIwQk5CJTIwKG90aGVyd2lzZSUyMGxlYXZlJTIwdGhhdCUyMG91dCk=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
cmake -DCOMPUTE_BACKEND=cuda -S .
cmake --build . --config Release
pip install -e . <span class="hljs-comment"># \`-e\` for &quot;editable&quot; install, when developing BNB (otherwise leave that out)</span>`,lang:"bash",wrap:!1}),v(2),a(n,e)},$$slots:{default:!0}}),a(h,d)},$$slots:{default:!0}});var Z=t(x,2);o(Z,{title:"Intel XPU",local:"xpu",headingTag:"h2"});var N=t(Z,4);o(N,{title:"Installation via PyPI",local:"xpu-pip",headingTag:"h3"});var W=t(N,12);s(W,{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",lang:"bash",wrap:!1});var k=t(W,2);o(k,{title:"Intel Gaudi",local:"gaudi",headingTag:"h2"});var B=t(k,4);o(B,{title:"Installation from PyPI",local:"gaudi-pip",headingTag:"h3"});var X=t(B,4);s(X,{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",lang:"bash",wrap:!1});var A=t(X,2);o(A,{title:"CPU",local:"cpu",headingTag:"h2"});var S=t(A,2);o(S,{title:"Installation from PyPI",local:"cpu-pip",headingTag:"h3"});var _=t(S,12);s(_,{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",lang:"bash",wrap:!1});var Y=t(_,2);o(Y,{title:"Compile from Source",local:"cpu-compile",headingTag:"h3"});var V=t(Y,4);j(V,{id:"cpu-source",options:["Linux / macOS","Windows (x86-64)","Windows (ARM64)"],children:(h,g)=>{var d=Mt(),r=i(d);p(r,{id:"cpu-source",option:"Linux / macOS",children:(c,e)=>{s(c,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
pip install -e .`,lang:"bash",wrap:!1})},$$slots:{default:!0}});var u=t(r,2);p(u,{id:"cpu-source",option:"Windows (x86-64)",children:(c,e)=>{var l=yt(),f=t(i(l),2);s(f,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
pip install -e .`,lang:"bash",wrap:!1}),a(c,l)},$$slots:{default:!0}});var n=t(u,2);p(n,{id:"cpu-source",option:"Windows (ARM64)",children:(c,e)=>{var l=gt(),f=t(i(l),2);s(f,{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtZSUyMC4=",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
pip install -e .`,lang:"bash",wrap:!1}),v(2),a(c,l)},$$slots:{default:!0}}),a(h,d)},$$slots:{default:!0}});var L=t(V,2);o(L,{title:"AMD ROCm (Preview)",local:"rocm",headingTag:"h2"});var P=t(L,4);o(P,{title:"Installation from PyPI",local:"rocm-pip",headingTag:"h3"});var z=t(P,10);s(z,{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",lang:"bash",wrap:!1});var Q=t(z,2);o(Q,{title:"Compile from Source",local:"rocm-compile",headingTag:"h3"});var F=t(Q,4);j(F,{id:"rocm-source",options:["Linux","Windows"],children:(h,g)=>{var d=E(),r=i(d);p(r,{id:"rocm-source",option:"Linux",children:(n,c)=>{var e=wt(),l=t(i(e),4);s(l,{code:"JTIzJTIwSW5zdGFsbCUyMGJpdHNhbmRieXRlcyUyMGZyb20lMjBzb3VyY2UlMEElMEElMjMlMjBDbG9uZSUyMGJpdHNhbmRieXRlcyUyMHJlcG8lMEFnaXQlMjBjbG9uZSUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmJpdHNhbmRieXRlcy1mb3VuZGF0aW9uJTJGYml0c2FuZGJ5dGVzLmdpdCUyMCUyNiUyNiUyMGNkJTIwYml0c2FuZGJ5dGVzJTJGJTBBJTBBJTIzJTIwQ29tcGlsZSUyMCUyNiUyMGluc3RhbGwlMEFhcHQtZ2V0JTIwaW5zdGFsbCUyMC15JTIwYnVpbGQtZXNzZW50aWFsJTIwY21ha2UlMjAlMjAlMjMlMjBpbnN0YWxsJTIwYnVpbGQlMjB0b29scyUyMGRlcGVuZGVuY2llcyUyQyUyMHVubGVzcyUyMHByZXNlbnQlMEFjbWFrZSUyMC1EQ09NUFVURV9CQUNLRU5EJTNEaGlwJTIwLVMlMjAuJTIwJTIwJTIzJTIwVXNlJTIwLURCTkJfUk9DTV9BUkNIJTNEJTIyZ2Z4OTBhJTNCZ2Z4OTQyJTIyJTIwdG8lMjB0YXJnZXQlMjBzcGVjaWZpYyUyMGdwdSUyMGFyY2glMEFtYWtlJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLiUyMCUyMCUyMCUyMyUyMCU2MC1lJTYwJTIwZm9yJTIwJTIyZWRpdGFibGUlMjIlMjBpbnN0YWxsJTJDJTIwd2hlbiUyMGRldmVsb3BpbmclMjBCTkIlMjAob3RoZXJ3aXNlJTIwbGVhdmUlMjB0aGF0JTIwb3V0KQ==",highlighted:`<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 &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
<span class="hljs-comment"># Compile &amp; 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=&quot;gfx90a;gfx942&quot; to target specific gpu arch</span>
make
pip install -e . <span class="hljs-comment"># \`-e\` for &quot;editable&quot; install, when developing BNB (otherwise leave that out)</span>`,lang:"bash",wrap:!1}),a(n,e)},$$slots:{default:!0}});var u=t(r,2);p(u,{id:"rocm-source",option:"Windows",children:(n,c)=>{var e=ft(),l=t(i(e),4);s(l,{code:"JTIzJTIwSW5zdGFsbCUyMFJPQ20lMjBTREslMjB3aGVlbHMlMjAoYWRqdXN0JTIwdmVyc2lvbiUyMGFzJTIwbmVlZGVkKSUwQXBpcCUyMGluc3RhbGwlMjBuaW5qYSUyMGNtYWtlJTBBcGlwJTIwaW5zdGFsbCUyMCU1QyUwQSUyMCUyMCUyMCUyMGh0dHBzJTNBJTJGJTJGcmVwby5yYWRlb24uY29tJTJGcm9jbSUyRndpbmRvd3MlMkZyb2NtLXJlbC03LjIuMSUyRnJvY21fc2RrX2NvcmUtNy4yLjEtcHkzLW5vbmUtd2luX2FtZDY0LndobCUyMCU1QyUwQSUyMCUyMCUyMCUyMGh0dHBzJTNBJTJGJTJGcmVwby5yYWRlb24uY29tJTJGcm9jbSUyRndpbmRvd3MlMkZyb2NtLXJlbC03LjIuMSUyRnJvY21fc2RrX2RldmVsLTcuMi4xLXB5My1ub25lLXdpbl9hbWQ2NC53aGwlMjAlNUMlMEElMjAlMjAlMjAlMjBodHRwcyUzQSUyRiUyRnJlcG8ucmFkZW9uLmNvbSUyRnJvY20lMkZ3aW5kb3dzJTJGcm9jbS1yZWwtNy4yLjElMkZyb2NtX3Nka19saWJyYXJpZXNfY3VzdG9tLTcuMi4xLXB5My1ub25lLXdpbl9hbWQ2NC53aGwlMjAlNUMlMEElMjAlMjAlMjAlMjBodHRwcyUzQSUyRiUyRnJlcG8ucmFkZW9uLmNvbSUyRnJvY20lMkZ3aW5kb3dzJTJGcm9jbS1yZWwtNy4yLjElMkZyb2NtLTcuMi4xLnRhci5neiUwQSUwQSUyMyUyMEV4cGFuZCUyMHRoZSUyMGRldmVsJTIwdGFyYmFsbCUwQXJvY20tc2RrJTIwaW5pdCUwQSUwQSUyMyUyMFNldCUyMFJPQ01fUEFUSCUyMGFuZCUyMGFjdGl2YXRlJTIwVmlzdWFsJTIwU3R1ZGlvJTIwZW52aXJvbm1lbnQlMkMlMjB0aGVuJTIwYnVpbGQlMEFleHBvcnQlMjBST0NNX1BBVEglM0QlMjIlMjQocm9jbS1zZGslMjBwYXRoJTIwLS1yb290KSUyMiUwQWV4cG9ydCUyMFBBVEglM0QlMjIlMjQlN0JST0NNX1BBVEglN0QlMkZiaW4lM0ElMjQlN0JQQVRIJTdEJTIyJTBBZ2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQWNtYWtlJTIwLUclMjBOaW5qYSUyMC1EQ09NUFVURV9CQUNLRU5EJTNEaGlwJTIwLURCTkJfUk9DTV9BUkNIJTNEJTIyZ2Z4MTEwMCUyMiUyMC1EQ01BS0VfQlVJTERfVFlQRSUzRFJlbGVhc2UlMjAtUyUyMC4lMEFjbWFrZSUyMC0tYnVpbGQlMjAuJTIwLS1jb25maWclMjBSZWxlYXNlJTBBcGlwJTIwaW5zdGFsbCUyMC4=",highlighted:`<span class="hljs-comment"># Install ROCm SDK wheels (adjust version as needed)</span>
pip install ninja cmake
pip install \\
https://repo.radeon.com/rocm/windows/rocm-rel-7.2.1/rocm_sdk_core-7.2.1-py3-none-win_amd64.whl \\
https://repo.radeon.com/rocm/windows/rocm-rel-7.2.1/rocm_sdk_devel-7.2.1-py3-none-win_amd64.whl \\
https://repo.radeon.com/rocm/windows/rocm-rel-7.2.1/rocm_sdk_libraries_custom-7.2.1-py3-none-win_amd64.whl \\
https://repo.radeon.com/rocm/windows/rocm-rel-7.2.1/rocm-7.2.1.tar.gz
<span class="hljs-comment"># Expand the devel tarball</span>
rocm-sdk init
<span class="hljs-comment"># Set ROCM_PATH and activate Visual Studio environment, then build</span>
<span class="hljs-built_in">export</span> ROCM_PATH=<span class="hljs-string">&quot;<span class="hljs-subst">$(rocm-sdk path --root)</span>&quot;</span>
<span class="hljs-built_in">export</span> PATH=<span class="hljs-string">&quot;<span class="hljs-variable">\${ROCM_PATH}</span>/bin:<span class="hljs-variable">\${PATH}</span>&quot;</span>
git <span class="hljs-built_in">clone</span> https://github.com/bitsandbytes-foundation/bitsandbytes.git &amp;&amp; <span class="hljs-built_in">cd</span> bitsandbytes/
cmake -G Ninja -DCOMPUTE_BACKEND=hip -DBNB_ROCM_ARCH=<span class="hljs-string">&quot;gfx1100&quot;</span> -DCMAKE_BUILD_TYPE=Release -S .
cmake --build . --config Release
pip install .`,lang:"bash",wrap:!1}),a(n,e)},$$slots:{default:!0}}),a(h,d)},$$slots:{default:!0}});var H=t(F,2);o(H,{title:"Preview Wheels",local:"preview-wheels",headingTag:"h2"});var D=t(H,4);j(D,{id:"OS",options:["Linux","Windows (x86-64)","Windows (ARM64)","macOS"],children:(h,g)=>{var d=Ut(),r=i(d);p(r,{id:"OS",option:"Linux",children:(e,l)=>{s(e,{code:"JTIzJTIwTm90ZSUzQSUyMGlmJTIweW91JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjByZWluc3RhbGwlMjBvdXIlMjBkZXBlbmRlbmNpZXMlMkMlMjBhcHBlbmQlMjB0aGUlMjAlNjAtLW5vLWRlcHMlNjAlMjBmbGFnISUwQSUwQSUyMyUyMHg4Nl82NCUyMChtb3N0JTIwdXNlcnMpJTBBcGlwJTIwaW5zdGFsbCUyMC0tZm9yY2UtcmVpbnN0YWxsJTIwaHR0cHMlM0ElMkYlMkZnaXRodWIuY29tJTJGYml0c2FuZGJ5dGVzLWZvdW5kYXRpb24lMkZiaXRzYW5kYnl0ZXMlMkZyZWxlYXNlcyUyRmRvd25sb2FkJTJGY29udGludW91cy1yZWxlYXNlX21haW4lMkZiaXRzYW5kYnl0ZXMtMS4zMy43LnByZXZpZXctcHkzLW5vbmUtbWFueWxpbnV4XzJfMjRfeDg2XzY0LndobCUwQSUwQSUyMyUyMEFSTSUyRmFhcmNoNjQlMEFwaXAlMjBpbnN0YWxsJTIwLS1mb3JjZS1yZWluc3RhbGwlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZiaXRzYW5kYnl0ZXMtZm91bmRhdGlvbiUyRmJpdHNhbmRieXRlcyUyRnJlbGVhc2VzJTJGZG93bmxvYWQlMkZjb250aW51b3VzLXJlbGVhc2VfbWFpbiUyRmJpdHNhbmRieXRlcy0xLjMzLjcucHJldmlldy1weTMtbm9uZS1tYW55bGludXhfMl8yNF9hYXJjaDY0LndobA==",highlighted:`<span class="hljs-comment"># Note: if you don&#x27;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`,lang:"bash",wrap:!1})},$$slots:{default:!0}});var u=t(r,2);p(u,{id:"OS",option:"Windows (x86-64)",children:(e,l)=>{s(e,{code:"JTIzJTIwTm90ZSUzQSUyMGlmJTIweW91JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjByZWluc3RhbGwlMjBvdXIlMjBkZXBlbmRlbmNpZXMlMkMlMjBhcHBlbmQlMjB0aGUlMjAlNjAtLW5vLWRlcHMlNjAlMjBmbGFnISUwQXBpcCUyMGluc3RhbGwlMjAtLWZvcmNlLXJlaW5zdGFsbCUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmJpdHNhbmRieXRlcy1mb3VuZGF0aW9uJTJGYml0c2FuZGJ5dGVzJTJGcmVsZWFzZXMlMkZkb3dubG9hZCUyRmNvbnRpbnVvdXMtcmVsZWFzZV9tYWluJTJGYml0c2FuZGJ5dGVzLTEuMzMuNy5wcmV2aWV3LXB5My1ub25lLXdpbl9hbWQ2NC53aGw=",highlighted:'<span class="hljs-comment"># Note: if you don&#x27;t want to reinstall our dependencies, append the `--no-deps` flag!</span>\npip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-win_amd64.whl',lang:"bash",wrap:!1})},$$slots:{default:!0}});var n=t(u,2);p(n,{id:"OS",option:"Windows (ARM64)",children:(e,l)=>{s(e,{code:"JTIzJTIwTm90ZSUzQSUyMGlmJTIweW91JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjByZWluc3RhbGwlMjBvdXIlMjBkZXBlbmRlbmNpZXMlMkMlMjBhcHBlbmQlMjB0aGUlMjAlNjAtLW5vLWRlcHMlNjAlMjBmbGFnISUwQSUyMyUyMFJlcXVpcmVzJTIwUHl0aG9uJTIwJTNFJTNEJTIwMy4xMiUwQXBpcCUyMGluc3RhbGwlMjAtLWZvcmNlLXJlaW5zdGFsbCUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmJpdHNhbmRieXRlcy1mb3VuZGF0aW9uJTJGYml0c2FuZGJ5dGVzJTJGcmVsZWFzZXMlMkZkb3dubG9hZCUyRmNvbnRpbnVvdXMtcmVsZWFzZV9tYWluJTJGYml0c2FuZGJ5dGVzLTEuMzMuNy5wcmV2aWV3LXB5My1ub25lLXdpbl9hcm02NC53aGw=",highlighted:'<span class="hljs-comment"># Note: if you don&#x27;t want to reinstall our dependencies, append the `--no-deps` flag!</span>\n<span class="hljs-comment"># Requires Python &gt;= 3.12</span>\npip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-win_arm64.whl',lang:"bash",wrap:!1})},$$slots:{default:!0}});var c=t(n,2);p(c,{id:"OS",option:"macOS",children:(e,l)=>{s(e,{code:"JTIzJTIwTm90ZSUzQSUyMGlmJTIweW91JTIwZG9uJ3QlMjB3YW50JTIwdG8lMjByZWluc3RhbGwlMjBvdXIlMjBkZXBlbmRlbmNpZXMlMkMlMjBhcHBlbmQlMjB0aGUlMjAlNjAtLW5vLWRlcHMlNjAlMjBmbGFnISUwQXBpcCUyMGluc3RhbGwlMjAtLWZvcmNlLXJlaW5zdGFsbCUyMGh0dHBzJTNBJTJGJTJGZ2l0aHViLmNvbSUyRmJpdHNhbmRieXRlcy1mb3VuZGF0aW9uJTJGYml0c2FuZGJ5dGVzJTJGcmVsZWFzZXMlMkZkb3dubG9hZCUyRmNvbnRpbnVvdXMtcmVsZWFzZV9tYWluJTJGYml0c2FuZGJ5dGVzLTEuMzMuNy5wcmV2aWV3LXB5My1ub25lLW1hY29zeF8xNF8wX2FybTY0LndobA==",highlighted:'<span class="hljs-comment"># Note: if you don&#x27;t want to reinstall our dependencies, append the `--no-deps` flag!</span>\npip install --force-reinstall https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/bitsandbytes-1.33.7.preview-py3-none-macosx_14_0_arm64.whl',lang:"bash",wrap:!1})},$$slots:{default:!0}}),a(h,d)},$$slots:{default:!0}});var K=t(D,2);st(K,{source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/installation.mdx"}),v(2),a(I,U),q()}export{vt as component};

Xet Storage Details

Size:
32.6 kB
·
Xet hash:
24d69fc3022b7fc3a4af3b99c3124a7107ef88671abe32cdc80913b802990360

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.