Buckets:
| import{s as St,c as ce,u as de,g as he,d as Me,e as $e,f as Dt,o as ye,n as V}from"../chunks/scheduler.852ec091.js";import{S as Ht,i as Zt,g as w,s as h,h as C,j as Mt,f as s,c as M,k as Y,a as r,d as _,t as v,z as be,m as Ue,n as we,y as Pt,B as Ce,o as Te,e as oe,p as ge,b as _e,r as R,A as ve,u as j,x as T,v as x,w as k}from"../chunks/index.28275fd3.js";import{T as ht}from"../chunks/Tip.9f398c59.js";import{C as N}from"../chunks/CodeBlock.c3366071.js";import{H as ft,E as Je}from"../chunks/EditOnGithub.582011f0.js";import{e as re}from"../chunks/each.e59479a4.js";import{w as Re}from"../chunks/index.268e315a.js";const dt=Re({});function je(d,e){const p=new URL(window.location.href),l=new URLSearchParams(p.search);l.set(d,e),p.search=l.toString(),history.replaceState(null,"",p.toString())}function xe(d){const e=new URL(window.location.href);return new URLSearchParams(e.search).get(d)}function pe(d,e,p){const l=d.slice();return l[7]=e[p],l}function fe(d){let e,p=d[7]+"",l,i,f,u,n;function o(){return d[6](d[7])}return{c(){e=w("div"),l=Ue(p),i=h(),this.h()},l(a){e=C(a,"DIV",{class:!0});var c=Mt(e);l=we(c,p),i=M(c),c.forEach(s),this.h()},h(){Y(e,"class",f="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd "+(d[2][d[0]]===d[7]?"border-gray-800 bg-black dark:bg-gray-700 text-white":"text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm"))},m(a,c){r(a,e,c),Pt(e,l),Pt(e,i),u||(n=Ce(e,"click",o),u=!0)},p(a,c){d=a,c&2&&p!==(p=d[7]+"")&&Te(l,p),c&7&&f!==(f="flex items-center border rounded-lg px-1.5 py-1 leading-none select-none text-smd "+(d[2][d[0]]===d[7]?"border-gray-800 bg-black dark:bg-gray-700 text-white":"text-gray-500 cursor-pointer opacity-90 hover:text-gray-700 dark:hover:text-gray-200 hover:shadow-sm"))&&Y(e,"class",f)},d(a){a&&s(e),u=!1,n()}}}function ke(d){let e,p,l,i,f=re(d[1]),u=[];for(let a=0;a<f.length;a+=1)u[a]=fe(pe(d,f,a));const n=d[5].default,o=ce(n,d,d[4],null);return{c(){e=w("div");for(let a=0;a<u.length;a+=1)u[a].c();p=h(),l=w("div"),o&&o.c(),this.h()},l(a){e=C(a,"DIV",{class:!0});var c=Mt(e);for(let g=0;g<u.length;g+=1)u[g].l(c);c.forEach(s),p=M(a),l=C(a,"DIV",{class:!0});var b=Mt(l);o&&o.l(b),b.forEach(s),this.h()},h(){Y(e,"class","flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"),Y(l,"class","language-select")},m(a,c){r(a,e,c);for(let b=0;b<u.length;b+=1)u[b]&&u[b].m(e,null);r(a,p,c),r(a,l,c),o&&o.m(l,null),i=!0},p(a,[c]){if(c&15){f=re(a[1]);let b;for(b=0;b<f.length;b+=1){const g=pe(a,f,b);u[b]?u[b].p(g,c):(u[b]=fe(g),u[b].c(),u[b].m(e,null))}for(;b<u.length;b+=1)u[b].d(1);u.length=f.length}o&&o.p&&(!i||c&16)&&de(o,n,a,a[4],i?Me(n,a[4],c,null):he(a[4]),null)},i(a){i||(_(o,a),i=!0)},o(a){v(o,a),i=!1},d(a){a&&(s(e),s(p),s(l)),be(u,a),o&&o.d(a)}}}function Ie(d,e,p){let l;$e(d,dt,c=>p(2,l=c));let{$$slots:i={},$$scope:f}=e,{id:u}=e,{options:n}=e;Dt(dt,l[u]=n[0],l);function o(c){Dt(dt,l[u]=c,l),je(u,c)}ye(()=>{const c=xe(u);c&&n.includes(c)&&Dt(dt,l[u]=c,l)});const a=c=>o(c);return d.$$set=c=>{"id"in c&&p(0,u=c.id),"options"in c&&p(1,n=c.options),"$$scope"in c&&p(4,f=c.$$scope)},[u,n,l,o,f,i,a]}class me extends Ht{constructor(e){super(),Zt(this,e,Ie,ke,St,{id:0,options:1})}}function ue(d){let e;const p=d[4].default,l=ce(p,d,d[3],null);return{c(){l&&l.c()},l(i){l&&l.l(i)},m(i,f){l&&l.m(i,f),e=!0},p(i,f){l&&l.p&&(!e||f&8)&&de(l,p,i,i[3],e?Me(p,i[3],f,null):he(i[3]),null)},i(i){e||(_(l,i),e=!0)},o(i){v(l,i),e=!1},d(i){l&&l.d(i)}}}function Be(d){let e,p,l=d[2][d[0]]===d[1]&&ue(d);return{c(){l&&l.c(),e=oe()},l(i){l&&l.l(i),e=oe()},m(i,f){l&&l.m(i,f),r(i,e,f),p=!0},p(i,[f]){i[2][i[0]]===i[1]?l?(l.p(i,f),f&7&&_(l,1)):(l=ue(i),l.c(),_(l,1),l.m(e.parentNode,e)):l&&(ge(),v(l,1,1,()=>{l=null}),_e())},i(i){p||(_(l),p=!0)},o(i){v(l),p=!1},d(i){i&&s(e),l&&l.d(i)}}}function Ge(d,e,p){let l;$e(d,dt,o=>p(2,l=o));let{$$slots:i={},$$scope:f}=e,{id:u}=e,{option:n}=e;return d.$$set=o=>{"id"in o&&p(0,u=o.id),"option"in o&&p(1,n=o.option),"$$scope"in o&&p(3,f=o.$$scope)},[u,n,l,f,i]}class mt extends Ht{constructor(e){super(),Zt(this,e,Ge,Be,St,{id:0,option:1})}}function Ae(d){let e,p='MacOS support is still a work in progress! Subscribe to this <a href="https://github.com/TimDettmers/bitsandbytes/issues/1020" rel="nofollow">issue</a> to get notified about discussions and to track the integration progress.';return{c(){e=w("p"),e.innerHTML=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-9rmqp2"&&(e.innerHTML=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Ee(d){let e,p="bitsandbytes >= 0.39.1 no longer includes Kepler binaries in pip installations. This requires manual compilation, and you should follow the general steps and use <code>cuda11x_nomatmul_kepler</code> for Kepler-targeted compilation.";return{c(){e=w("p"),e.innerHTML=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-13h63kz"&&(e.innerHTML=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Ne(d){let e,p="If you have multiple versions of CUDA installed or installed it in a non-standard location, please refer to CMake CUDA documentation for how to configure the CUDA compiler.";return{c(){e=w("p"),e.textContent=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-raeog1"&&(e.textContent=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Ve(d){let e,p="To compile from source, you need CMake >= <strong>3.22.1</strong> and Python >= <strong>3.8</strong> installed. Make sure you have a compiler installed to compile C++ (gcc, make, headers, etc.). For example, to install a compiler and CMake on Ubuntu:",l,i,f,u,n='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 from NVIDIA. The current expected CUDA Toolkit version is <strong>11.1+</strong> and it is recommended to install <strong>GCC >= 7.3</strong> and required to have at least <strong>GCC >= 6</strong>.',o,a,c="Refer to the following table if you’re using another CUDA Toolkit version.",b,g,G="<thead><tr><th>CUDA Toolkit</th> <th>GCC</th></tr></thead> <tbody><tr><td>>= 11.4.1</td> <td>>= 11</td></tr> <tr><td>>= 12.0</td> <td>>= 12</td></tr> <tr><td>>= 12.4</td> <td>>= 13</td></tr></tbody>",U,J,W="Now to install the bitsandbytes package from source, run the following commands:",E,y,B,A,X;return i=new N({props:{code:"YXB0LWdldCUyMGluc3RhbGwlMjAteSUyMGJ1aWxkLWVzc2VudGlhbCUyMGNtYWtl",highlighted:"apt-get install -y build-essential cmake",wrap:!1}}),y=new N({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZUaW1EZXR0bWVycyUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtciUyMHJlcXVpcmVtZW50cy1kZXYudHh0JTBBY21ha2UlMjAtRENPTVBVVEVfQkFDS0VORCUzRGN1ZGElMjAtUyUyMC4lMEFtYWtlJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLiUyMCUyMCUyMCUyMyUyMCU2MC1lJTYwJTIwZm9yJTIwJTIyZWRpdGFibGUlMjIlMjBpbnN0YWxsJTJDJTIwd2hlbiUyMGRldmVsb3BpbmclMjBCTkIlMjAob3RoZXJ3aXNlJTIwbGVhdmUlMjB0aGF0JTIwb3V0KQ==",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/TimDettmers/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| pip install -r requirements-dev.txt | |
| 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>`,wrap:!1}}),A=new ht({props:{warning:!1,$$slots:{default:[Ne]},$$scope:{ctx:d}}}),{c(){e=w("p"),e.innerHTML=p,l=h(),R(i.$$.fragment),f=h(),u=w("p"),u.innerHTML=n,o=h(),a=w("p"),a.textContent=c,b=h(),g=w("table"),g.innerHTML=G,U=h(),J=w("p"),J.textContent=W,E=h(),R(y.$$.fragment),B=h(),R(A.$$.fragment)},l($){e=C($,"P",{"data-svelte-h":!0}),T(e)!=="svelte-29yf67"&&(e.innerHTML=p),l=M($),j(i.$$.fragment,$),f=M($),u=C($,"P",{"data-svelte-h":!0}),T(u)!=="svelte-gmjw5q"&&(u.innerHTML=n),o=M($),a=C($,"P",{"data-svelte-h":!0}),T(a)!=="svelte-1agbdv5"&&(a.textContent=c),b=M($),g=C($,"TABLE",{"data-svelte-h":!0}),T(g)!=="svelte-1nj1xe4"&&(g.innerHTML=G),U=M($),J=C($,"P",{"data-svelte-h":!0}),T(J)!=="svelte-1fitvy1"&&(J.textContent=W),E=M($),j(y.$$.fragment,$),B=M($),j(A.$$.fragment,$)},m($,I){r($,e,I),r($,l,I),x(i,$,I),r($,f,I),r($,u,I),r($,o,I),r($,a,I),r($,b,I),r($,g,I),r($,U,I),r($,J,I),r($,E,I),x(y,$,I),r($,B,I),x(A,$,I),X=!0},p($,I){const ut={};I&2&&(ut.$$scope={dirty:I,ctx:$}),A.$set(ut)},i($){X||(_(i.$$.fragment,$),_(y.$$.fragment,$),_(A.$$.fragment,$),X=!0)},o($){v(i.$$.fragment,$),v(y.$$.fragment,$),v(A.$$.fragment,$),X=!1},d($){$&&(s(e),s(l),s(f),s(u),s(o),s(a),s(b),s(g),s(U),s(J),s(E),s(B)),k(i,$),k(y,$),k(A,$)}}}function We(d){let e,p="Windows systems require Visual Studio with C++ support as well as an installation of the CUDA SDK.",l,i,f='To compile from source, you need CMake >= <strong>3.22.1</strong> and Python >= <strong>3.8</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.',u,n,o="Refer to the following table if you’re using another CUDA Toolkit version.",a,c,b="<thead><tr><th>CUDA Toolkit</th> <th>MSVC</th></tr></thead> <tbody><tr><td>>= 11.6</td> <td>19.30+ (VS2022)</td></tr></tbody>",g,G,U,J,W='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.',E;return G=new N({props:{code:"Z2l0JTIwY2xvbmUlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZUaW1EZXR0bWVycyUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtciUyMHJlcXVpcmVtZW50cy1kZXYudHh0JTBBY21ha2UlMjAtRENPTVBVVEVfQkFDS0VORCUzRGN1ZGElMjAtUyUyMC4lMEFjbWFrZSUyMC0tYnVpbGQlMjAuJTIwLS1jb25maWclMjBSZWxlYXNlJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLiUyMCUyMCUyMCUyMyUyMCU2MC1lJTYwJTIwZm9yJTIwJTIyZWRpdGFibGUlMjIlMjBpbnN0YWxsJTJDJTIwd2hlbiUyMGRldmVsb3BpbmclMjBCTkIlMjAob3RoZXJ3aXNlJTIwbGVhdmUlMjB0aGF0JTIwb3V0KQ==",highlighted:`git <span class="hljs-built_in">clone</span> https://github.com/TimDettmers/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| pip install -r requirements-dev.txt | |
| cmake -DCOMPUTE_BACKEND=cuda -S . | |
| cmake --build . --config Release | |
| pip install -e . <span class="hljs-comment"># \`-e\` for "editable" install, when developing BNB (otherwise leave that out)</span>`,wrap:!1}}),{c(){e=w("p"),e.textContent=p,l=h(),i=w("p"),i.innerHTML=f,u=h(),n=w("p"),n.textContent=o,a=h(),c=w("table"),c.innerHTML=b,g=h(),R(G.$$.fragment),U=h(),J=w("p"),J.innerHTML=W},l(y){e=C(y,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1ngyk0s"&&(e.textContent=p),l=M(y),i=C(y,"P",{"data-svelte-h":!0}),T(i)!=="svelte-9zb6iz"&&(i.innerHTML=f),u=M(y),n=C(y,"P",{"data-svelte-h":!0}),T(n)!=="svelte-1agbdv5"&&(n.textContent=o),a=M(y),c=C(y,"TABLE",{"data-svelte-h":!0}),T(c)!=="svelte-1nj7txn"&&(c.innerHTML=b),g=M(y),j(G.$$.fragment,y),U=M(y),J=C(y,"P",{"data-svelte-h":!0}),T(J)!=="svelte-e0ivb"&&(J.innerHTML=W)},m(y,B){r(y,e,B),r(y,l,B),r(y,i,B),r(y,u,B),r(y,n,B),r(y,a,B),r(y,c,B),r(y,g,B),x(G,y,B),r(y,U,B),r(y,J,B),E=!0},p:V,i(y){E||(_(G.$$.fragment,y),E=!0)},o(y){v(G.$$.fragment,y),E=!1},d(y){y&&(s(e),s(l),s(i),s(u),s(n),s(a),s(c),s(g),s(U),s(J)),k(G,y)}}}function Le(d){let e,p="Windows systems require Visual Studio with C++ support.",l,i,f="To compile from source, you need CMake >= <strong>3.22.1</strong> and Python >= <strong>3.8</strong> installed.",u,n,o;return n=new N({props:{code:"Z2l0JTIwY2xvbmUlMjAtLWJyYW5jaCUyMG11bHRpLWJhY2tlbmQtcmVmYWN0b3IlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZUaW1EZXR0bWVycyUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjAtciUyMHJlcXVpcmVtZW50cy1kZXYudHh0JTBBY21ha2UlMjAtRENPTVBVVEVfQkFDS0VORCUzRGNwdSUyMC1TJTIwLiUwQWNtYWtlJTIwLS1idWlsZCUyMC4lMjAtLWNvbmZpZyUyMFJlbGVhc2UlMEFwaXAlMjBpbnN0YWxsJTIwLg==",highlighted:`git <span class="hljs-built_in">clone</span> --branch multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| pip install -r requirements-dev.txt | |
| cmake -DCOMPUTE_BACKEND=cpu -S . | |
| cmake --build . --config Release | |
| pip install .`,wrap:!1}}),{c(){e=w("p"),e.textContent=p,l=h(),i=w("p"),i.innerHTML=f,u=h(),R(n.$$.fragment)},l(a){e=C(a,"P",{"data-svelte-h":!0}),T(e)!=="svelte-7wy2zc"&&(e.textContent=p),l=M(a),i=C(a,"P",{"data-svelte-h":!0}),T(i)!=="svelte-4f6u0t"&&(i.innerHTML=f),u=M(a),j(n.$$.fragment,a)},m(a,c){r(a,e,c),r(a,l,c),r(a,i,c),r(a,u,c),x(n,a,c),o=!0},p:V,i(a){o||(_(n.$$.fragment,a),o=!0)},o(a){v(n.$$.fragment,a),o=!1},d(a){a&&(s(e),s(l),s(i),s(u)),k(n,a)}}}function De(d){let e,p,l,i,f,u;return e=new mt({props:{id:"source",option:"Linux",$$slots:{default:[Ve]},$$scope:{ctx:d}}}),l=new mt({props:{id:"source",option:"Windows",$$slots:{default:[We]},$$scope:{ctx:d}}}),f=new mt({props:{id:"source",option:"Windows",$$slots:{default:[Le]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),p=h(),R(l.$$.fragment),i=h(),R(f.$$.fragment)},l(n){j(e.$$.fragment,n),p=M(n),j(l.$$.fragment,n),i=M(n),j(f.$$.fragment,n)},m(n,o){x(e,n,o),r(n,p,o),x(l,n,o),r(n,i,o),x(f,n,o),u=!0},p(n,o){const a={};o&2&&(a.$$scope={dirty:o,ctx:n}),e.$set(a);const c={};o&2&&(c.$$scope={dirty:o,ctx:n}),l.$set(c);const b={};o&2&&(b.$$scope={dirty:o,ctx:n}),f.$set(b)},i(n){u||(_(e.$$.fragment,n),_(l.$$.fragment,n),_(f.$$.fragment,n),u=!0)},o(n){v(e.$$.fragment,n),v(l.$$.fragment,n),v(f.$$.fragment,n),u=!1},d(n){n&&(s(p),s(i)),k(e,n),k(l,n),k(f,n)}}}function Pe(d){let e,p="It is recommended to add the following lines to the <code>.bashrc</code> file to make them permanent.";return{c(){e=w("p"),e.innerHTML=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-143buxs"&&(e.innerHTML=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Se(d){let e,p,l,i="For a ROCm specific install:",f,u,n="bitsandbytes is fully supported from ROCm 6.1.",o,a,c='<strong>Note:</strong> If you already installed ROCm and PyTorch, skip docker steps below and please check that the torch version matches your ROCm install. To install torch for a specific ROCm version, please refer to step 3 of wheels install in <a href="https://rocm.docs.amd.com/projects/install-on-linux/en/latest/how-to/3rd-party/pytorch-install.html#using-wheels-package" rel="nofollow">Installing PyTorch for ROCm</a> guide.',b,g,G;return e=new ft({props:{title:"AMD GPU",local:"amd-gpu",headingTag:"h3"}}),g=new N({props:{code:"JTIzJTIwQ3JlYXRlJTIwYSUyMGRvY2tlciUyMGNvbnRhaW5lciUyMHdpdGglMjBsYXRlc3QlMjBweXRvcmNoLiUyMEl0JTIwY29tZXMlMjB3aXRoJTIwUk9DbSUyMGFuZCUyMHB5dG9yY2glMjBwcmVpbnN0YWxsZWQlMEFkb2NrZXIlMjBwdWxsJTIwcm9jbSUyRnB5dG9yY2glM0FsYXRlc3QlMEFkb2NrZXIlMjBydW4lMjAtaXQlMjAtLWRldmljZSUzRCUyRmRldiUyRmtmZCUyMC0tZGV2aWNlJTNEJTJGZGV2JTJGZHJpJTIwLS1ncm91cC1hZGQlMjB2aWRlbyUyMHJvY20lMkZweXRvcmNoJTNBbGF0ZXN0JTBBJTBBJTIzJTIwQ2xvbmUlMjBiaXRzYW5kYnl0ZXMlMjByZXBvJTJDJTIwUk9DbSUyMGJhY2tlbmQlMjBpcyUyMGN1cnJlbnRseSUyMGVuYWJsZWQlMjBvbiUyMG11bHRpLWJhY2tlbmQtcmVmYWN0b3IlMjBicmFuY2glMEFnaXQlMjBjbG9uZSUyMC0tZGVwdGglMjAxJTIwLWIlMjBtdWx0aS1iYWNrZW5kLXJlZmFjdG9yJTIwaHR0cHMlM0ElMkYlMkZnaXRodWIuY29tJTJGVGltRGV0dG1lcnMlMkZiaXRzYW5kYnl0ZXMuZ2l0JTIwJTI2JTI2JTIwY2QlMjBiaXRzYW5kYnl0ZXMlMkYlMEElMEElMjMlMjBJbnN0YWxsJTIwZGVwZW5kZW5jaWVzJTBBcGlwJTIwaW5zdGFsbCUyMC1yJTIwcmVxdWlyZW1lbnRzLWRldi50eHQlMEElMEElMjMlMjBDb21waWxlJTIwJTI2JTIwaW5zdGFsbCUwQWNtYWtlJTIwLURDT01QVVRFX0JBQ0tFTkQlM0RoaXAlMjAtUyUyMC4lMjAlMjAlMjMlMjBVc2UlMjAtREJOQl9ST0NNX0FSQ0glM0QlMjJnZng5MGElM0JnZng5NDIlMjIlMjB0byUyMHRhcmdldCUyMHNwZWNpZmljJTIwZ3B1JTIwYXJjaCUwQW1ha2UlMEFwaXAlMjBpbnN0YWxsJTIwLWUlMjAuJTIwJTIwJTIwJTIzJTIwJTYwLWUlNjAlMjBmb3IlMjAlMjJlZGl0YWJsZSUyMiUyMGluc3RhbGwlMkMlMjB3aGVuJTIwZGV2ZWxvcGluZyUyMEJOQiUyMChvdGhlcndpc2UlMjBsZWF2ZSUyMHRoYXQlMjBvdXQp",highlighted:`<span class="hljs-comment"># Create a docker container with latest pytorch. It comes with ROCm and pytorch preinstalled</span> | |
| docker pull rocm/pytorch:latest | |
| docker run -it --device=/dev/kfd --device=/dev/dri --group-add video rocm/pytorch:latest | |
| <span class="hljs-comment"># Clone bitsandbytes repo, ROCm backend is currently enabled on multi-backend-refactor branch</span> | |
| git <span class="hljs-built_in">clone</span> --depth 1 -b multi-backend-refactor https://github.com/TimDettmers/bitsandbytes.git && <span class="hljs-built_in">cd</span> bitsandbytes/ | |
| <span class="hljs-comment"># Install dependencies</span> | |
| pip install -r requirements-dev.txt | |
| <span class="hljs-comment"># Compile & install</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>`,wrap:!1}}),{c(){R(e.$$.fragment),p=h(),l=w("p"),l.textContent=i,f=h(),u=w("p"),u.textContent=n,o=h(),a=w("p"),a.innerHTML=c,b=h(),R(g.$$.fragment)},l(U){j(e.$$.fragment,U),p=M(U),l=C(U,"P",{"data-svelte-h":!0}),T(l)!=="svelte-bu03d4"&&(l.textContent=i),f=M(U),u=C(U,"P",{"data-svelte-h":!0}),T(u)!=="svelte-u6kty4"&&(u.textContent=n),o=M(U),a=C(U,"P",{"data-svelte-h":!0}),T(a)!=="svelte-169gfnf"&&(a.innerHTML=c),b=M(U),j(g.$$.fragment,U)},m(U,J){x(e,U,J),r(U,p,J),r(U,l,J),r(U,f,J),r(U,u,J),r(U,o,J),r(U,a,J),r(U,b,J),x(g,U,J),G=!0},p:V,i(U){G||(_(e.$$.fragment,U),_(g.$$.fragment,U),G=!0)},o(U){v(e.$$.fragment,U),v(g.$$.fragment,U),G=!1},d(U){U&&(s(p),s(l),s(f),s(u),s(o),s(a),s(b)),k(e,U),k(g,U)}}}function He(d){let e,p="Intel CPU backend only supports building from source; for now, please follow the instructions below.";return{c(){e=w("p"),e.textContent=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-11im0db"&&(e.textContent=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Ze(d){let e,p,l,i,f,u="Like CUDA, you can compile bitsandbytes from source for Linux and Windows systems. Installing from source allows for more build options with different CMake configurations.",n;return e=new ft({props:{title:"Intel CPU",local:"intel-cpu",headingTag:"h3"}}),l=new ht({props:{warning:!1,$$slots:{default:[He]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),p=h(),R(l.$$.fragment),i=h(),f=w("p"),f.textContent=u},l(o){j(e.$$.fragment,o),p=M(o),j(l.$$.fragment,o),i=M(o),f=C(o,"P",{"data-svelte-h":!0}),T(f)!=="svelte-1e2wtrl"&&(f.textContent=u)},m(o,a){x(e,o,a),r(o,p,a),x(l,o,a),r(o,i,a),r(o,f,a),n=!0},p(o,a){const c={};a&2&&(c.$$scope={dirty:a,ctx:o}),l.$set(c)},i(o){n||(_(e.$$.fragment,o),_(l.$$.fragment,o),n=!0)},o(o){v(e.$$.fragment,o),v(l.$$.fragment,o),n=!1},d(o){o&&(s(p),s(i),s(f)),k(e,o),k(l,o)}}}function Ye(d){let e,p="WIP";return{c(){e=w("p"),e.textContent=p},l(l){e=C(l,"P",{"data-svelte-h":!0}),T(e)!=="svelte-1kg89us"&&(e.textContent=p)},m(l,i){r(l,e,i)},p:V,d(l){l&&s(e)}}}function Xe(d){let e,p,l,i,f,u;return e=new mt({props:{id:"backend",option:"AMD ROCm",$$slots:{default:[Se]},$$scope:{ctx:d}}}),l=new mt({props:{id:"backend",option:"Intel CPU + GPU",$$slots:{default:[Ze]},$$scope:{ctx:d}}}),f=new mt({props:{id:"backend",option:"Apple Silicon (MPS)",$$slots:{default:[Ye]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),p=h(),R(l.$$.fragment),i=h(),R(f.$$.fragment)},l(n){j(e.$$.fragment,n),p=M(n),j(l.$$.fragment,n),i=M(n),j(f.$$.fragment,n)},m(n,o){x(e,n,o),r(n,p,o),x(l,n,o),r(n,i,o),x(f,n,o),u=!0},p(n,o){const a={};o&2&&(a.$$scope={dirty:o,ctx:n}),e.$set(a);const c={};o&2&&(c.$$scope={dirty:o,ctx:n}),l.$set(c);const b={};o&2&&(b.$$scope={dirty:o,ctx:n}),f.$set(b)},i(n){u||(_(e.$$.fragment,n),_(l.$$.fragment,n),_(f.$$.fragment,n),u=!0)},o(n){v(e.$$.fragment,n),v(l.$$.fragment,n),v(f.$$.fragment,n),u=!1},d(n){n&&(s(p),s(i)),k(e,n),k(l,n),k(f,n)}}}function Qe(d){let e,p,l,i,f,u,n,o,a,c="bitsandbytes is only supported on CUDA GPUs for CUDA versions <strong>11.0 - 12.5</strong>. There’s a multi-backend effort under way which is currently in alpha release, see further down in this document.",b,g,G="The latest version of bitsandbytes builds on:",U,J,W="<thead><tr><th>OS</th> <th>CUDA</th> <th>Compiler</th></tr></thead> <tbody><tr><td>Linux</td> <td>11.7 - 12.3</td> <td>GCC 11.4</td></tr> <tr><td></td> <td>12.4+</td> <td>GCC 13.2</td></tr> <tr><td>Windows</td> <td>11.7 - 12.4</td> <td>MSVC 19.38+ (VS2022 17.8.0+)</td></tr></tbody>",E,y,B,A,X="For Linux systems, make sure your hardware meets the following requirements to use bitsandbytes features.",$,I,ut="<thead><tr><th><strong>Feature</strong></th> <th><strong>Hardware requirement</strong></th></tr></thead> <tbody><tr><td>LLM.int8()</td> <td>NVIDIA Turing (RTX 20 series, T4) or Ampere (RTX 30 series, A4-A100) GPUs</td></tr> <tr><td>8-bit optimizers/quantization</td> <td>NVIDIA Kepler (GTX 780 or newer)</td></tr></tbody>",$t,L,yt,Q,Yt="To install from PyPI.",bt,F,Ut,z,wt,O,Xt="For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations.",Ct,D,Tt,q,gt,K,Qt="Some bitsandbytes features may need a newer CUDA version than the one currently supported by PyTorch binaries from Conda and pip. In this case, you should follow these instructions to load a precompiled bitsandbytes binary.",_t,tt,Ft="<li>Determine the path of the CUDA version you want to use. Common paths include:</li>",vt,et,zt="<li><code>/usr/local/cuda</code></li> <li><code>/usr/local/cuda-XX.X</code> where <code>XX.X</code> is the CUDA version number</li>",Jt,lt,Ot="Then locally install the CUDA version you need with this script from bitsandbytes:",Rt,nt,jt,P,qt="<li>Set the environment variables <code>BNB_CUDA_VERSION</code> and <code>LD_LIBRARY_PATH</code> by manually overriding the CUDA version installed by PyTorch.</li>",xt,S,kt,st,It,it,Kt="For example, to use a local install path:",Bt,at,Gt,H,te="<li>Now when you launch bitsandbytes with these environment variables, the PyTorch CUDA version is overridden by the new CUDA version (in this example, version 11.7) and a different bitsandbytes library is loaded.</li>",At,ot,Et,rt,ee="Please follow these steps to install bitsandbytes with device-specific backend support other than CUDA:",Nt,Z,Vt,pt,Wt,ct,Lt;return f=new ft({props:{title:"Installation",local:"installation",headingTag:"h1"}}),n=new ft({props:{title:"CUDA",local:"cuda",headingTag:"h2"}}),y=new ht({props:{warning:!1,$$slots:{default:[Ae]},$$scope:{ctx:d}}}),L=new ht({props:{warning:!0,$$slots:{default:[Ee]},$$scope:{ctx:d}}}),F=new N({props:{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",wrap:!1}}),z=new ft({props:{title:"Compile from source",local:"compile-from-source",headingTag:"h3"}}),D=new me({props:{id:"source",options:["Linux","Windows","Windows"],$$slots:{default:[De]},$$scope:{ctx:d}}}),q=new ft({props:{title:"PyTorch CUDA versions",local:"pytorch-cuda-versions",headingTag:"h3"}}),nt=new N({props:{code:"d2dldCUyMGh0dHBzJTNBJTJGJTJGcmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSUyRlRpbURldHRtZXJzJTJGYml0c2FuZGJ5dGVzJTJGbWFpbiUyRmluc3RhbGxfY3VkYS5zaCUwQSUyMyUyMFN5bnRheCUyMGN1ZGFfaW5zdGFsbCUyMENVREFfVkVSU0lPTiUyMElOU1RBTExfUFJFRklYJTIwRVhQT1JUX1RPX0JBU0glMEElMjMlMjAlMjAlMjBDVURBX1ZFUlNJT04lMjBpbiUyMCU3QjExMCUyQyUyMDExMSUyQyUyMDExMiUyQyUyMDExMyUyQyUyMDExNCUyQyUyMDExNSUyQyUyMDExNiUyQyUyMDExNyUyQyUyMDExOCUyQyUyMDEyMCUyQyUyMDEyMSUyQyUyMDEyMiUyQyUyMDEyMyUyQyUyMDEyNCUyQyUyMDEyNSU3RCUwQSUyMyUyMCUyMCUyMEVYUE9SVF9UT19CQVNIJTIwaW4lMjAlN0IwJTJDJTIwMSU3RCUyMHdpdGglMjAwJTNERmFsc2UlMjBhbmQlMjAxJTNEVHJ1ZSUwQSUwQSUyMyUyMEZvciUyMGV4YW1wbGUlMkMlMjB0aGUlMjBmb2xsb3dpbmclMjBpbnN0YWxscyUyMENVREElMjAxMS43JTIwdG8lMjB+JTJGbG9jYWwlMkZjdWRhLTExLjclMjBhbmQlMjBleHBvcnRzJTIwdGhlJTIwcGF0aCUyMHRvJTIweW91ciUyMC5iYXNocmMlMEElMEFiYXNoJTIwaW5zdGFsbF9jdWRhLnNoJTIwMTE3JTIwfiUyRmxvY2FsJTIwMQ==",highlighted:`wget https://raw.githubusercontent.com/TimDettmers/bitsandbytes/main/install_cuda.sh | |
| <span class="hljs-comment"># Syntax cuda_install CUDA_VERSION INSTALL_PREFIX EXPORT_TO_BASH</span> | |
| <span class="hljs-comment"># CUDA_VERSION in {110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125}</span> | |
| <span class="hljs-comment"># EXPORT_TO_BASH in {0, 1} with 0=False and 1=True</span> | |
| <span class="hljs-comment"># For example, the following installs CUDA 11.7 to ~/local/cuda-11.7 and exports the path to your .bashrc</span> | |
| bash install_cuda.sh 117 ~/local 1`,wrap:!1}}),S=new ht({props:{warning:!1,$$slots:{default:[Pe]},$$scope:{ctx:d}}}),st=new N({props:{code:"ZXhwb3J0JTIwQk5CX0NVREFfVkVSU0lPTiUzRCUzQ1ZFUlNJT04lM0UlMEFleHBvcnQlMjBMRF9MSUJSQVJZX1BBVEglM0QlMjRMRF9MSUJSQVJZX1BBVEglM0ElM0NQQVRIJTNF",highlighted:`<span class="hljs-built_in">export</span> BNB_CUDA_VERSION=<VERSION> | |
| <span class="hljs-built_in">export</span> LD_LIBRARY_PATH=<span class="hljs-variable">$LD_LIBRARY_PATH</span>:<PATH>`,wrap:!1}}),at=new N({props:{code:"ZXhwb3J0JTIwQk5CX0NVREFfVkVSU0lPTiUzRDExNyUwQWV4cG9ydCUyMExEX0xJQlJBUllfUEFUSCUzRCUyNExEX0xJQlJBUllfUEFUSCUzQSUyRmhvbWUlMkZZT1VSX1VTRVJOQU1FJTJGbG9jYWwlMkZjdWRhLTExLjc=",highlighted:`<span class="hljs-built_in">export</span> BNB_CUDA_VERSION=117 | |
| <span class="hljs-built_in">export</span> LD_LIBRARY_PATH=<span class="hljs-variable">$LD_LIBRARY_PATH</span>:/home/YOUR_USERNAME/local/cuda-11.7`,wrap:!1}}),ot=new ft({props:{title:"Multi-backend preview release (+ compilation)",local:"multi-backend-preview-release--compilation",headingTag:"h2"}}),Z=new me({props:{id:"backend",options:["AMD ROCm","Intel CPU + GPU","Apple Silicon (MPS)"],$$slots:{default:[Xe]},$$scope:{ctx:d}}}),pt=new Je({props:{source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/installation.mdx"}}),{c(){e=w("meta"),p=h(),l=w("p"),i=h(),R(f.$$.fragment),u=h(),R(n.$$.fragment),o=h(),a=w("p"),a.innerHTML=c,b=h(),g=w("p"),g.textContent=G,U=h(),J=w("table"),J.innerHTML=W,E=h(),R(y.$$.fragment),B=h(),A=w("p"),A.textContent=X,$=h(),I=w("table"),I.innerHTML=ut,$t=h(),R(L.$$.fragment),yt=h(),Q=w("p"),Q.textContent=Yt,bt=h(),R(F.$$.fragment),Ut=h(),R(z.$$.fragment),wt=h(),O=w("p"),O.textContent=Xt,Ct=h(),R(D.$$.fragment),Tt=h(),R(q.$$.fragment),gt=h(),K=w("p"),K.textContent=Qt,_t=h(),tt=w("ol"),tt.innerHTML=Ft,vt=h(),et=w("ul"),et.innerHTML=zt,Jt=h(),lt=w("p"),lt.textContent=Ot,Rt=h(),R(nt.$$.fragment),jt=h(),P=w("ol"),P.innerHTML=qt,xt=h(),R(S.$$.fragment),kt=h(),R(st.$$.fragment),It=h(),it=w("p"),it.textContent=Kt,Bt=h(),R(at.$$.fragment),Gt=h(),H=w("ol"),H.innerHTML=te,At=h(),R(ot.$$.fragment),Et=h(),rt=w("p"),rt.textContent=ee,Nt=h(),R(Z.$$.fragment),Vt=h(),R(pt.$$.fragment),Wt=h(),ct=w("p"),this.h()},l(t){const m=ve("svelte-u9bgzb",document.head);e=C(m,"META",{name:!0,content:!0}),m.forEach(s),p=M(t),l=C(t,"P",{}),Mt(l).forEach(s),i=M(t),j(f.$$.fragment,t),u=M(t),j(n.$$.fragment,t),o=M(t),a=C(t,"P",{"data-svelte-h":!0}),T(a)!=="svelte-a3r2sa"&&(a.innerHTML=c),b=M(t),g=C(t,"P",{"data-svelte-h":!0}),T(g)!=="svelte-1dpd6j"&&(g.textContent=G),U=M(t),J=C(t,"TABLE",{"data-svelte-h":!0}),T(J)!=="svelte-jwkomo"&&(J.innerHTML=W),E=M(t),j(y.$$.fragment,t),B=M(t),A=C(t,"P",{"data-svelte-h":!0}),T(A)!=="svelte-1hx87c4"&&(A.textContent=X),$=M(t),I=C(t,"TABLE",{"data-svelte-h":!0}),T(I)!=="svelte-fkifbv"&&(I.innerHTML=ut),$t=M(t),j(L.$$.fragment,t),yt=M(t),Q=C(t,"P",{"data-svelte-h":!0}),T(Q)!=="svelte-16utcew"&&(Q.textContent=Yt),bt=M(t),j(F.$$.fragment,t),Ut=M(t),j(z.$$.fragment,t),wt=M(t),O=C(t,"P",{"data-svelte-h":!0}),T(O)!=="svelte-wtvn8j"&&(O.textContent=Xt),Ct=M(t),j(D.$$.fragment,t),Tt=M(t),j(q.$$.fragment,t),gt=M(t),K=C(t,"P",{"data-svelte-h":!0}),T(K)!=="svelte-n0pdc4"&&(K.textContent=Qt),_t=M(t),tt=C(t,"OL",{"data-svelte-h":!0}),T(tt)!=="svelte-w9mxyz"&&(tt.innerHTML=Ft),vt=M(t),et=C(t,"UL",{"data-svelte-h":!0}),T(et)!=="svelte-r36v8e"&&(et.innerHTML=zt),Jt=M(t),lt=C(t,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-1dhvzk8"&&(lt.textContent=Ot),Rt=M(t),j(nt.$$.fragment,t),jt=M(t),P=C(t,"OL",{start:!0,"data-svelte-h":!0}),T(P)!=="svelte-y8zpl2"&&(P.innerHTML=qt),xt=M(t),j(S.$$.fragment,t),kt=M(t),j(st.$$.fragment,t),It=M(t),it=C(t,"P",{"data-svelte-h":!0}),T(it)!=="svelte-wx07f3"&&(it.textContent=Kt),Bt=M(t),j(at.$$.fragment,t),Gt=M(t),H=C(t,"OL",{start:!0,"data-svelte-h":!0}),T(H)!=="svelte-lfqu8"&&(H.innerHTML=te),At=M(t),j(ot.$$.fragment,t),Et=M(t),rt=C(t,"P",{"data-svelte-h":!0}),T(rt)!=="svelte-y9jz2l"&&(rt.textContent=ee),Nt=M(t),j(Z.$$.fragment,t),Vt=M(t),j(pt.$$.fragment,t),Wt=M(t),ct=C(t,"P",{}),Mt(ct).forEach(s),this.h()},h(){Y(e,"name","hf:doc:metadata"),Y(e,"content",Fe),Y(P,"start","2"),Y(H,"start","3")},m(t,m){Pt(document.head,e),r(t,p,m),r(t,l,m),r(t,i,m),x(f,t,m),r(t,u,m),x(n,t,m),r(t,o,m),r(t,a,m),r(t,b,m),r(t,g,m),r(t,U,m),r(t,J,m),r(t,E,m),x(y,t,m),r(t,B,m),r(t,A,m),r(t,$,m),r(t,I,m),r(t,$t,m),x(L,t,m),r(t,yt,m),r(t,Q,m),r(t,bt,m),x(F,t,m),r(t,Ut,m),x(z,t,m),r(t,wt,m),r(t,O,m),r(t,Ct,m),x(D,t,m),r(t,Tt,m),x(q,t,m),r(t,gt,m),r(t,K,m),r(t,_t,m),r(t,tt,m),r(t,vt,m),r(t,et,m),r(t,Jt,m),r(t,lt,m),r(t,Rt,m),x(nt,t,m),r(t,jt,m),r(t,P,m),r(t,xt,m),x(S,t,m),r(t,kt,m),x(st,t,m),r(t,It,m),r(t,it,m),r(t,Bt,m),x(at,t,m),r(t,Gt,m),r(t,H,m),r(t,At,m),x(ot,t,m),r(t,Et,m),r(t,rt,m),r(t,Nt,m),x(Z,t,m),r(t,Vt,m),x(pt,t,m),r(t,Wt,m),r(t,ct,m),Lt=!0},p(t,[m]){const le={};m&2&&(le.$$scope={dirty:m,ctx:t}),y.$set(le);const ne={};m&2&&(ne.$$scope={dirty:m,ctx:t}),L.$set(ne);const se={};m&2&&(se.$$scope={dirty:m,ctx:t}),D.$set(se);const ie={};m&2&&(ie.$$scope={dirty:m,ctx:t}),S.$set(ie);const ae={};m&2&&(ae.$$scope={dirty:m,ctx:t}),Z.$set(ae)},i(t){Lt||(_(f.$$.fragment,t),_(n.$$.fragment,t),_(y.$$.fragment,t),_(L.$$.fragment,t),_(F.$$.fragment,t),_(z.$$.fragment,t),_(D.$$.fragment,t),_(q.$$.fragment,t),_(nt.$$.fragment,t),_(S.$$.fragment,t),_(st.$$.fragment,t),_(at.$$.fragment,t),_(ot.$$.fragment,t),_(Z.$$.fragment,t),_(pt.$$.fragment,t),Lt=!0)},o(t){v(f.$$.fragment,t),v(n.$$.fragment,t),v(y.$$.fragment,t),v(L.$$.fragment,t),v(F.$$.fragment,t),v(z.$$.fragment,t),v(D.$$.fragment,t),v(q.$$.fragment,t),v(nt.$$.fragment,t),v(S.$$.fragment,t),v(st.$$.fragment,t),v(at.$$.fragment,t),v(ot.$$.fragment,t),v(Z.$$.fragment,t),v(pt.$$.fragment,t),Lt=!1},d(t){t&&(s(p),s(l),s(i),s(u),s(o),s(a),s(b),s(g),s(U),s(J),s(E),s(B),s(A),s($),s(I),s($t),s(yt),s(Q),s(bt),s(Ut),s(wt),s(O),s(Ct),s(Tt),s(gt),s(K),s(_t),s(tt),s(vt),s(et),s(Jt),s(lt),s(Rt),s(jt),s(P),s(xt),s(kt),s(It),s(it),s(Bt),s(Gt),s(H),s(At),s(Et),s(rt),s(Nt),s(Vt),s(Wt),s(ct)),s(e),k(f,t),k(n,t),k(y,t),k(L,t),k(F,t),k(z,t),k(D,t),k(q,t),k(nt,t),k(S,t),k(st,t),k(at,t),k(ot,t),k(Z,t),k(pt,t)}}}const Fe='{"title":"Installation","local":"installation","sections":[{"title":"CUDA","local":"cuda","sections":[{"title":"Compile from source","local":"compile-from-source","sections":[],"depth":3},{"title":"PyTorch CUDA versions","local":"pytorch-cuda-versions","sections":[],"depth":3}],"depth":2},{"title":"Multi-backend preview release (+ compilation)","local":"multi-backend-preview-release--compilation","sections":[{"title":"AMD GPU","local":"amd-gpu","sections":[],"depth":3},{"title":"Intel CPU","local":"intel-cpu","sections":[],"depth":3}],"depth":2}],"depth":1}';function ze(d){return ye(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class sl extends Ht{constructor(e){super(),Zt(this,e,ze,Qe,St,{})}}export{sl as component}; | |
Xet Storage Details
- Size:
- 31.4 kB
- Xet hash:
- 567a0b8f43a3e07f839529b60629e6b02693aada99ba184455e4d48e2d5933d1
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.