Buckets:
| import{s as Xt,c as de,u as ce,g as Me,d as he,e as be,f as Dt,o as ye,n as P}from"../chunks/scheduler.852ec091.js";import{S as Zt,i as Yt,g as C,s as h,h as T,j as ht,f as n,c as b,k as Y,a as s,d as J,t as R,z as $e,m as Ue,n as we,y as Ht,B as Ce,o as Te,e as oe,p as ge,b as _e,r as j,A as ve,u as x,x as v,v as I,w as k}from"../chunks/index.28275fd3.js";import{T as ct}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 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,i,a,f,m;function u(){return d[6](d[7])}return{c(){e=C("div"),l=Ue(o),i=h(),this.h()},l(p){e=T(p,"DIV",{class:!0});var c=ht(e);l=we(c,o),i=b(c),c.forEach(n),this.h()},h(){Y(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){s(p,e,c),Ht(e,l),Ht(e,i),f||(m=Ce(e,"click",u),f=!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"))&&Y(e,"class",a)},d(p){p&&n(e),f=!1,m()}}}function Ie(d){let e,o,l,i,a=re(d[1]),f=[];for(let p=0;p<a.length;p+=1)f[p]=fe(pe(d,a,p));const m=d[5].default,u=de(m,d,d[4],null);return{c(){e=C("div");for(let p=0;p<f.length;p+=1)f[p].c();o=h(),l=C("div"),u&&u.c(),this.h()},l(p){e=T(p,"DIV",{class:!0});var c=ht(e);for(let g=0;g<f.length;g+=1)f[g].l(c);c.forEach(n),o=b(p),l=T(p,"DIV",{class:!0});var U=ht(l);u&&u.l(U),U.forEach(n),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(p,c){s(p,e,c);for(let U=0;U<f.length;U+=1)f[U]&&f[U].m(e,null);s(p,o,c),s(p,l,c),u&&u.m(l,null),i=!0},p(p,[c]){if(c&15){a=re(p[1]);let U;for(U=0;U<a.length;U+=1){const g=pe(p,a,U);f[U]?f[U].p(g,c):(f[U]=fe(g),f[U].c(),f[U].m(e,null))}for(;U<f.length;U+=1)f[U].d(1);f.length=a.length}u&&u.p&&(!i||c&16)&&ce(u,m,p,p[4],i?he(m,p[4],c,null):Me(p[4]),null)},i(p){i||(J(u,p),i=!0)},o(p){R(u,p),i=!1},d(p){p&&(n(e),n(o),n(l)),$e(f,p),u&&u.d(p)}}}function ke(d,e,o){let l;be(d,dt,c=>o(2,l=c));let{$$slots:i={},$$scope:a}=e,{id:f}=e,{options:m}=e;Dt(dt,l[f]=m[0],l);function u(c){Dt(dt,l[f]=c,l),je(f,c)}ye(()=>{const c=xe(f);c&&m.includes(c)&&Dt(dt,l[f]=c,l)});const p=c=>u(c);return d.$$set=c=>{"id"in c&&o(0,f=c.id),"options"in c&&o(1,m=c.options),"$$scope"in c&&o(4,a=c.$$scope)},[f,m,l,u,a,i,p]}class me extends Zt{constructor(e){super(),Yt(this,e,ke,Ie,Xt,{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(i){l&&l.l(i)},m(i,a){l&&l.m(i,a),e=!0},p(i,a){l&&l.p&&(!e||a&8)&&ce(l,o,i,i[3],e?he(o,i[3],a,null):Me(i[3]),null)},i(i){e||(J(l,i),e=!0)},o(i){R(l,i),e=!1},d(i){l&&l.d(i)}}}function Be(d){let e,o,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,a){l&&l.m(i,a),s(i,e,a),o=!0},p(i,[a]){i[2][i[0]]===i[1]?l?(l.p(i,a),a&7&&J(l,1)):(l=ue(i),l.c(),J(l,1),l.m(e.parentNode,e)):l&&(ge(),R(l,1,1,()=>{l=null}),_e())},i(i){o||(J(l),o=!0)},o(i){R(l),o=!1},d(i){i&&n(e),l&&l.d(i)}}}function Ge(d,e,o){let l;be(d,dt,u=>o(2,l=u));let{$$slots:i={},$$scope:a}=e,{id:f}=e,{option:m}=e;return d.$$set=u=>{"id"in u&&o(0,f=u.id),"option"in u&&o(1,m=u.option),"$$scope"in u&&o(3,a=u.$$scope)},[f,m,l,a,i]}class Mt extends Zt{constructor(e){super(),Yt(this,e,Ge,Be,Xt,{id:0,option:1})}}function Ae(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=C("p"),e.innerHTML=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-9rmqp2"&&(e.innerHTML=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function Ee(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=C("p"),e.innerHTML=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-13h63kz"&&(e.innerHTML=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function Ne(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=C("p"),e.textContent=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-raeog1"&&(e.textContent=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function We(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,i,a,f,m='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>.',u,p,c="Refer to the following table if you’re using another CUDA Toolkit version.",U,g,y="<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>",M,_,W="Now to install the bitsandbytes package from source, run the following commands:",E,w,G,A,S;return i=new N({props:{code:"YXB0LWdldCUyMGluc3RhbGwlMjAteSUyMGJ1aWxkLWVzc2VudGlhbCUyMGNtYWtl",highlighted:"apt-get install -y build-essential cmake",wrap:!1}}),w=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 ct({props:{warning:!1,$$slots:{default:[Ne]},$$scope:{ctx:d}}}),{c(){e=C("p"),e.innerHTML=o,l=h(),j(i.$$.fragment),a=h(),f=C("p"),f.innerHTML=m,u=h(),p=C("p"),p.textContent=c,U=h(),g=C("table"),g.innerHTML=y,M=h(),_=C("p"),_.textContent=W,E=h(),j(w.$$.fragment),G=h(),j(A.$$.fragment)},l($){e=T($,"P",{"data-svelte-h":!0}),v(e)!=="svelte-29yf67"&&(e.innerHTML=o),l=b($),x(i.$$.fragment,$),a=b($),f=T($,"P",{"data-svelte-h":!0}),v(f)!=="svelte-gmjw5q"&&(f.innerHTML=m),u=b($),p=T($,"P",{"data-svelte-h":!0}),v(p)!=="svelte-1agbdv5"&&(p.textContent=c),U=b($),g=T($,"TABLE",{"data-svelte-h":!0}),v(g)!=="svelte-1nj1xe4"&&(g.innerHTML=y),M=b($),_=T($,"P",{"data-svelte-h":!0}),v(_)!=="svelte-1fitvy1"&&(_.textContent=W),E=b($),x(w.$$.fragment,$),G=b($),x(A.$$.fragment,$)},m($,B){s($,e,B),s($,l,B),I(i,$,B),s($,a,B),s($,f,B),s($,u,B),s($,p,B),s($,U,B),s($,g,B),s($,M,B),s($,_,B),s($,E,B),I(w,$,B),s($,G,B),I(A,$,B),S=!0},p($,B){const mt={};B&2&&(mt.$$scope={dirty:B,ctx:$}),A.$set(mt)},i($){S||(J(i.$$.fragment,$),J(w.$$.fragment,$),J(A.$$.fragment,$),S=!0)},o($){R(i.$$.fragment,$),R(w.$$.fragment,$),R(A.$$.fragment,$),S=!1},d($){$&&(n(e),n(l),n(a),n(f),n(u),n(p),n(U),n(g),n(M),n(_),n(E),n(G)),k(i,$),k(w,$),k(A,$)}}}function Le(d){let e,o="Windows systems require Visual Studio with C++ support as well as an installation of the CUDA SDK.",l,i,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.',f,m,u="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>",g,y,M,_,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 y=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=C("p"),e.textContent=o,l=h(),i=C("p"),i.innerHTML=a,f=h(),m=C("p"),m.textContent=u,p=h(),c=C("table"),c.innerHTML=U,g=h(),j(y.$$.fragment),M=h(),_=C("p"),_.innerHTML=W},l(w){e=T(w,"P",{"data-svelte-h":!0}),v(e)!=="svelte-1ngyk0s"&&(e.textContent=o),l=b(w),i=T(w,"P",{"data-svelte-h":!0}),v(i)!=="svelte-9zb6iz"&&(i.innerHTML=a),f=b(w),m=T(w,"P",{"data-svelte-h":!0}),v(m)!=="svelte-1agbdv5"&&(m.textContent=u),p=b(w),c=T(w,"TABLE",{"data-svelte-h":!0}),v(c)!=="svelte-1nj7txn"&&(c.innerHTML=U),g=b(w),x(y.$$.fragment,w),M=b(w),_=T(w,"P",{"data-svelte-h":!0}),v(_)!=="svelte-e0ivb"&&(_.innerHTML=W)},m(w,G){s(w,e,G),s(w,l,G),s(w,i,G),s(w,f,G),s(w,m,G),s(w,p,G),s(w,c,G),s(w,g,G),I(y,w,G),s(w,M,G),s(w,_,G),E=!0},p:P,i(w){E||(J(y.$$.fragment,w),E=!0)},o(w){R(y.$$.fragment,w),E=!1},d(w){w&&(n(e),n(l),n(i),n(f),n(m),n(p),n(c),n(g),n(M),n(_)),k(y,w)}}}function Ve(d){let e,o,l,i;return e=new Mt({props:{id:"source",option:"Linux",$$slots:{default:[We]},$$scope:{ctx:d}}}),l=new Mt({props:{id:"source",option:"Windows",$$slots:{default:[Le]},$$scope:{ctx:d}}}),{c(){j(e.$$.fragment),o=h(),j(l.$$.fragment)},l(a){x(e.$$.fragment,a),o=b(a),x(l.$$.fragment,a)},m(a,f){I(e,a,f),s(a,o,f),I(l,a,f),i=!0},p(a,f){const m={};f&2&&(m.$$scope={dirty:f,ctx:a}),e.$set(m);const u={};f&2&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){i||(J(e.$$.fragment,a),J(l.$$.fragment,a),i=!0)},o(a){R(e.$$.fragment,a),R(l.$$.fragment,a),i=!1},d(a){a&&n(o),k(e,a),k(l,a)}}}function De(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=C("p"),e.innerHTML=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-143buxs"&&(e.innerHTML=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function He(d){let e,o,l,i="For a ROCm specific install:",a,f,m="bitsandbytes is fully supported from ROCm 6.1.",u,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,g,y;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(){j(e.$$.fragment),o=h(),l=C("p"),l.textContent=i,a=h(),f=C("p"),f.textContent=m,u=h(),p=C("p"),p.innerHTML=c,U=h(),j(g.$$.fragment)},l(M){x(e.$$.fragment,M),o=b(M),l=T(M,"P",{"data-svelte-h":!0}),v(l)!=="svelte-bu03d4"&&(l.textContent=i),a=b(M),f=T(M,"P",{"data-svelte-h":!0}),v(f)!=="svelte-u6kty4"&&(f.textContent=m),u=b(M),p=T(M,"P",{"data-svelte-h":!0}),v(p)!=="svelte-169gfnf"&&(p.innerHTML=c),U=b(M),x(g.$$.fragment,M)},m(M,_){I(e,M,_),s(M,o,_),s(M,l,_),s(M,a,_),s(M,f,_),s(M,u,_),s(M,p,_),s(M,U,_),I(g,M,_),y=!0},p:P,i(M){y||(J(e.$$.fragment,M),J(g.$$.fragment,M),y=!0)},o(M){R(e.$$.fragment,M),R(g.$$.fragment,M),y=!1},d(M){M&&(n(o),n(l),n(a),n(f),n(u),n(p),n(U)),k(e,M),k(g,M)}}}function Xe(d){let e,o="Intel CPU backend only supports building from source; for now, please follow the instructions below.";return{c(){e=C("p"),e.textContent=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-11im0db"&&(e.textContent=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function Ze(d){let e,o,l,i,a,f="Similar to the CUDA case, you can compile bitsandbytes from source for Linux and Windows systems.",m,u,p='The below commands are for Linux. For installing on Windows, please adapt the below commands according to the same pattern as described <a href="#compile">the section above on compiling from source under the Windows tab</a>.',c,U,g;return e=new ft({props:{title:"Intel CPU",local:"intel-cpu",headingTag:"h3"}}),l=new ct({props:{warning:!1,$$slots:{default:[Xe]},$$scope:{ctx:d}}}),U=new N({props:{code:"Z2l0JTIwY2xvbmUlMjAtLWJyYW5jaCUyMG11bHRpLWJhY2tlbmQtcmVmYWN0b3IlMjBodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZUaW1EZXR0bWVycyUyRmJpdHNhbmRieXRlcy5naXQlMjAlMjYlMjYlMjBjZCUyMGJpdHNhbmRieXRlcyUyRiUwQXBpcCUyMGluc3RhbGwlMjBpbnRlbF9leHRlbnNpb25fZm9yX3B5dG9yY2glMEFwaXAlMjBpbnN0YWxsJTIwLXIlMjByZXF1aXJlbWVudHMtZGV2LnR4dCUwQWNtYWtlJTIwLURDT01QVVRFX0JBQ0tFTkQlM0RjcHUlMjAtUyUyMC4lMEFtYWtlJTBBcGlwJTIwaW5zdGFsbCUyMC1lJTIwLiUyMCUyMCUyMCUyMyUyMCU2MC1lJTYwJTIwZm9yJTIwJTIyZWRpdGFibGUlMjIlMjBpbnN0YWxsJTJDJTIwd2hlbiUyMGRldmVsb3BpbmclMjBCTkIlMjAob3RoZXJ3aXNlJTIwbGVhdmUlMjB0aGF0JTIwb3V0KQ==",highlighted:`git clone --branch multi-backend-refactor https:<span class="hljs-regexp">//gi</span>thub.com<span class="hljs-regexp">/TimDettmers/</span>bitsandbytes.git && cd bitsandbytes/ | |
| pip install intel_extension_for_pytorch | |
| pip install -r requirements-dev.txt | |
| cmake -DCOMPUTE_BACKEND=cpu -S . | |
| make | |
| pip install -e . <span class="hljs-comment"># \`-e\` for "editable" install, when developing BNB (otherwise leave that out)</span>`,wrap:!1}}),{c(){j(e.$$.fragment),o=h(),j(l.$$.fragment),i=h(),a=C("p"),a.textContent=f,m=h(),u=C("p"),u.innerHTML=p,c=h(),j(U.$$.fragment)},l(y){x(e.$$.fragment,y),o=b(y),x(l.$$.fragment,y),i=b(y),a=T(y,"P",{"data-svelte-h":!0}),v(a)!=="svelte-xkgho"&&(a.textContent=f),m=b(y),u=T(y,"P",{"data-svelte-h":!0}),v(u)!=="svelte-1k0m04z"&&(u.innerHTML=p),c=b(y),x(U.$$.fragment,y)},m(y,M){I(e,y,M),s(y,o,M),I(l,y,M),s(y,i,M),s(y,a,M),s(y,m,M),s(y,u,M),s(y,c,M),I(U,y,M),g=!0},p(y,M){const _={};M&2&&(_.$$scope={dirty:M,ctx:y}),l.$set(_)},i(y){g||(J(e.$$.fragment,y),J(l.$$.fragment,y),J(U.$$.fragment,y),g=!0)},o(y){R(e.$$.fragment,y),R(l.$$.fragment,y),R(U.$$.fragment,y),g=!1},d(y){y&&(n(o),n(i),n(a),n(m),n(u),n(c)),k(e,y),k(l,y),k(U,y)}}}function Ye(d){let e,o="WIP";return{c(){e=C("p"),e.textContent=o},l(l){e=T(l,"P",{"data-svelte-h":!0}),v(e)!=="svelte-1kg89us"&&(e.textContent=o)},m(l,i){s(l,e,i)},p:P,d(l){l&&n(e)}}}function Pe(d){let e,o,l,i,a,f;return e=new Mt({props:{id:"backend",option:"AMD ROCm",$$slots:{default:[He]},$$scope:{ctx:d}}}),l=new Mt({props:{id:"backend",option:"Intel CPU + GPU",$$slots:{default:[Ze]},$$scope:{ctx:d}}}),a=new Mt({props:{id:"backend",option:"Apple Silicon (MPS)",$$slots:{default:[Ye]},$$scope:{ctx:d}}}),{c(){j(e.$$.fragment),o=h(),j(l.$$.fragment),i=h(),j(a.$$.fragment)},l(m){x(e.$$.fragment,m),o=b(m),x(l.$$.fragment,m),i=b(m),x(a.$$.fragment,m)},m(m,u){I(e,m,u),s(m,o,u),I(l,m,u),s(m,i,u),I(a,m,u),f=!0},p(m,u){const p={};u&2&&(p.$$scope={dirty:u,ctx:m}),e.$set(p);const c={};u&2&&(c.$$scope={dirty:u,ctx:m}),l.$set(c);const U={};u&2&&(U.$$scope={dirty:u,ctx:m}),a.$set(U)},i(m){f||(J(e.$$.fragment,m),J(l.$$.fragment,m),J(a.$$.fragment,m),f=!0)},o(m){R(e.$$.fragment,m),R(l.$$.fragment,m),R(a.$$.fragment,m),f=!1},d(m){m&&(n(o),n(i)),k(e,m),k(l,m),k(a,m)}}}function Se(d){let e,o,l,i,a,f,m,u,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,g,y="The latest version of bitsandbytes builds on:",M,_,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,w,G,A,S="For Linux systems, make sure your hardware meets the following requirements to use bitsandbytes features.",$,B,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>",bt,L,yt,Q,Pt="To install from PyPI.",$t,F,Ut,z,wt,O,St="For Linux and Windows systems, you can compile bitsandbytes from source. Installing from source allows for more build options with different CMake configurations.",Ct,V,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,D,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,H,It,st,kt,it,Kt="For example, to use a local install path:",Bt,at,Gt,X,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,Wt,pt,Lt,ut,Vt;return a=new ft({props:{title:"Installation",local:"installation",headingTag:"h1"}}),m=new ft({props:{title:"CUDA",local:"cuda",headingTag:"h2"}}),w=new ct({props:{warning:!1,$$slots:{default:[Ae]},$$scope:{ctx:d}}}),L=new ct({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",headingTag:"h3"}}),V=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 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}}),H=new ct({props:{warning:!1,$$slots:{default:[De]},$$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:[Pe]},$$scope:{ctx:d}}}),pt=new Je({props:{source:"https://github.com/bitsandbytes-foundation/bitsandbytes/blob/main/docs/source/installation.mdx"}}),{c(){e=C("meta"),o=h(),l=C("p"),i=h(),j(a.$$.fragment),f=h(),j(m.$$.fragment),u=h(),p=C("p"),p.innerHTML=c,U=h(),g=C("p"),g.textContent=y,M=h(),_=C("table"),_.innerHTML=W,E=h(),j(w.$$.fragment),G=h(),A=C("p"),A.textContent=S,$=h(),B=C("table"),B.innerHTML=mt,bt=h(),j(L.$$.fragment),yt=h(),Q=C("p"),Q.textContent=Pt,$t=h(),j(F.$$.fragment),Ut=h(),j(z.$$.fragment),wt=h(),O=C("p"),O.textContent=St,Ct=h(),j(V.$$.fragment),Tt=h(),j(q.$$.fragment),gt=h(),K=C("p"),K.textContent=Qt,_t=h(),tt=C("ol"),tt.innerHTML=Ft,vt=h(),et=C("ul"),et.innerHTML=zt,Jt=h(),lt=C("p"),lt.textContent=Ot,Rt=h(),j(nt.$$.fragment),jt=h(),D=C("ol"),D.innerHTML=qt,xt=h(),j(H.$$.fragment),It=h(),j(st.$$.fragment),kt=h(),it=C("p"),it.textContent=Kt,Bt=h(),j(at.$$.fragment),Gt=h(),X=C("ol"),X.innerHTML=te,At=h(),j(ot.$$.fragment),Et=h(),rt=C("p"),rt.textContent=ee,Nt=h(),j(Z.$$.fragment),Wt=h(),j(pt.$$.fragment),Lt=h(),ut=C("p"),this.h()},l(t){const r=ve("svelte-u9bgzb",document.head);e=T(r,"META",{name:!0,content:!0}),r.forEach(n),o=b(t),l=T(t,"P",{}),ht(l).forEach(n),i=b(t),x(a.$$.fragment,t),f=b(t),x(m.$$.fragment,t),u=b(t),p=T(t,"P",{"data-svelte-h":!0}),v(p)!=="svelte-a3r2sa"&&(p.innerHTML=c),U=b(t),g=T(t,"P",{"data-svelte-h":!0}),v(g)!=="svelte-1dpd6j"&&(g.textContent=y),M=b(t),_=T(t,"TABLE",{"data-svelte-h":!0}),v(_)!=="svelte-jwkomo"&&(_.innerHTML=W),E=b(t),x(w.$$.fragment,t),G=b(t),A=T(t,"P",{"data-svelte-h":!0}),v(A)!=="svelte-1hx87c4"&&(A.textContent=S),$=b(t),B=T(t,"TABLE",{"data-svelte-h":!0}),v(B)!=="svelte-fkifbv"&&(B.innerHTML=mt),bt=b(t),x(L.$$.fragment,t),yt=b(t),Q=T(t,"P",{"data-svelte-h":!0}),v(Q)!=="svelte-16utcew"&&(Q.textContent=Pt),$t=b(t),x(F.$$.fragment,t),Ut=b(t),x(z.$$.fragment,t),wt=b(t),O=T(t,"P",{"data-svelte-h":!0}),v(O)!=="svelte-wtvn8j"&&(O.textContent=St),Ct=b(t),x(V.$$.fragment,t),Tt=b(t),x(q.$$.fragment,t),gt=b(t),K=T(t,"P",{"data-svelte-h":!0}),v(K)!=="svelte-n0pdc4"&&(K.textContent=Qt),_t=b(t),tt=T(t,"OL",{"data-svelte-h":!0}),v(tt)!=="svelte-w9mxyz"&&(tt.innerHTML=Ft),vt=b(t),et=T(t,"UL",{"data-svelte-h":!0}),v(et)!=="svelte-r36v8e"&&(et.innerHTML=zt),Jt=b(t),lt=T(t,"P",{"data-svelte-h":!0}),v(lt)!=="svelte-1dhvzk8"&&(lt.textContent=Ot),Rt=b(t),x(nt.$$.fragment,t),jt=b(t),D=T(t,"OL",{start:!0,"data-svelte-h":!0}),v(D)!=="svelte-y8zpl2"&&(D.innerHTML=qt),xt=b(t),x(H.$$.fragment,t),It=b(t),x(st.$$.fragment,t),kt=b(t),it=T(t,"P",{"data-svelte-h":!0}),v(it)!=="svelte-wx07f3"&&(it.textContent=Kt),Bt=b(t),x(at.$$.fragment,t),Gt=b(t),X=T(t,"OL",{start:!0,"data-svelte-h":!0}),v(X)!=="svelte-lfqu8"&&(X.innerHTML=te),At=b(t),x(ot.$$.fragment,t),Et=b(t),rt=T(t,"P",{"data-svelte-h":!0}),v(rt)!=="svelte-y9jz2l"&&(rt.textContent=ee),Nt=b(t),x(Z.$$.fragment,t),Wt=b(t),x(pt.$$.fragment,t),Lt=b(t),ut=T(t,"P",{}),ht(ut).forEach(n),this.h()},h(){Y(e,"name","hf:doc:metadata"),Y(e,"content",Qe),Y(D,"start","2"),Y(X,"start","3")},m(t,r){Ht(document.head,e),s(t,o,r),s(t,l,r),s(t,i,r),I(a,t,r),s(t,f,r),I(m,t,r),s(t,u,r),s(t,p,r),s(t,U,r),s(t,g,r),s(t,M,r),s(t,_,r),s(t,E,r),I(w,t,r),s(t,G,r),s(t,A,r),s(t,$,r),s(t,B,r),s(t,bt,r),I(L,t,r),s(t,yt,r),s(t,Q,r),s(t,$t,r),I(F,t,r),s(t,Ut,r),I(z,t,r),s(t,wt,r),s(t,O,r),s(t,Ct,r),I(V,t,r),s(t,Tt,r),I(q,t,r),s(t,gt,r),s(t,K,r),s(t,_t,r),s(t,tt,r),s(t,vt,r),s(t,et,r),s(t,Jt,r),s(t,lt,r),s(t,Rt,r),I(nt,t,r),s(t,jt,r),s(t,D,r),s(t,xt,r),I(H,t,r),s(t,It,r),I(st,t,r),s(t,kt,r),s(t,it,r),s(t,Bt,r),I(at,t,r),s(t,Gt,r),s(t,X,r),s(t,At,r),I(ot,t,r),s(t,Et,r),s(t,rt,r),s(t,Nt,r),I(Z,t,r),s(t,Wt,r),I(pt,t,r),s(t,Lt,r),s(t,ut,r),Vt=!0},p(t,[r]){const le={};r&2&&(le.$$scope={dirty:r,ctx:t}),w.$set(le);const ne={};r&2&&(ne.$$scope={dirty:r,ctx:t}),L.$set(ne);const se={};r&2&&(se.$$scope={dirty:r,ctx:t}),V.$set(se);const ie={};r&2&&(ie.$$scope={dirty:r,ctx:t}),H.$set(ie);const ae={};r&2&&(ae.$$scope={dirty:r,ctx:t}),Z.$set(ae)},i(t){Vt||(J(a.$$.fragment,t),J(m.$$.fragment,t),J(w.$$.fragment,t),J(L.$$.fragment,t),J(F.$$.fragment,t),J(z.$$.fragment,t),J(V.$$.fragment,t),J(q.$$.fragment,t),J(nt.$$.fragment,t),J(H.$$.fragment,t),J(st.$$.fragment,t),J(at.$$.fragment,t),J(ot.$$.fragment,t),J(Z.$$.fragment,t),J(pt.$$.fragment,t),Vt=!0)},o(t){R(a.$$.fragment,t),R(m.$$.fragment,t),R(w.$$.fragment,t),R(L.$$.fragment,t),R(F.$$.fragment,t),R(z.$$.fragment,t),R(V.$$.fragment,t),R(q.$$.fragment,t),R(nt.$$.fragment,t),R(H.$$.fragment,t),R(st.$$.fragment,t),R(at.$$.fragment,t),R(ot.$$.fragment,t),R(Z.$$.fragment,t),R(pt.$$.fragment,t),Vt=!1},d(t){t&&(n(o),n(l),n(i),n(f),n(u),n(p),n(U),n(g),n(M),n(_),n(E),n(G),n(A),n($),n(B),n(bt),n(yt),n(Q),n($t),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(D),n(xt),n(It),n(kt),n(it),n(Bt),n(Gt),n(X),n(At),n(Et),n(rt),n(Nt),n(Wt),n(Lt),n(ut)),n(e),k(a,t),k(m,t),k(w,t),k(L,t),k(F,t),k(z,t),k(V,t),k(q,t),k(nt,t),k(H,t),k(st,t),k(at,t),k(ot,t),k(Z,t),k(pt,t)}}}const Qe='{"title":"Installation","local":"installation","sections":[{"title":"CUDA","local":"cuda","sections":[{"title":"Compile from source","local":"compile","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 Zt{constructor(e){super(),Yt(this,e,Fe,Se,Xt,{})}}export{nl as component}; | |
Xet Storage Details
- Size:
- 31.2 kB
- Xet hash:
- 46171d3b6d9f2bdfe50bcd8ff734e394d1f53be2c6ab264d91374f521ac7c4f0
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.