Buckets:

HuggingFaceDocBuilder's picture
download
raw
7.73 kB
import{s as Me,n as ke,o as ve}from"../chunks/scheduler.f3b1e791.js";import{S as Le,i as Ce,e as i,s as a,c as p,h as Je,a as o,d as n,b as s,f as me,g as m,j as $,k as B,l as z,m as l,n as c,t as d,o as f,p as u}from"../chunks/index.023a9934.js";import{C as Ue}from"../chunks/CopyLLMTxtMenu.1572fc51.js";import{C as G}from"../chunks/CodeBlock.f7175aa0.js";import{H as ye,E as xe}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.70d656f0.js";function He(ce){let h,A,S,V,b,R,T,O,r,P,de=`<code>kernels</code> has not reached <code>1.0</code> yet. Until then, minor releases may contain
breaking changes. If you depend on <code>kernels</code> in a library or application, we
<strong>strongly recommend pinning a version range</strong> rather than an unbounded
dependency. For example, in <code>pyproject.toml</code>:`,re,y,pe,q,fe=`or equivalently <code>kernels~=0.15</code> (compatible release). This protects your
project from unexpected breakage when a new <code>kernels</code> version is released.`,X,M,ue="Install the <code>kernels</code> package with <code>pip</code> (requires <code>torch&gt;=2.5</code> and CUDA):",Z,k,D,v,he="or with <code>uv</code>",F,L,N,C,$e="or if you want the latest version from the <code>main</code> branch:",Q,J,K,U,Y,x,we=`Some kernels rely on additional packages at runtime (for example,
<a href="https://docs.nvidia.com/cutlass/" rel="nofollow">CUTLASS DSL</a>, <a href="https://einops.rocks/" rel="nofollow">einops</a>,
and <a href="https://github.com/apache/tvm-ffi" rel="nofollow">Apache TVM FFI</a>). The <code>curated</code> extra
installs these commonly-needed dependencies in one go:`,ee,H,te,_,ge=`On XPU (Intel GPU) platforms, use the <code>curated-xpu</code> extra instead, which omits
the CUDA-only dependencies:`,ne,I,le,w,be=`<p>On Windows, we recommend using the Linux version of Torch through
<a href="https://learn.microsoft.com/en-us/windows/wsl/install" rel="nofollow">WSL 2</a>, since
many more kernels support Linux. If you want to use GPU acceleration,
check out the <a href="https://docs.nvidia.com/cuda/wsl-user-guide/index.html#getting-started-with-cuda-on-wsl-2" rel="nofollow">CUDA on WSL</a>
and <a href="https://learn.microsoft.com/en-us/windows/ai/directml/pytorch-wsl" rel="nofollow">PyTorch with DirectML on WSL 2</a>
guides.</p>`,ae,g,Te=`<p>We strongly recommend not using a free-threaded Python build yet.
These builds are not only experimental, but do not support the stable ABI
on Python versions before 3.15. Kernels are compiled with the stable ABI
to support a wide range of Python versions.</p>`,se,j,ie,E,oe;return b=new Ue({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new ye({props:{title:"Installation",local:"installation",headingTag:"h1"}}),y=new G({props:{code:"ZGVwZW5kZW5jaWVzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwJTIya2VybmVscyUzRSUzRDAuMTUlMkMlM0MwLjE2JTIyJTJDJTBBJTVE",highlighted:`<span class="hljs-attr">dependencies</span> = [
<span class="hljs-string">&quot;kernels&gt;=0.15,&lt;0.16&quot;</span>,
]`,lang:"toml",wrap:!1}}),k=new G({props:{code:"cGlwJTIwaW5zdGFsbCUyMGtlcm5lbHM=",highlighted:"pip install kernels",lang:"bash",wrap:!1}}),L=new G({props:{code:"dXYlMjBwaXAlMjBpbnN0YWxsJTIwa2VybmVscw==",highlighted:"uv pip install kernels",lang:"bash",wrap:!1}}),J=new G({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMmtlcm5lbHMlNUJiZW5jaG1hcmslNUQlMjAlNDAlMjBnaXQlMkJodHRwcyUzQSUyRiUyRmdpdGh1Yi5jb20lMkZodWdnaW5nZmFjZSUyRmtlcm5lbHMlMjNzdWJkaXJlY3RvcnklM0RrZXJuZWxzJTIy",highlighted:'pip install <span class="hljs-string">&quot;kernels[benchmark] @ git+https://github.com/huggingface/kernels#subdirectory=kernels&quot;</span>',lang:"bash",wrap:!1}}),U=new ye({props:{title:"Curated installations",local:"curated-installations",headingTag:"h2"}}),H=new G({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMmtlcm5lbHMlNUJjdXJhdGVkJTVEJTIy",highlighted:'pip install <span class="hljs-string">&quot;kernels[curated]&quot;</span>',lang:"bash",wrap:!1}}),I=new G({props:{code:"cGlwJTIwaW5zdGFsbCUyMCUyMmtlcm5lbHMlNUJjdXJhdGVkLXhwdSU1RCUyMg==",highlighted:'pip install <span class="hljs-string">&quot;kernels[curated-xpu]&quot;</span>',lang:"bash",wrap:!1}}),j=new xe({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/installation.md"}}),{c(){h=i("meta"),A=a(),S=i("p"),V=a(),p(b.$$.fragment),R=a(),p(T.$$.fragment),O=a(),r=i("blockquote"),P=i("p"),P.innerHTML=de,re=a(),p(y.$$.fragment),pe=a(),q=i("p"),q.innerHTML=fe,X=a(),M=i("p"),M.innerHTML=ue,Z=a(),p(k.$$.fragment),D=a(),v=i("p"),v.innerHTML=he,F=a(),p(L.$$.fragment),N=a(),C=i("p"),C.innerHTML=$e,Q=a(),p(J.$$.fragment),K=a(),p(U.$$.fragment),Y=a(),x=i("p"),x.innerHTML=we,ee=a(),p(H.$$.fragment),te=a(),_=i("p"),_.innerHTML=ge,ne=a(),p(I.$$.fragment),le=a(),w=i("blockquote"),w.innerHTML=be,ae=a(),g=i("blockquote"),g.innerHTML=Te,se=a(),p(j.$$.fragment),ie=a(),E=i("p"),this.h()},l(e){const t=Je("svelte-u9bgzb",document.head);h=o(t,"META",{name:!0,content:!0}),t.forEach(n),A=s(e),S=o(e,"P",{}),me(S).forEach(n),V=s(e),m(b.$$.fragment,e),R=s(e),m(T.$$.fragment,e),O=s(e),r=o(e,"BLOCKQUOTE",{class:!0});var W=me(r);P=o(W,"P",{"data-svelte-h":!0}),$(P)!=="svelte-6emakj"&&(P.innerHTML=de),re=s(W),m(y.$$.fragment,W),pe=s(W),q=o(W,"P",{"data-svelte-h":!0}),$(q)!=="svelte-12c2da2"&&(q.innerHTML=fe),W.forEach(n),X=s(e),M=o(e,"P",{"data-svelte-h":!0}),$(M)!=="svelte-1wkb7xn"&&(M.innerHTML=ue),Z=s(e),m(k.$$.fragment,e),D=s(e),v=o(e,"P",{"data-svelte-h":!0}),$(v)!=="svelte-oie08r"&&(v.innerHTML=he),F=s(e),m(L.$$.fragment,e),N=s(e),C=o(e,"P",{"data-svelte-h":!0}),$(C)!=="svelte-1wu94em"&&(C.innerHTML=$e),Q=s(e),m(J.$$.fragment,e),K=s(e),m(U.$$.fragment,e),Y=s(e),x=o(e,"P",{"data-svelte-h":!0}),$(x)!=="svelte-b35rlc"&&(x.innerHTML=we),ee=s(e),m(H.$$.fragment,e),te=s(e),_=o(e,"P",{"data-svelte-h":!0}),$(_)!=="svelte-16ri87f"&&(_.innerHTML=ge),ne=s(e),m(I.$$.fragment,e),le=s(e),w=o(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),$(w)!=="svelte-115glw4"&&(w.innerHTML=be),ae=s(e),g=o(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),$(g)!=="svelte-nce4hr"&&(g.innerHTML=Te),se=s(e),m(j.$$.fragment,e),ie=s(e),E=o(e,"P",{}),me(E).forEach(n),this.h()},h(){B(h,"name","hf:doc:metadata"),B(h,"content",_e),B(r,"class","warning"),B(w,"class","important"),B(g,"class","important")},m(e,t){z(document.head,h),l(e,A,t),l(e,S,t),l(e,V,t),c(b,e,t),l(e,R,t),c(T,e,t),l(e,O,t),l(e,r,t),z(r,P),z(r,re),c(y,r,null),z(r,pe),z(r,q),l(e,X,t),l(e,M,t),l(e,Z,t),c(k,e,t),l(e,D,t),l(e,v,t),l(e,F,t),c(L,e,t),l(e,N,t),l(e,C,t),l(e,Q,t),c(J,e,t),l(e,K,t),c(U,e,t),l(e,Y,t),l(e,x,t),l(e,ee,t),c(H,e,t),l(e,te,t),l(e,_,t),l(e,ne,t),c(I,e,t),l(e,le,t),l(e,w,t),l(e,ae,t),l(e,g,t),l(e,se,t),c(j,e,t),l(e,ie,t),l(e,E,t),oe=!0},p:ke,i(e){oe||(d(b.$$.fragment,e),d(T.$$.fragment,e),d(y.$$.fragment,e),d(k.$$.fragment,e),d(L.$$.fragment,e),d(J.$$.fragment,e),d(U.$$.fragment,e),d(H.$$.fragment,e),d(I.$$.fragment,e),d(j.$$.fragment,e),oe=!0)},o(e){f(b.$$.fragment,e),f(T.$$.fragment,e),f(y.$$.fragment,e),f(k.$$.fragment,e),f(L.$$.fragment,e),f(J.$$.fragment,e),f(U.$$.fragment,e),f(H.$$.fragment,e),f(I.$$.fragment,e),f(j.$$.fragment,e),oe=!1},d(e){e&&(n(A),n(S),n(V),n(R),n(O),n(r),n(X),n(M),n(Z),n(D),n(v),n(F),n(N),n(C),n(Q),n(K),n(Y),n(x),n(ee),n(te),n(_),n(ne),n(le),n(w),n(ae),n(g),n(se),n(ie),n(E)),n(h),u(b,e),u(T,e),u(y),u(k,e),u(L,e),u(J,e),u(U,e),u(H,e),u(I,e),u(j,e)}}}const _e='{"title":"Installation","local":"installation","sections":[{"title":"Curated installations","local":"curated-installations","sections":[],"depth":2}],"depth":1}';function Ie(ce){return ve(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Se extends Le{constructor(h){super(),Ce(this,h,Ie,He,Me,{})}}export{Se as component};

Xet Storage Details

Size:
7.73 kB
·
Xet hash:
3626b0c1f4d6e148eb133dc9253b802521057811ec645cc8415cf873ef3721e8

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