Buckets:
| import{s as St,c as de,u as ce,g as he,d as Me,e as $e,f as Pt,o as ye,n as X}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 n,c as M,k as H,a as i,d as v,t as J,z as be,m as Ue,n as we,y as Wt,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 g,v as x,w as k}from"../chunks/index.28275fd3.js";import{T as ct}from"../chunks/Tip.9f398c59.js";import{C as Z}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 o=new URL(window.location.href),l=new URLSearchParams(o.search);l.set(d,e),o.search=l.toString(),history.replaceState(null,"",o.toString())}function xe(d){const e=new URL(window.location.href);return new URLSearchParams(e.search).get(d)}function pe(d,e,o){const l=d.slice();return l[7]=e[o],l}function fe(d){let e,o=d[7]+"",l,s,a,m,u;function r(){return d[6](d[7])}return{c(){e=w("div"),l=Ue(o),s=h(),this.h()},l(p){e=C(p,"DIV",{class:!0});var c=Mt(e);l=we(c,o),s=M(c),c.forEach(n),this.h()},h(){H(e,"class",a="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(p,c){i(p,e,c),Wt(e,l),Wt(e,s),m||(u=Ce(e,"click",r),m=!0)},p(p,c){d=p,c&2&&o!==(o=d[7]+"")&&Te(l,o),c&7&&a!==(a="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"))&&H(e,"class",a)},d(p){p&&n(e),m=!1,u()}}}function ke(d){let e,o,l,s,a=re(d[1]),m=[];for(let p=0;p<a.length;p+=1)m[p]=fe(pe(d,a,p));const u=d[5].default,r=de(u,d,d[4],null);return{c(){e=w("div");for(let p=0;p<m.length;p+=1)m[p].c();o=h(),l=w("div"),r&&r.c(),this.h()},l(p){e=C(p,"DIV",{class:!0});var c=Mt(e);for(let T=0;T<m.length;T+=1)m[T].l(c);c.forEach(n),o=M(p),l=C(p,"DIV",{class:!0});var U=Mt(l);r&&r.l(U),U.forEach(n),this.h()},h(){H(e,"class","flex space-x-2 items-center my-1.5 mr-8 h-7 !pl-0 -mx-3 md:mx-0"),H(l,"class","language-select")},m(p,c){i(p,e,c);for(let U=0;U<m.length;U+=1)m[U]&&m[U].m(e,null);i(p,o,c),i(p,l,c),r&&r.m(l,null),s=!0},p(p,[c]){if(c&15){a=re(p[1]);let U;for(U=0;U<a.length;U+=1){const T=pe(p,a,U);m[U]?m[U].p(T,c):(m[U]=fe(T),m[U].c(),m[U].m(e,null))}for(;U<m.length;U+=1)m[U].d(1);m.length=a.length}r&&r.p&&(!s||c&16)&&ce(r,u,p,p[4],s?Me(u,p[4],c,null):he(p[4]),null)},i(p){s||(v(r,p),s=!0)},o(p){J(r,p),s=!1},d(p){p&&(n(e),n(o),n(l)),be(m,p),r&&r.d(p)}}}function Ie(d,e,o){let l;$e(d,dt,c=>o(2,l=c));let{$$slots:s={},$$scope:a}=e,{id:m}=e,{options:u}=e;Pt(dt,l[m]=u[0],l);function r(c){Pt(dt,l[m]=c,l),je(m,c)}ye(()=>{const c=xe(m);c&&u.includes(c)&&Pt(dt,l[m]=c,l)});const p=c=>r(c);return d.$$set=c=>{"id"in c&&o(0,m=c.id),"options"in c&&o(1,u=c.options),"$$scope"in c&&o(4,a=c.$$scope)},[m,u,l,r,a,s,p]}class me extends Ht{constructor(e){super(),Zt(this,e,Ie,ke,St,{id:0,options:1})}}function ue(d){let e;const o=d[4].default,l=de(o,d,d[3],null);return{c(){l&&l.c()},l(s){l&&l.l(s)},m(s,a){l&&l.m(s,a),e=!0},p(s,a){l&&l.p&&(!e||a&8)&&ce(l,o,s,s[3],e?Me(o,s[3],a,null):he(s[3]),null)},i(s){e||(v(l,s),e=!0)},o(s){J(l,s),e=!1},d(s){l&&l.d(s)}}}function Be(d){let e,o,l=d[2][d[0]]===d[1]&&ue(d);return{c(){l&&l.c(),e=oe()},l(s){l&&l.l(s),e=oe()},m(s,a){l&&l.m(s,a),i(s,e,a),o=!0},p(s,[a]){s[2][s[0]]===s[1]?l?(l.p(s,a),a&7&&v(l,1)):(l=ue(s),l.c(),v(l,1),l.m(e.parentNode,e)):l&&(ge(),J(l,1,1,()=>{l=null}),_e())},i(s){o||(v(l),o=!0)},o(s){J(l),o=!1},d(s){s&&n(e),l&&l.d(s)}}}function Ge(d,e,o){let l;$e(d,dt,r=>o(2,l=r));let{$$slots:s={},$$scope:a}=e,{id:m}=e,{option:u}=e;return d.$$set=r=>{"id"in r&&o(0,m=r.id),"option"in r&&o(1,u=r.option),"$$scope"in r&&o(3,a=r.$$scope)},[m,u,l,a,s]}class ht extends Ht{constructor(e){super(),Zt(this,e,Ge,Be,St,{id:0,option:1})}}function Ee(d){let e,o='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=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-9rmqp2"&&(e.innerHTML=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function Ae(d){let e,o="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=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-13h63kz"&&(e.innerHTML=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function De(d){let e,o="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=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-raeog1"&&(e.textContent=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function Ne(d){let e,o="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,s,a,m,u='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>.',r,p,c="Refer to the following table if you’re using another CUDA Toolkit version.",U,T,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>",b,_,D="Now to install the bitsandbytes package from source, run the following commands:",A,y,B,E,Q;return s=new Z({props:{code:"YXB0LWdldCUyMGluc3RhbGwlMjAteSUyMGJ1aWxkLWVzc2VudGlhbCUyMGNtYWtl",highlighted:"apt-get install -y build-essential cmake",wrap:!1}}),y=new Z({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}}),E=new ct({props:{warning:!1,$$slots:{default:[De]},$$scope:{ctx:d}}}),{c(){e=w("p"),e.innerHTML=o,l=h(),R(s.$$.fragment),a=h(),m=w("p"),m.innerHTML=u,r=h(),p=w("p"),p.textContent=c,U=h(),T=w("table"),T.innerHTML=G,b=h(),_=w("p"),_.textContent=D,A=h(),R(y.$$.fragment),B=h(),R(E.$$.fragment)},l($){e=C($,"P",{"data-svelte-h":!0}),g(e)!=="svelte-29yf67"&&(e.innerHTML=o),l=M($),j(s.$$.fragment,$),a=M($),m=C($,"P",{"data-svelte-h":!0}),g(m)!=="svelte-gmjw5q"&&(m.innerHTML=u),r=M($),p=C($,"P",{"data-svelte-h":!0}),g(p)!=="svelte-1agbdv5"&&(p.textContent=c),U=M($),T=C($,"TABLE",{"data-svelte-h":!0}),g(T)!=="svelte-1nj1xe4"&&(T.innerHTML=G),b=M($),_=C($,"P",{"data-svelte-h":!0}),g(_)!=="svelte-1fitvy1"&&(_.textContent=D),A=M($),j(y.$$.fragment,$),B=M($),j(E.$$.fragment,$)},m($,I){i($,e,I),i($,l,I),x(s,$,I),i($,a,I),i($,m,I),i($,r,I),i($,p,I),i($,U,I),i($,T,I),i($,b,I),i($,_,I),i($,A,I),x(y,$,I),i($,B,I),x(E,$,I),Q=!0},p($,I){const mt={};I&2&&(mt.$$scope={dirty:I,ctx:$}),E.$set(mt)},i($){Q||(v(s.$$.fragment,$),v(y.$$.fragment,$),v(E.$$.fragment,$),Q=!0)},o($){J(s.$$.fragment,$),J(y.$$.fragment,$),J(E.$$.fragment,$),Q=!1},d($){$&&(n(e),n(l),n(a),n(m),n(r),n(p),n(U),n(T),n(b),n(_),n(A),n(B)),k(s,$),k(y,$),k(E,$)}}}function Le(d){let e,o="Windows systems require Visual Studio with C++ support as well as an installation of the CUDA SDK.",l,s,a='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.',m,u,r="Refer to the following table if you’re using another CUDA Toolkit version.",p,c,U="<thead><tr><th>CUDA Toolkit</th> <th>MSVC</th></tr></thead> <tbody><tr><td>>= 11.6</td> <td>19.30+ (VS2022)</td></tr></tbody>",T,G,b,_,D='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.',A;return G=new Z({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=o,l=h(),s=w("p"),s.innerHTML=a,m=h(),u=w("p"),u.textContent=r,p=h(),c=w("table"),c.innerHTML=U,T=h(),R(G.$$.fragment),b=h(),_=w("p"),_.innerHTML=D},l(y){e=C(y,"P",{"data-svelte-h":!0}),g(e)!=="svelte-1ngyk0s"&&(e.textContent=o),l=M(y),s=C(y,"P",{"data-svelte-h":!0}),g(s)!=="svelte-9zb6iz"&&(s.innerHTML=a),m=M(y),u=C(y,"P",{"data-svelte-h":!0}),g(u)!=="svelte-1agbdv5"&&(u.textContent=r),p=M(y),c=C(y,"TABLE",{"data-svelte-h":!0}),g(c)!=="svelte-1nj7txn"&&(c.innerHTML=U),T=M(y),j(G.$$.fragment,y),b=M(y),_=C(y,"P",{"data-svelte-h":!0}),g(_)!=="svelte-e0ivb"&&(_.innerHTML=D)},m(y,B){i(y,e,B),i(y,l,B),i(y,s,B),i(y,m,B),i(y,u,B),i(y,p,B),i(y,c,B),i(y,T,B),x(G,y,B),i(y,b,B),i(y,_,B),A=!0},p:X,i(y){A||(v(G.$$.fragment,y),A=!0)},o(y){J(G.$$.fragment,y),A=!1},d(y){y&&(n(e),n(l),n(s),n(m),n(u),n(p),n(c),n(T),n(b),n(_)),k(G,y)}}}function Ve(d){let e,o,l,s;return e=new ht({props:{id:"source",option:"Linux",$$slots:{default:[Ne]},$$scope:{ctx:d}}}),l=new ht({props:{id:"source",option:"Windows",$$slots:{default:[Le]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),o=h(),R(l.$$.fragment)},l(a){j(e.$$.fragment,a),o=M(a),j(l.$$.fragment,a)},m(a,m){x(e,a,m),i(a,o,m),x(l,a,m),s=!0},p(a,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:a}),e.$set(u);const r={};m&2&&(r.$$scope={dirty:m,ctx:a}),l.$set(r)},i(a){s||(v(e.$$.fragment,a),v(l.$$.fragment,a),s=!0)},o(a){J(e.$$.fragment,a),J(l.$$.fragment,a),s=!1},d(a){a&&n(o),k(e,a),k(l,a)}}}function Pe(d){let e,o="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=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-143buxs"&&(e.innerHTML=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function We(d){let e,o,l,s="For a ROCm specific install:",a,m,u="bitsandbytes is fully supported from ROCm 6.1.",r,p,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.',U,T,G;return e=new ft({props:{title:"AMD GPU",local:"amd-gpu",headingTag:"h3"}}),T=new Z({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),o=h(),l=w("p"),l.textContent=s,a=h(),m=w("p"),m.textContent=u,r=h(),p=w("p"),p.innerHTML=c,U=h(),R(T.$$.fragment)},l(b){j(e.$$.fragment,b),o=M(b),l=C(b,"P",{"data-svelte-h":!0}),g(l)!=="svelte-bu03d4"&&(l.textContent=s),a=M(b),m=C(b,"P",{"data-svelte-h":!0}),g(m)!=="svelte-u6kty4"&&(m.textContent=u),r=M(b),p=C(b,"P",{"data-svelte-h":!0}),g(p)!=="svelte-169gfnf"&&(p.innerHTML=c),U=M(b),j(T.$$.fragment,b)},m(b,_){x(e,b,_),i(b,o,_),i(b,l,_),i(b,a,_),i(b,m,_),i(b,r,_),i(b,p,_),i(b,U,_),x(T,b,_),G=!0},p:X,i(b){G||(v(e.$$.fragment,b),v(T.$$.fragment,b),G=!0)},o(b){J(e.$$.fragment,b),J(T.$$.fragment,b),G=!1},d(b){b&&(n(o),n(l),n(a),n(m),n(r),n(p),n(U)),k(e,b),k(T,b)}}}function Se(d){let e,o="Intel CPU backend only supports building from source; for now, please follow the instructions below.";return{c(){e=w("p"),e.textContent=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-11im0db"&&(e.textContent=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function He(d){let e,o,l,s,a,m="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.",u;return e=new ft({props:{title:"Intel CPU",local:"intel-cpu",headingTag:"h3"}}),l=new ct({props:{warning:!1,$$slots:{default:[Se]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),o=h(),R(l.$$.fragment),s=h(),a=w("p"),a.textContent=m},l(r){j(e.$$.fragment,r),o=M(r),j(l.$$.fragment,r),s=M(r),a=C(r,"P",{"data-svelte-h":!0}),g(a)!=="svelte-1e2wtrl"&&(a.textContent=m)},m(r,p){x(e,r,p),i(r,o,p),x(l,r,p),i(r,s,p),i(r,a,p),u=!0},p(r,p){const c={};p&2&&(c.$$scope={dirty:p,ctx:r}),l.$set(c)},i(r){u||(v(e.$$.fragment,r),v(l.$$.fragment,r),u=!0)},o(r){J(e.$$.fragment,r),J(l.$$.fragment,r),u=!1},d(r){r&&(n(o),n(s),n(a)),k(e,r),k(l,r)}}}function Ze(d){let e,o="WIP";return{c(){e=w("p"),e.textContent=o},l(l){e=C(l,"P",{"data-svelte-h":!0}),g(e)!=="svelte-1kg89us"&&(e.textContent=o)},m(l,s){i(l,e,s)},p:X,d(l){l&&n(e)}}}function Xe(d){let e,o,l,s,a,m;return e=new ht({props:{id:"backend",option:"AMD ROCm",$$slots:{default:[We]},$$scope:{ctx:d}}}),l=new ht({props:{id:"backend",option:"Intel CPU + GPU",$$slots:{default:[He]},$$scope:{ctx:d}}}),a=new ht({props:{id:"backend",option:"Apple Silicon (MPS)",$$slots:{default:[Ze]},$$scope:{ctx:d}}}),{c(){R(e.$$.fragment),o=h(),R(l.$$.fragment),s=h(),R(a.$$.fragment)},l(u){j(e.$$.fragment,u),o=M(u),j(l.$$.fragment,u),s=M(u),j(a.$$.fragment,u)},m(u,r){x(e,u,r),i(u,o,r),x(l,u,r),i(u,s,r),x(a,u,r),m=!0},p(u,r){const p={};r&2&&(p.$$scope={dirty:r,ctx:u}),e.$set(p);const c={};r&2&&(c.$$scope={dirty:r,ctx:u}),l.$set(c);const U={};r&2&&(U.$$scope={dirty:r,ctx:u}),a.$set(U)},i(u){m||(v(e.$$.fragment,u),v(l.$$.fragment,u),v(a.$$.fragment,u),m=!0)},o(u){J(e.$$.fragment,u),J(l.$$.fragment,u),J(a.$$.fragment,u),m=!1},d(u){u&&(n(o),n(s)),k(e,u),k(l,u),k(a,u)}}}function Qe(d){let e,o,l,s,a,m,u,r,p,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.",U,T,G="The latest version of bitsandbytes builds on:",b,_,D="<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>",A,y,B,E,Q="For Linux systems, make sure your hardware meets the following requirements to use bitsandbytes features.",$,I,mt="<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,N,yt,Y,Xt="To install from PyPI.",bt,F,Ut,z,wt,O,Qt="For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations.",Ct,L,Tt,q,gt,K,Yt="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,V,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,P,kt,st,It,it,Kt="For example, to use a local install path:",Bt,at,Gt,W,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>",Et,ot,At,rt,ee="Please follow these steps to install bitsandbytes with device-specific backend support other than CUDA:",Dt,S,Nt,pt,Lt,ut,Vt;return a=new ft({props:{title:"Installation",local:"installation",headingTag:"h1"}}),u=new ft({props:{title:"CUDA",local:"cuda",headingTag:"h2"}}),y=new ct({props:{warning:!1,$$slots:{default:[Ee]},$$scope:{ctx:d}}}),N=new ct({props:{warning:!0,$$slots:{default:[Ae]},$$scope:{ctx:d}}}),F=new Z({props:{code:"cGlwJTIwaW5zdGFsbCUyMGJpdHNhbmRieXRlcw==",highlighted:"pip install bitsandbytes",wrap:!1}}),z=new ft({props:{title:"Compile from source",local:"compile-from-source",headingTag:"h3"}}),L=new me({props:{id:"source",options:["Linux","Windows"],$$slots:{default:[Ve]},$$scope:{ctx:d}}}),q=new ft({props:{title:"PyTorch CUDA versions",local:"pytorch-cuda-versions",headingTag:"h3"}}),nt=new Z({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}}),P=new ct({props:{warning:!1,$$slots:{default:[Pe]},$$scope:{ctx:d}}}),st=new Z({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 Z({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"}}),S=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"),o=h(),l=w("p"),s=h(),R(a.$$.fragment),m=h(),R(u.$$.fragment),r=h(),p=w("p"),p.innerHTML=c,U=h(),T=w("p"),T.textContent=G,b=h(),_=w("table"),_.innerHTML=D,A=h(),R(y.$$.fragment),B=h(),E=w("p"),E.textContent=Q,$=h(),I=w("table"),I.innerHTML=mt,$t=h(),R(N.$$.fragment),yt=h(),Y=w("p"),Y.textContent=Xt,bt=h(),R(F.$$.fragment),Ut=h(),R(z.$$.fragment),wt=h(),O=w("p"),O.textContent=Qt,Ct=h(),R(L.$$.fragment),Tt=h(),R(q.$$.fragment),gt=h(),K=w("p"),K.textContent=Yt,_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(),V=w("ol"),V.innerHTML=qt,xt=h(),R(P.$$.fragment),kt=h(),R(st.$$.fragment),It=h(),it=w("p"),it.textContent=Kt,Bt=h(),R(at.$$.fragment),Gt=h(),W=w("ol"),W.innerHTML=te,Et=h(),R(ot.$$.fragment),At=h(),rt=w("p"),rt.textContent=ee,Dt=h(),R(S.$$.fragment),Nt=h(),R(pt.$$.fragment),Lt=h(),ut=w("p"),this.h()},l(t){const f=ve("svelte-u9bgzb",document.head);e=C(f,"META",{name:!0,content:!0}),f.forEach(n),o=M(t),l=C(t,"P",{}),Mt(l).forEach(n),s=M(t),j(a.$$.fragment,t),m=M(t),j(u.$$.fragment,t),r=M(t),p=C(t,"P",{"data-svelte-h":!0}),g(p)!=="svelte-a3r2sa"&&(p.innerHTML=c),U=M(t),T=C(t,"P",{"data-svelte-h":!0}),g(T)!=="svelte-1dpd6j"&&(T.textContent=G),b=M(t),_=C(t,"TABLE",{"data-svelte-h":!0}),g(_)!=="svelte-jwkomo"&&(_.innerHTML=D),A=M(t),j(y.$$.fragment,t),B=M(t),E=C(t,"P",{"data-svelte-h":!0}),g(E)!=="svelte-1hx87c4"&&(E.textContent=Q),$=M(t),I=C(t,"TABLE",{"data-svelte-h":!0}),g(I)!=="svelte-fkifbv"&&(I.innerHTML=mt),$t=M(t),j(N.$$.fragment,t),yt=M(t),Y=C(t,"P",{"data-svelte-h":!0}),g(Y)!=="svelte-16utcew"&&(Y.textContent=Xt),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}),g(O)!=="svelte-wtvn8j"&&(O.textContent=Qt),Ct=M(t),j(L.$$.fragment,t),Tt=M(t),j(q.$$.fragment,t),gt=M(t),K=C(t,"P",{"data-svelte-h":!0}),g(K)!=="svelte-n0pdc4"&&(K.textContent=Yt),_t=M(t),tt=C(t,"OL",{"data-svelte-h":!0}),g(tt)!=="svelte-w9mxyz"&&(tt.innerHTML=Ft),vt=M(t),et=C(t,"UL",{"data-svelte-h":!0}),g(et)!=="svelte-r36v8e"&&(et.innerHTML=zt),Jt=M(t),lt=C(t,"P",{"data-svelte-h":!0}),g(lt)!=="svelte-1dhvzk8"&&(lt.textContent=Ot),Rt=M(t),j(nt.$$.fragment,t),jt=M(t),V=C(t,"OL",{start:!0,"data-svelte-h":!0}),g(V)!=="svelte-y8zpl2"&&(V.innerHTML=qt),xt=M(t),j(P.$$.fragment,t),kt=M(t),j(st.$$.fragment,t),It=M(t),it=C(t,"P",{"data-svelte-h":!0}),g(it)!=="svelte-wx07f3"&&(it.textContent=Kt),Bt=M(t),j(at.$$.fragment,t),Gt=M(t),W=C(t,"OL",{start:!0,"data-svelte-h":!0}),g(W)!=="svelte-lfqu8"&&(W.innerHTML=te),Et=M(t),j(ot.$$.fragment,t),At=M(t),rt=C(t,"P",{"data-svelte-h":!0}),g(rt)!=="svelte-y9jz2l"&&(rt.textContent=ee),Dt=M(t),j(S.$$.fragment,t),Nt=M(t),j(pt.$$.fragment,t),Lt=M(t),ut=C(t,"P",{}),Mt(ut).forEach(n),this.h()},h(){H(e,"name","hf:doc:metadata"),H(e,"content",Ye),H(V,"start","2"),H(W,"start","3")},m(t,f){Wt(document.head,e),i(t,o,f),i(t,l,f),i(t,s,f),x(a,t,f),i(t,m,f),x(u,t,f),i(t,r,f),i(t,p,f),i(t,U,f),i(t,T,f),i(t,b,f),i(t,_,f),i(t,A,f),x(y,t,f),i(t,B,f),i(t,E,f),i(t,$,f),i(t,I,f),i(t,$t,f),x(N,t,f),i(t,yt,f),i(t,Y,f),i(t,bt,f),x(F,t,f),i(t,Ut,f),x(z,t,f),i(t,wt,f),i(t,O,f),i(t,Ct,f),x(L,t,f),i(t,Tt,f),x(q,t,f),i(t,gt,f),i(t,K,f),i(t,_t,f),i(t,tt,f),i(t,vt,f),i(t,et,f),i(t,Jt,f),i(t,lt,f),i(t,Rt,f),x(nt,t,f),i(t,jt,f),i(t,V,f),i(t,xt,f),x(P,t,f),i(t,kt,f),x(st,t,f),i(t,It,f),i(t,it,f),i(t,Bt,f),x(at,t,f),i(t,Gt,f),i(t,W,f),i(t,Et,f),x(ot,t,f),i(t,At,f),i(t,rt,f),i(t,Dt,f),x(S,t,f),i(t,Nt,f),x(pt,t,f),i(t,Lt,f),i(t,ut,f),Vt=!0},p(t,[f]){const le={};f&2&&(le.$$scope={dirty:f,ctx:t}),y.$set(le);const ne={};f&2&&(ne.$$scope={dirty:f,ctx:t}),N.$set(ne);const se={};f&2&&(se.$$scope={dirty:f,ctx:t}),L.$set(se);const ie={};f&2&&(ie.$$scope={dirty:f,ctx:t}),P.$set(ie);const ae={};f&2&&(ae.$$scope={dirty:f,ctx:t}),S.$set(ae)},i(t){Vt||(v(a.$$.fragment,t),v(u.$$.fragment,t),v(y.$$.fragment,t),v(N.$$.fragment,t),v(F.$$.fragment,t),v(z.$$.fragment,t),v(L.$$.fragment,t),v(q.$$.fragment,t),v(nt.$$.fragment,t),v(P.$$.fragment,t),v(st.$$.fragment,t),v(at.$$.fragment,t),v(ot.$$.fragment,t),v(S.$$.fragment,t),v(pt.$$.fragment,t),Vt=!0)},o(t){J(a.$$.fragment,t),J(u.$$.fragment,t),J(y.$$.fragment,t),J(N.$$.fragment,t),J(F.$$.fragment,t),J(z.$$.fragment,t),J(L.$$.fragment,t),J(q.$$.fragment,t),J(nt.$$.fragment,t),J(P.$$.fragment,t),J(st.$$.fragment,t),J(at.$$.fragment,t),J(ot.$$.fragment,t),J(S.$$.fragment,t),J(pt.$$.fragment,t),Vt=!1},d(t){t&&(n(o),n(l),n(s),n(m),n(r),n(p),n(U),n(T),n(b),n(_),n(A),n(B),n(E),n($),n(I),n($t),n(yt),n(Y),n(bt),n(Ut),n(wt),n(O),n(Ct),n(Tt),n(gt),n(K),n(_t),n(tt),n(vt),n(et),n(Jt),n(lt),n(Rt),n(jt),n(V),n(xt),n(kt),n(It),n(it),n(Bt),n(Gt),n(W),n(Et),n(At),n(rt),n(Dt),n(Nt),n(Lt),n(ut)),n(e),k(a,t),k(u,t),k(y,t),k(N,t),k(F,t),k(z,t),k(L,t),k(q,t),k(nt,t),k(P,t),k(st,t),k(at,t),k(ot,t),k(S,t),k(pt,t)}}}const Ye='{"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 Fe(d){return ye(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class nl extends Ht{constructor(e){super(),Zt(this,e,Fe,Qe,St,{})}}export{nl as component}; | |
Xet Storage Details
- Size:
- 29.7 kB
- Xet hash:
- 9d68f0594419ff08d8983c93a1115733fb4e05112b12d62f78d050e7a5cbfca5
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.