Buckets:
| import{s as en,n as tn,o as ln}from"../chunks/scheduler.f3b1e791.js";import{S as sn,i as nn,e as i,s as n,c as r,h as an,a as p,d as l,b as a,f as Wl,g as c,j as o,k as Dl,l as T,m as s,n as u,t as d,o as h,p as M}from"../chunks/index.023a9934.js";import{C as pn,H as m,E as on}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.b7cac204.js";import{C as j}from"../chunks/CodeBlock.725c80b2.js";function rn(Ol){let w,rt,pt,ct,U,ut,I,dt,$,Kl=`Kernels on the Hub must fulfill the requirements outlined on this page. By | |
| ensuring kernels are compliant, they can be used on a wide range of Linux | |
| systems and Torch builds.`,ht,k,es=`<a href="https://github.com/huggingface/kernels/discussions/categories/kernel-builder" rel="nofollow">Join us on GitHub Discussions</a> | |
| for questions and discussions about building kernels!`,Mt,g,mt,v,ts=`Compliant kernels are published as <code>kernel</code>-type repositories on the Hub | |
| (the first-class kernel repository type). New uploads via <code>kernel-builder</code> | |
| default to this type; see the <a href="migration">migration guide</a> if you | |
| maintain an older <code>model</code>-type kernel repository.`,yt,C,Tt,x,ls=`<code>kernels</code> only loads kernels from a curated set of trusted publishers by | |
| default. Loading from any other publisher raises an error unless the caller | |
| opts in with <code>trust_remote_code=True</code>:`,jt,_,ft,H,ss=`The Hub also exposes a <code>trustedKernelPublisher</code> flag on the kernel API and | |
| displays a corresponding badge in the UI.`,Jt,L,wt,q,ns=`A kernel repository on the Hub must contain a <code>build</code> directory. This | |
| directory contains build variants of a kernel in the form of directories | |
| following the template | |
| <code><framework><version>-cxx<abiver>-<cu><cudaver>-<arch>-<os></code>. | |
| For example <code>build/torch26-cxx98-cu118-x86_64-linux</code>.`,bt,B,as=`The kernel is in the build variant directory and must contain a | |
| <code>__init__.py</code> file. For compatibility with older versions of the | |
| <code>kernels</code> package, each variant directory must also contain a single | |
| directory with the same name as the repository (replacing <code>-</code> by <code>_</code>). | |
| For instance, kernels in the <code>kernels-community/activation</code> repository | |
| have a directory like <code>build/<variant>/activation</code>. This directory | |
| must contain an <code>__init__.py</code> file that exports the same symbols as | |
| <code>__init__.py</code> in the build variant directory <code>build/<variant></code>. | |
| <a href="https://huggingface.co/kernels-test/flattened-build/blob/main/build/torch-universal/flattened_build/__init__.py" rel="nofollow">This example</a> | |
| shows how this can be done. This compatibility directory is | |
| automatically created by <code>kernel-builder</code>.`,Ut,A,It,G,is=`A kernel can be compliant for a specific compute framework (e.g. CUDA) or | |
| architecture (e.g. x86_64). For compliance with a compute framework and | |
| architecture combination, all the variants from the <a href="builder/build-variants">build variant list</a> | |
| must be available for that combination.`,$t,Z,kt,E,ps=`The build variant directory must contain a <code>metadata.json</code> file with kernel | |
| metadata. Currently the following top-level keys are supported:`,gt,N,os=`<li><code>id</code> (<code>str</code>, required): a unique identifier for the kernel. This | |
| identifier must also be a valid Python module name. If the kernel | |
| registers Torch ops, they must be registered as <code>torch.ops.<id></code></li> <li><code>name</code> (<code>str</code>, required): then name of the kernel. Replacing dashes | |
| by underscores should result in the module name of the kernel.</li> <li><code>version</code> (<code>int</code>, required): the kernel version number.</li> <li><code>license</code> (<code>str</code>, required): the kernel license in. Refer to the | |
| list of <a href="https://huggingface.co/docs/hub/repositories-licenses" rel="nofollow">supported license identifiers</a>.</li> <li><code>upstream</code> (<code>str</code>, optional): Git-compatible URL (passable to <code>git clone</code>) | |
| of the original upstream repository where the kernel source code comes from.</li> <li><code>source</code> (<code>str</code>, optional): Git-compatible URL (passable to <code>git clone</code>) | |
| of the kernel-builder formatted source repository (must contain <code>build.toml</code> | |
| and <code>flake.nix</code>).</li> <li><code>backend</code> (<code>dict</code>, required): information about the compute backend that | |
| this build variant supports.</li> <li><code>digest</code> (<code>Digest</code>, required): hash digest of the kernel files.</li> <li><code>python-depends</code> (<code>list[str]</code>, optional): list of Python dependencies | |
| from a curated set of Python dependencies.</li>`,vt,Q,rs="Example <code>metadata.json</code>:",Ct,R,xt,V,cs="The <code>metadata.json</code> file is generated automatically by <code>kernel-builder</code>.",_t,W,Ht,z,us="The <code>backend</code> specifies a dictionary of the following form:",Lt,S,qt,X,ds=`The backend <code>type</code> must be one of <code>cann</code>, <code>cpu</code>, <code>cuda</code>, <code>metal</code>, <code>neuron</code>, | |
| <code>rocm</code>, or <code>xpu</code>. For CUDA and ROCm, the supported architectures must | |
| be specified in the <code>archs</code> field.`,Bt,P,At,Y,hs="You can specify Python dependencies that your kernel requires. Dependencies can be either general (required for all backends) or backend-specific (required only for certain compute backends like CUDA, ROCm, XPU, Metal, or CPU).",Gt,F,Zt,D,Ms="For dependencies required regardless of the backend, use the <code>python-depends</code> field:",Et,O,Nt,K,Qt,ee,ms="For dependencies that are only needed for specific backends, use the <code>python-depends-backends</code> field:",Rt,te,Vt,le,Wt,se,ys="You can specify both general and backend-specific dependencies:",zt,ne,St,ae,Xt,ie,Ts="The following dependencies are currently allowed:",Pt,pe,js="<strong>General dependencies:</strong>",Yt,oe,fs="<li><code>einops</code></li>",Ft,re,Js="<strong>Backend-specific dependencies:</strong>",Dt,ce,ws="<li>CUDA: <code>nvidia-cutlass-dsl</code></li> <li>XPU: <code>onednn</code></li>",Ot,ue,bs="Dependencies are validated based on the backend being used. When a kernel is loaded, only the dependencies relevant to the active backend are checked.",Kt,de,el,he,Us=`Kernels are versioned using a major version. The kernel revisions of a | |
| version are stored in a branch of the form <code>v<version></code>. Each build | |
| variant will also have the kernel version in <code>metadata.json</code>.`,tl,Me,Is="The version <strong>must</strong> be bumped in the following cases:",ll,me,$s=`<li>The kernel API is changed in an incompatible way.</li> <li>The API is extended in a compatible way, but not all build variants | |
| receive the extension (e.g. because they are for older Torch versions | |
| that are not supported by <code>kernel-builder</code> anymore).</li>`,sl,ye,ks=`In both cases, build variants that are not updated must be removed from | |
| the new version’s branch.`,nl,b,gs=`<p>By convention, we reserve version <code>0</code> for kernels that are still in | |
| alpha or beta stage and are not recommended for production use (e.g. | |
| because the API is still changing regularly or there are still too | |
| many issues).</p>`,al,Te,il,je,vs=`Kernels will typically contain a native Python module with precompiled | |
| compute kernels and bindings. This module must fulfill the requirements | |
| outlined in this section. For all operating systems, a kernel must not | |
| have dynamic library dependencies outside:`,pl,fe,Cs="<li>Torch;</li> <li>CUDA/ROCm libraries installed as dependencies of Torch.</li>",ol,Je,rl,we,xs=`The Kernel Hub also encourages to write the kernels in a <code>torch.compile</code> | |
| compliant way. This helps to ensure that the kernels are compatible with | |
| <code>torch.compile</code> without introducing any graph breaks and triggering | |
| recompilation which can limit the benefits of compilation.`,cl,be,_s=`<a href="https://github.com/huggingface/kernels/blob/f83b4da6b7f6b171b47bb9bf96271ae2273bc9d3/builder/examples/relu-backprop-compile/tests/test_relu.py#L162" rel="nofollow">Here</a> | |
| is a simple test example which checks for graph breaks and | |
| recompilation triggers during <code>torch.compile</code>.`,ul,Ue,dl,Ie,Hs=`<li>Use <a href="https://docs.python.org/3/c-api/stable.html#stable-application-binary-interface" rel="nofollow">ABI3/Limited API</a> | |
| for compatibility with Python 3.9 and later.</li> <li>Compatible with <a href="https://github.com/pypa/manylinux?tab=readme-ov-file#manylinux_2_28-almalinux-8-based" rel="nofollow"><code>manylinux_2_28</code></a>. | |
| This means that the extension <strong>must not</strong> use symbols versions higher than: | |
| <ul><li>GLIBC 2.28</li> <li>GLIBCXX 3.4.24</li> <li>CXXABI 1.3.11</li> <li>GCC 7.0.0</li></ul></li>`,hl,$e,Ls="These requirements can be checked with the ABI checker (see below).",Ml,ke,ml,ge,qs=`<li>Use <a href="https://docs.python.org/3/c-api/stable.html#stable-application-binary-interface" rel="nofollow">ABI3/Limited API</a> | |
| for compatibility with Python 3.9 and later.</li> <li>macOS deployment target 15.0.</li> <li>Metal 3.0 (<code>-std=metal3.0</code>).</li>`,yl,ve,Bs="The ABI3 requirement can be checked with the ABI checker (see below).",Tl,Ce,jl,xe,As=`The manylinux_2_28 and Python ABI 3.9 version requirements can be checked with | |
| <code>kernel-builder check-abi</code>:`,fl,_e,Jl,He,wl,Le,Gs=`Torch native extension functions must be <a href="https://pytorch.org/tutorials/advanced/cpp_custom_ops.html#cpp-custom-ops-tutorial" rel="nofollow">registered</a> | |
| in <code>torch.ops.<namespace></code>. Since we allow loading of multiple versions of | |
| a module in the same Python process, <code>namespace</code> must be unique for each | |
| version of a kernel. Failing to do so will create clashes when different | |
| versions of the same kernel are loaded. Two suggested ways of doing this | |
| are:`,bl,qe,Zs=`<li>Appending a truncated SHA-1 hash of the git commit that the kernel was | |
| built from to the name of the extension.</li> <li>Appending random material to the name of the extension.</li>`,Ul,Be,Es=`<strong>Note:</strong> we recommend against appending a version number or git tag. | |
| Version numbers are typically not bumped on each commit, so users | |
| might use two different commits that happen to have the same version | |
| number. Git tags are not stable, so they do not provide a good way | |
| of guaranteeing uniqueness of the namespace.`,Il,Ae,$l,Ge,Ns=`A kernel can provide layers in addition to kernel functions. A layer from | |
| the Hub can replace the <code>forward</code> method of an existing layer for a certain | |
| device type. This makes it possible to provide more performant kernels for | |
| existing layers. See the <a href="layers">layers documentation</a> for more information | |
| on how to use layers.`,kl,Ze,gl,Ee,Qs=`To make the extension of layers safe, the layers must fulfill the following | |
| requirements:`,vl,Ne,Rs=`<li>The layers are subclasses of <code>torch.nn.Module</code>.</li> <li>The layers are pure, meaning that they do not have their own state. This | |
| means that: | |
| <ul><li>The layer must not define its own constructor.</li> <li>The layer must not use class variables.</li></ul></li> <li>No other methods must be defined than <code>forward</code>.</li> <li>The <code>forward</code> method has a signature that is compatible with the | |
| <code>forward</code> method that it is extending.</li>`,Cl,Qe,Vs="There are two exceptions to the <em>no class variables rule</em>:",xl,Re,Ws=`<li>The <code>has_backward</code> variable can be used to indicate whether the layer has | |
| a backward pass implemented (<code>True</code> when absent).</li> <li>The <code>can_torch_compile</code> variable can be used to indicate whether the layer | |
| supports <code>torch.compile</code> (<code>False</code> when absent).</li>`,_l,Ve,zs="This is an example of a pure layer:",Hl,We,Ll,ze,Ss=`For some layers, the <code>forward</code> method has to use state from the adopting class. | |
| In these cases, we recommend to use type annotations to indicate what member | |
| variables are expected. For instance:`,ql,Se,Bl,Xe,Xs=`This layer expects the adopting layer to have <code>weight</code> and <code>variance_epsilon</code> | |
| member variables and uses them in the <code>forward</code> method.`,Al,Pe,Gl,Ye,Ps=`To accommodate portable loading, <code>layers</code> must be defined in the main | |
| <code>__init__.py</code> file. For example:`,Zl,Fe,El,De,Nl,f,tt,Ys="<p>Python code must be compatible with Python 3.9 and later.</p>",zl,y,lt,Fs=`All Python code imports from the kernel itself must be relative. So, | |
| for instance if in the example kernel <code>example</code>, | |
| <code>module_b</code> needs a function from <code>module_a</code>, import as:`,Sl,Oe,Xl,st,Ds="<strong>Never use:</strong>",Pl,Ke,Yl,nt,Os=`The latter would import from the module <code>example</code> that is in Python’s | |
| global module dict. However, since we allow loading multiple versions | |
| of a module, we uniquely name the module.`,Fl,at,Ks=`<p>Only modules from the Python standard library, Torch, or the kernel itself | |
| can be imported.</p>`,Ql,et,Rl,ot,Vl;return U=new pn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),I=new m({props:{title:"Kernel requirements",local:"kernel-requirements",headingTag:"h1"}}),g=new m({props:{title:"Repository type",local:"repository-type",headingTag:"h2"}}),C=new m({props:{title:"Trusted publishers",local:"trusted-publishers",headingTag:"h2"}}),_=new j({props:{code:"JTIzJTIwVHJ1c3RlZCUyMHB1Ymxpc2hlciUzQSUyMHdvcmtzJTIwd2l0aG91dCUyMG9wdC1pbi4lMEFnZXRfa2VybmVsKCUyMmtlcm5lbHMtY29tbXVuaXR5JTJGYWN0aXZhdGlvbiUyMiUyQyUyMHZlcnNpb24lM0QxKSUwQSUwQSUyMyUyMFVudHJ1c3RlZCUyMHB1Ymxpc2hlciUzQSUyMG11c3QlMjBvcHQlMjBpbiUyMGV4cGxpY2l0bHkuJTBBZ2V0X2tlcm5lbCglMjJzb21lLW90aGVyLW9yZyUyRm15LWtlcm5lbCUyMiUyQyUyMHZlcnNpb24lM0QxJTJDJTIwdHJ1c3RfcmVtb3RlX2NvZGUlM0RUcnVlKQ==",highlighted:`<span class="hljs-comment"># Trusted publisher: works without opt-in.</span> | |
| get_kernel(<span class="hljs-string">"kernels-community/activation"</span>, version=<span class="hljs-number">1</span>) | |
| <span class="hljs-comment"># Untrusted publisher: must opt in explicitly.</span> | |
| get_kernel(<span class="hljs-string">"some-other-org/my-kernel"</span>, version=<span class="hljs-number">1</span>, trust_remote_code=<span class="hljs-literal">True</span>)`,lang:"python",wrap:!1}}),L=new m({props:{title:"Directory layout",local:"directory-layout",headingTag:"h2"}}),A=new m({props:{title:"Build variants",local:"build-variants",headingTag:"h2"}}),Z=new m({props:{title:"Kernel metadata",local:"kernel-metadata",headingTag:"h2"}}),R=new j({props:{code:"JTdCJTBBJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMm15a2VybmVsJTIyJTJDJTBBJTIwJTIwJTIyaWQlMjIlM0ElMjAlMjJfbXlrZXJuZWxfY3VkYV83YTRlNWE3JTIyJTJDJTBBJTIwJTIwJTIydmVyc2lvbiUyMiUzQSUyMDElMkMlMEElMjAlMjAlMjJsaWNlbnNlJTIyJTNBJTIwJTIyQXBhY2hlLTIuMCUyMiUyQyUwQSUyMCUyMCUyMnB5dGhvbi1kZXBlbmRzJTIyJTNBJTIwJTVCJTIyZWlub3BzJTIyJTVEJTJDJTBBJTIwJTIwJTIyYmFja2VuZCUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXJjaHMlMjIlM0ElMjAlNUIlMjI3LjAlMjIlMkMlMjAlMjI3LjIlMjIlMkMlMjAlMjI3LjUlMjIlMkMlMjAlMjI4LjAlMjIlMkMlMjAlMjI4LjYlMjIlMkMlMjAlMjI4LjclMjIlMkMlMjAlMjI4LjklMjIlMkMlMjAlMjI5LjAlMkJQVFglMjIlNUQlMEElMjAlMjAlN0QlMkMlMEElMjAlMjAlMjJkaWdlc3QlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjJhbGdvcml0aG0lMjIlM0ElMjAlMjJzaGEyNTYlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjJmaWxlcyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMl9faW5pdF9fLnB5JTIyJTNBJTIwJTIyeExNYkFSVGNUbDhMJTJGbTFrSkxjJTJGaCUyRlFMNEt6dDc3MkY4NzJhNDZwZlJHSSUzRCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMl9teWtlcm5lbF9jdWRhXzc2NDU4MTZfZGlydHkuYWJpMy5zbyUyMiUzQSUyMCUyMnZ0ZHp6VG9sb0gzOEhaa1ZzN3NGRWY2OVFGRHhST3VQc0JBb25kM0ppYzAlM0QlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjJfb3BzLnB5JTIyJTNBJTIwJTIySHJwNWFGNG8wZUhTdHR3NHNRR3NiQkFYRnF2TEo0Mlk5WUoyS2txdlpoZyUzRCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMm15a2VybmVsJTJGX19pbml0X18ucHklMjIlM0ElMjAlMjJERllQbHJoWHdZakVxQ2wlMkY4bjBTbVdHWlY4TkZtbDVEUGhNaktmdjk4R1klM0QlMjIlMEElMjAlMjAlMjAlMjAlN0QlMEElMjAlMjAlN0QlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"name"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"mykernel"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"id"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"_mykernel_cuda_7a4e5a7"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"license"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Apache-2.0"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"python-depends"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"einops"</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"backend"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"type"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"cuda"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"archs"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"7.0"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"7.2"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"7.5"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.0"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.6"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.7"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.9"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"9.0+PTX"</span><span class="hljs-punctuation">]</span> | |
| <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"digest"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"algorithm"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"sha256"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"files"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"__init__.py"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"xLMbARTcTl8L/m1kJLc/h/QL4Kzt772F872a46pfRGI="</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"_mykernel_cuda_7645816_dirty.abi3.so"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"vtdzzToloH38HZkVs7sFEf69QFDxROuPsBAond3Jic0="</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"_ops.py"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Hrp5aF4o0eHSttw4sQGsbBAXFqvLJ42Y9YJ2KkqvZhg="</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"mykernel/__init__.py"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"DFYPlrhXwYjEqCl/8n0SmWGZV8NFml5DPhMjKfv98GY="</span> | |
| <span class="hljs-punctuation">}</span> | |
| <span class="hljs-punctuation">}</span> | |
| <span class="hljs-punctuation">}</span>`,lang:"json",wrap:!1}}),W=new m({props:{title:"Backend",local:"backend",headingTag:"h2"}}),S=new j({props:{code:"JTdCJTBBJTIwJTIwJTIzJTIwLi4uJTBBJTIwJTIwJTIyYmFja2VuZCUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXJjaHMlMjIlM0ElMjAlNUIlMjI3LjAlMjIlMkMlMjAlMjI3LjIlMjIlMkMlMjAlMjI3LjUlMjIlMkMlMjAlMjI4LjAlMjIlMkMlMjAlMjI4LjYlMjIlMkMlMjAlMjI4LjclMjIlMkMlMjAlMjI4LjklMjIlMkMlMjAlMjI5LjAlMkJQVFglMjIlNUQlMEElMjAlMjAlN0QlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span> | |
| # ... | |
| <span class="hljs-attr">"backend"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"type"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"cuda"</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"archs"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"7.0"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"7.2"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"7.5"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.0"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.6"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.7"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"8.9"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"9.0+PTX"</span><span class="hljs-punctuation">]</span> | |
| <span class="hljs-punctuation">}</span> | |
| <span class="hljs-punctuation">}</span>`,lang:"json",wrap:!1}}),P=new m({props:{title:"Python dependencies",local:"python-dependencies",headingTag:"h3"}}),F=new m({props:{title:"General dependencies",local:"general-dependencies",headingTag:"h4"}}),O=new j({props:{code:"JTdCJTBBJTIwJTIwJTIycHl0aG9uLWRlcGVuZHMlMjIlM0ElMjAlNUIlMjJlaW5vcHMlMjIlNUQlMEElN0Q=",highlighted:`<span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"python-depends"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"einops"</span><span class="hljs-punctuation">]</span> | |
| <span class="hljs-punctuation">}</span>`,lang:"json",wrap:!1}}),K=new m({props:{title:"Backend-specific dependencies",local:"backend-specific-dependencies",headingTag:"h4"}}),te=new j({props:{code:"JTdCJTBBJTIwJTIwJTIycHl0aG9uLWRlcGVuZHMtYmFja2VuZHMlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjJjdWRhJTIyJTNBJTIwJTVCJTIybnZpZGlhLWN1dGxhc3MtZHNsJTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIyeHB1JTIyJTNBJTIwJTVCJTIyb25lZG5uJTIyJTVEJTBBJTIwJTIwJTdEJTBBJTdE",highlighted:`<span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"python-depends-backends"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"cuda"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"nvidia-cutlass-dsl"</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"xpu"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"onednn"</span><span class="hljs-punctuation">]</span> | |
| <span class="hljs-punctuation">}</span> | |
| <span class="hljs-punctuation">}</span>`,lang:"json",wrap:!1}}),le=new m({props:{title:"Combined example",local:"combined-example",headingTag:"h4"}}),ne=new j({props:{code:"JTdCJTBBJTIwJTIwJTIycHl0aG9uLWRlcGVuZHMlMjIlM0ElMjAlNUIlMjJlaW5vcHMlMjIlNUQlMkMlMEElMjAlMjAlMjJweXRob24tZGVwZW5kcy1iYWNrZW5kcyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMmN1ZGElMjIlM0ElMjAlNUIlMjJudmlkaWEtY3V0bGFzcy1kc2wlMjIlNUQlMEElMjAlMjAlN0QlMkMlMEElMjAlMjAlMjJ2ZXJzaW9uJTIyJTNBJTIwMSUwQSU3RA==",highlighted:`<span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"python-depends"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"einops"</span><span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"python-depends-backends"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> | |
| <span class="hljs-attr">"cuda"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span><span class="hljs-string">"nvidia-cutlass-dsl"</span><span class="hljs-punctuation">]</span> | |
| <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span> | |
| <span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span> | |
| <span class="hljs-punctuation">}</span>`,lang:"json",wrap:!1}}),ae=new m({props:{title:"Allowed dependencies",local:"allowed-dependencies",headingTag:"h4"}}),de=new m({props:{title:"Versioning",local:"versioning",headingTag:"h2"}}),Te=new m({props:{title:"Native Python module",local:"native-python-module",headingTag:"h2"}}),Je=new m({props:{title:"Compatibility with torch.compile",local:"compatibility-with-torchcompile",headingTag:"h2"}}),Ue=new m({props:{title:"Linux",local:"linux",headingTag:"h3"}}),ke=new m({props:{title:"macOS",local:"macos",headingTag:"h3"}}),Ce=new m({props:{title:"ABI checker",local:"abi-checker",headingTag:"h3"}}),_e=new j({props:{code:"JTI0JTIwa2VybmVsLWJ1aWxkZXIlMjBjaGVjay1hYmklMjBleGFtcGxlcyUyRmtlcm5lbHMlMkZyZWx1JTBBJUYwJTlGJTkwJThEJTIwQ2hlY2tpbmclMjBmb3IlMjBjb21wYXRpYmlsaXR5JTIwd2l0aCUyMG1hbnlsaW51eF8yXzI4JTIwYW5kJTIwUHl0aG9uJTIwQUJJJTIwdmVyc2lvbiUyMDMuOSUzQSUyMCUyRmhvbWUlMkZkYW5pZWwlMkZnaXQlMkZrZXJuZWxzJTJGZXhhbXBsZXMlMkZrZXJuZWxzJTJGcmVsdSUyRnJlc3VsdCUyRnRvcmNoMjExLWNwdS14ODZfNjQtbGludXglMkZfcmVsdV9jcHVfMzBkYzBhZV9kaXJ0eS5hYmkzLnNvJTBBJUUyJTlDJTg1JTIwTm8lMjBjb21wYXRpYmlsaXR5JTIwaXNzdWVzJTIwZm91bmQlMEElRjAlOUYlOTAlOEQlMjBDaGVja2luZyUyMGZvciUyMGNvbXBhdGliaWxpdHklMjB3aXRoJTIwbWFueWxpbnV4XzJfMjglMjBhbmQlMjBQeXRob24lMjBBQkklMjB2ZXJzaW9uJTIwMy45JTNBJTIwJTJGaG9tZSUyRmRhbmllbCUyRmdpdCUyRmtlcm5lbHMlMkZleGFtcGxlcyUyRmtlcm5lbHMlMkZyZWx1JTJGcmVzdWx0JTJGdG9yY2gyMTEtY3UxMjYteDg2XzY0LWxpbnV4JTJGX3JlbHVfY3VkYV8zMGRjMGFlX2RpcnR5LmFiaTMuc28lMEElRTIlOUMlODUlMjBObyUyMGNvbXBhdGliaWxpdHklMjBpc3N1ZXMlMjBmb3VuZCUwQSVGMCU5RiU5MCU4RCUyMENoZWNraW5nJTIwZm9yJTIwY29tcGF0aWJpbGl0eSUyMHdpdGglMjBtYW55bGludXhfMl8yOCUyMGFuZCUyMFB5dGhvbiUyMEFCSSUyMHZlcnNpb24lMjAzLjklM0ElMjAlMkZob21lJTJGZGFuaWVsJTJGZ2l0JTJGa2VybmVscyUyRmV4YW1wbGVzJTJGa2VybmVscyUyRnJlbHUlMkZyZXN1bHQlMkZ0b3JjaDIxMS1jdTEyOC14ODZfNjQtbGludXglMkZfcmVsdV9jdWRhXzMwZGMwYWVfZGlydHkuYWJpMy5zbyUwQSVFMiU5QyU4NSUyME5vJTIwY29tcGF0aWJpbGl0eSUyMGlzc3VlcyUyMGZvdW5kJTBBJUYwJTlGJTkwJThEJTIwQ2hlY2tpbmclMjBmb3IlMjBjb21wYXRpYmlsaXR5JTIwd2l0aCUyMG1hbnlsaW51eF8yXzI4JTIwYW5kJTIwUHl0aG9uJTIwQUJJJTIwdmVyc2lvbiUyMDMuOSUzQSUyMCUyRmhvbWUlMkZkYW5pZWwlMkZnaXQlMkZrZXJuZWxzJTJGZXhhbXBsZXMlMkZrZXJuZWxzJTJGcmVsdSUyRnJlc3VsdCUyRnRvcmNoMjExLWN1MTMwLXg4Nl82NC1saW51eCUyRl9yZWx1X2N1ZGFfMzBkYzBhZV9kaXJ0eS5hYmkzLnNvJTBBJUUyJTlDJTg1JTIwTm8lMjBjb21wYXRpYmlsaXR5JTIwaXNzdWVzJTIwZm91bmQlMEElNUIuLi4lNUQ=",highlighted:`$ kernel-builder check-abi examples/kernels/relu | |
| 🐍 Checking <span class="hljs-keyword">for</span> compatibility with manylinux_2_28 and Python ABI version 3.9: /home/daniel/git/kernels/examples/kernels/relu/result/torch211-cpu-x86_64-linux/_relu_cpu_30dc0ae_dirty.abi3.so | |
| ✅ No compatibility issues found | |
| 🐍 Checking <span class="hljs-keyword">for</span> compatibility with manylinux_2_28 and Python ABI version 3.9: /home/daniel/git/kernels/examples/kernels/relu/result/torch211-cu126-x86_64-linux/_relu_cuda_30dc0ae_dirty.abi3.so | |
| ✅ No compatibility issues found | |
| 🐍 Checking <span class="hljs-keyword">for</span> compatibility with manylinux_2_28 and Python ABI version 3.9: /home/daniel/git/kernels/examples/kernels/relu/result/torch211-cu128-x86_64-linux/_relu_cuda_30dc0ae_dirty.abi3.so | |
| ✅ No compatibility issues found | |
| 🐍 Checking <span class="hljs-keyword">for</span> compatibility with manylinux_2_28 and Python ABI version 3.9: /home/daniel/git/kernels/examples/kernels/relu/result/torch211-cu130-x86_64-linux/_relu_cuda_30dc0ae_dirty.abi3.so | |
| ✅ No compatibility issues found | |
| [...]`,lang:"bash",wrap:!1}}),He=new m({props:{title:"Torch extension",local:"torch-extension",headingTag:"h2"}}),Ae=new m({props:{title:"Layers",local:"layers",headingTag:"h2"}}),Ze=new m({props:{title:"Writing layers",local:"writing-layers",headingTag:"h3"}}),We=new j({props:{code:"Y2xhc3MlMjBTaWx1QW5kTXVsKG5uLk1vZHVsZSklM0ElMEElMjAlMjAlMjAlMjAlMjMlMjBUaGlzJTIwbGF5ZXIlMjBkb2VzJTIwbm90JTIwaW1wbGVtZW50JTIwYmFja3dhcmQuJTBBJTIwJTIwJTIwJTIwaGFzX2JhY2t3YXJkJTNBJTIwYm9vbCUyMCUzRCUyMEZhbHNlJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIweCUzQSUyMHRvcmNoLlRlbnNvciklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBkJTIwJTNEJTIweC5zaGFwZSU1Qi0xJTVEJTIwJTJGJTJGJTIwMiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG91dHB1dF9zaGFwZSUyMCUzRCUyMHguc2hhcGUlNUIlM0EtMSU1RCUyMCUyQiUyMChkJTJDKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG91dCUyMCUzRCUyMHRvcmNoLmVtcHR5KG91dHB1dF9zaGFwZSUyQyUyMGR0eXBlJTNEeC5kdHlwZSUyQyUyMGRldmljZSUzRHguZGV2aWNlKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMG9wcy5zaWx1X2FuZF9tdWwob3V0JTJDJTIweCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBvdXQ=",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">SiluAndMul</span>(nn.Module): | |
| <span class="hljs-comment"># This layer does not implement backward.</span> | |
| has_backward: <span class="hljs-built_in">bool</span> = <span class="hljs-literal">False</span> | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>): | |
| d = x.shape[-<span class="hljs-number">1</span>] // <span class="hljs-number">2</span> | |
| output_shape = x.shape[:-<span class="hljs-number">1</span>] + (d,) | |
| out = torch.empty(output_shape, dtype=x.dtype, device=x.device) | |
| ops.silu_and_mul(out, x) | |
| <span class="hljs-keyword">return</span> out`,lang:"python",wrap:!1}}),Se=new j({props:{code:"Y2xhc3MlMjBMbGFtYVJNU05vcm0obm4uTW9kdWxlKSUzQSUwQSUyMCUyMCUyMCUyMHdlaWdodCUzQSUyMHRvcmNoLlRlbnNvciUwQSUyMCUyMCUyMCUyMHZhcmlhbmNlX2Vwc2lsb24lM0ElMjBmbG9hdCUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMGhpZGRlbl9zdGF0ZXMlM0ElMjB0b3JjaC5UZW5zb3IpJTIwLSUzRSUyMHRvcmNoLlRlbnNvciUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMHJtc19ub3JtX2ZuKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGhpZGRlbl9zdGF0ZXMlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBzZWxmLndlaWdodCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGJpYXMlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzaWR1YWwlM0ROb25lJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZXBzJTNEc2VsZi52YXJpYW5jZV9lcHNpbG9uJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZHJvcG91dF9wJTNEMC4wJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcHJlbm9ybSUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzaWR1YWxfaW5fZnAzMiUzREZhbHNlJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKQ==",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">LlamaRMSNorm</span>(nn.Module): | |
| weight: torch.Tensor | |
| variance_epsilon: <span class="hljs-built_in">float</span> | |
| <span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, hidden_states: torch.Tensor</span>) -> torch.Tensor: | |
| <span class="hljs-keyword">return</span> rms_norm_fn( | |
| hidden_states, | |
| self.weight, | |
| bias=<span class="hljs-literal">None</span>, | |
| residual=<span class="hljs-literal">None</span>, | |
| eps=self.variance_epsilon, | |
| dropout_p=<span class="hljs-number">0.0</span>, | |
| prenorm=<span class="hljs-literal">False</span>, | |
| residual_in_fp32=<span class="hljs-literal">False</span>, | |
| )`,lang:"python",wrap:!1}}),Pe=new m({props:{title:"Exporting layers",local:"exporting-layers",headingTag:"h3"}}),Fe=new j({props:{code:"ZnJvbSUyMC4lMjBpbXBvcnQlMjBsYXllcnMlMEElMEFfX2FsbF9fJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIzJTIwLi4uJTBBJTIwJTIwJTIybGF5ZXJzJTIyJTBBJTIwJTIwJTIzJTIwLi4uJTBBJTVE",highlighted:`<span class="hljs-keyword">from</span> . <span class="hljs-keyword">import</span> layers | |
| __all__ = [ | |
| <span class="hljs-comment"># ...</span> | |
| <span class="hljs-string">"layers"</span> | |
| <span class="hljs-comment"># ...</span> | |
| ]`,lang:"python",wrap:!1}}),De=new m({props:{title:"Python requirements",local:"python-requirements",headingTag:"h2"}}),Oe=new j({props:{code:"ZnJvbSUyMC5tb2R1bGVfYSUyMGltcG9ydCUyMGZvbw==",highlighted:'<span class="hljs-keyword">from</span> .module_a <span class="hljs-keyword">import</span> foo',lang:"python",wrap:!1}}),Ke=new j({props:{code:"JTIzJTIwRE8lMjBOT1QlMjBETyUyMFRISVMhJTBBJTBBZnJvbSUyMGV4YW1wbGUubW9kdWxlX2ElMjBpbXBvcnQlMjBmb28=",highlighted:`<span class="hljs-comment"># DO NOT DO THIS!</span> | |
| <span class="hljs-keyword">from</span> example.module_a <span class="hljs-keyword">import</span> foo`,lang:"python",wrap:!1}}),et=new on({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/kernel-requirements.md"}}),{c(){w=i("meta"),rt=n(),pt=i("p"),ct=n(),r(U.$$.fragment),ut=n(),r(I.$$.fragment),dt=n(),$=i("p"),$.textContent=Kl,ht=n(),k=i("p"),k.innerHTML=es,Mt=n(),r(g.$$.fragment),mt=n(),v=i("p"),v.innerHTML=ts,yt=n(),r(C.$$.fragment),Tt=n(),x=i("p"),x.innerHTML=ls,jt=n(),r(_.$$.fragment),ft=n(),H=i("p"),H.innerHTML=ss,Jt=n(),r(L.$$.fragment),wt=n(),q=i("p"),q.innerHTML=ns,bt=n(),B=i("p"),B.innerHTML=as,Ut=n(),r(A.$$.fragment),It=n(),G=i("p"),G.innerHTML=is,$t=n(),r(Z.$$.fragment),kt=n(),E=i("p"),E.innerHTML=ps,gt=n(),N=i("ul"),N.innerHTML=os,vt=n(),Q=i("p"),Q.innerHTML=rs,Ct=n(),r(R.$$.fragment),xt=n(),V=i("p"),V.innerHTML=cs,_t=n(),r(W.$$.fragment),Ht=n(),z=i("p"),z.innerHTML=us,Lt=n(),r(S.$$.fragment),qt=n(),X=i("p"),X.innerHTML=ds,Bt=n(),r(P.$$.fragment),At=n(),Y=i("p"),Y.textContent=hs,Gt=n(),r(F.$$.fragment),Zt=n(),D=i("p"),D.innerHTML=Ms,Et=n(),r(O.$$.fragment),Nt=n(),r(K.$$.fragment),Qt=n(),ee=i("p"),ee.innerHTML=ms,Rt=n(),r(te.$$.fragment),Vt=n(),r(le.$$.fragment),Wt=n(),se=i("p"),se.textContent=ys,zt=n(),r(ne.$$.fragment),St=n(),r(ae.$$.fragment),Xt=n(),ie=i("p"),ie.textContent=Ts,Pt=n(),pe=i("p"),pe.innerHTML=js,Yt=n(),oe=i("ul"),oe.innerHTML=fs,Ft=n(),re=i("p"),re.innerHTML=Js,Dt=n(),ce=i("ul"),ce.innerHTML=ws,Ot=n(),ue=i("p"),ue.textContent=bs,Kt=n(),r(de.$$.fragment),el=n(),he=i("p"),he.innerHTML=Us,tl=n(),Me=i("p"),Me.innerHTML=Is,ll=n(),me=i("ul"),me.innerHTML=$s,sl=n(),ye=i("p"),ye.textContent=ks,nl=n(),b=i("blockquote"),b.innerHTML=gs,al=n(),r(Te.$$.fragment),il=n(),je=i("p"),je.textContent=vs,pl=n(),fe=i("ul"),fe.innerHTML=Cs,ol=n(),r(Je.$$.fragment),rl=n(),we=i("p"),we.innerHTML=xs,cl=n(),be=i("p"),be.innerHTML=_s,ul=n(),r(Ue.$$.fragment),dl=n(),Ie=i("ul"),Ie.innerHTML=Hs,hl=n(),$e=i("p"),$e.textContent=Ls,Ml=n(),r(ke.$$.fragment),ml=n(),ge=i("ul"),ge.innerHTML=qs,yl=n(),ve=i("p"),ve.textContent=Bs,Tl=n(),r(Ce.$$.fragment),jl=n(),xe=i("p"),xe.innerHTML=As,fl=n(),r(_e.$$.fragment),Jl=n(),r(He.$$.fragment),wl=n(),Le=i("p"),Le.innerHTML=Gs,bl=n(),qe=i("ul"),qe.innerHTML=Zs,Ul=n(),Be=i("p"),Be.innerHTML=Es,Il=n(),r(Ae.$$.fragment),$l=n(),Ge=i("p"),Ge.innerHTML=Ns,kl=n(),r(Ze.$$.fragment),gl=n(),Ee=i("p"),Ee.textContent=Qs,vl=n(),Ne=i("ul"),Ne.innerHTML=Rs,Cl=n(),Qe=i("p"),Qe.innerHTML=Vs,xl=n(),Re=i("ol"),Re.innerHTML=Ws,_l=n(),Ve=i("p"),Ve.textContent=zs,Hl=n(),r(We.$$.fragment),Ll=n(),ze=i("p"),ze.innerHTML=Ss,ql=n(),r(Se.$$.fragment),Bl=n(),Xe=i("p"),Xe.innerHTML=Xs,Al=n(),r(Pe.$$.fragment),Gl=n(),Ye=i("p"),Ye.innerHTML=Ps,Zl=n(),r(Fe.$$.fragment),El=n(),r(De.$$.fragment),Nl=n(),f=i("ul"),tt=i("li"),tt.innerHTML=Ys,zl=n(),y=i("li"),lt=i("p"),lt.innerHTML=Fs,Sl=n(),r(Oe.$$.fragment),Xl=n(),st=i("p"),st.innerHTML=Ds,Pl=n(),r(Ke.$$.fragment),Yl=n(),nt=i("p"),nt.innerHTML=Os,Fl=n(),at=i("li"),at.innerHTML=Ks,Ql=n(),r(et.$$.fragment),Rl=n(),ot=i("p"),this.h()},l(e){const t=an("svelte-u9bgzb",document.head);w=p(t,"META",{name:!0,content:!0}),t.forEach(l),rt=a(e),pt=p(e,"P",{}),Wl(pt).forEach(l),ct=a(e),c(U.$$.fragment,e),ut=a(e),c(I.$$.fragment,e),dt=a(e),$=p(e,"P",{"data-svelte-h":!0}),o($)!=="svelte-omjx4j"&&($.textContent=Kl),ht=a(e),k=p(e,"P",{"data-svelte-h":!0}),o(k)!=="svelte-vvpymk"&&(k.innerHTML=es),Mt=a(e),c(g.$$.fragment,e),mt=a(e),v=p(e,"P",{"data-svelte-h":!0}),o(v)!=="svelte-1mgd6a1"&&(v.innerHTML=ts),yt=a(e),c(C.$$.fragment,e),Tt=a(e),x=p(e,"P",{"data-svelte-h":!0}),o(x)!=="svelte-bjhhhu"&&(x.innerHTML=ls),jt=a(e),c(_.$$.fragment,e),ft=a(e),H=p(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-1gxmq4"&&(H.innerHTML=ss),Jt=a(e),c(L.$$.fragment,e),wt=a(e),q=p(e,"P",{"data-svelte-h":!0}),o(q)!=="svelte-1j93b1m"&&(q.innerHTML=ns),bt=a(e),B=p(e,"P",{"data-svelte-h":!0}),o(B)!=="svelte-lxb45a"&&(B.innerHTML=as),Ut=a(e),c(A.$$.fragment,e),It=a(e),G=p(e,"P",{"data-svelte-h":!0}),o(G)!=="svelte-1hncd2g"&&(G.innerHTML=is),$t=a(e),c(Z.$$.fragment,e),kt=a(e),E=p(e,"P",{"data-svelte-h":!0}),o(E)!=="svelte-1xoqb11"&&(E.innerHTML=ps),gt=a(e),N=p(e,"UL",{"data-svelte-h":!0}),o(N)!=="svelte-1tj9ylo"&&(N.innerHTML=os),vt=a(e),Q=p(e,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-1ffxsqm"&&(Q.innerHTML=rs),Ct=a(e),c(R.$$.fragment,e),xt=a(e),V=p(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1vmj5p0"&&(V.innerHTML=cs),_t=a(e),c(W.$$.fragment,e),Ht=a(e),z=p(e,"P",{"data-svelte-h":!0}),o(z)!=="svelte-1gfz1qx"&&(z.innerHTML=us),Lt=a(e),c(S.$$.fragment,e),qt=a(e),X=p(e,"P",{"data-svelte-h":!0}),o(X)!=="svelte-to1v1z"&&(X.innerHTML=ds),Bt=a(e),c(P.$$.fragment,e),At=a(e),Y=p(e,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-1pdg251"&&(Y.textContent=hs),Gt=a(e),c(F.$$.fragment,e),Zt=a(e),D=p(e,"P",{"data-svelte-h":!0}),o(D)!=="svelte-dqzi4g"&&(D.innerHTML=Ms),Et=a(e),c(O.$$.fragment,e),Nt=a(e),c(K.$$.fragment,e),Qt=a(e),ee=p(e,"P",{"data-svelte-h":!0}),o(ee)!=="svelte-uq0jdp"&&(ee.innerHTML=ms),Rt=a(e),c(te.$$.fragment,e),Vt=a(e),c(le.$$.fragment,e),Wt=a(e),se=p(e,"P",{"data-svelte-h":!0}),o(se)!=="svelte-9otw7q"&&(se.textContent=ys),zt=a(e),c(ne.$$.fragment,e),St=a(e),c(ae.$$.fragment,e),Xt=a(e),ie=p(e,"P",{"data-svelte-h":!0}),o(ie)!=="svelte-kluci1"&&(ie.textContent=Ts),Pt=a(e),pe=p(e,"P",{"data-svelte-h":!0}),o(pe)!=="svelte-1rr3jv8"&&(pe.innerHTML=js),Yt=a(e),oe=p(e,"UL",{"data-svelte-h":!0}),o(oe)!=="svelte-1qqxtz8"&&(oe.innerHTML=fs),Ft=a(e),re=p(e,"P",{"data-svelte-h":!0}),o(re)!=="svelte-1yeojtn"&&(re.innerHTML=Js),Dt=a(e),ce=p(e,"UL",{"data-svelte-h":!0}),o(ce)!=="svelte-hilu6n"&&(ce.innerHTML=ws),Ot=a(e),ue=p(e,"P",{"data-svelte-h":!0}),o(ue)!=="svelte-18gtut1"&&(ue.textContent=bs),Kt=a(e),c(de.$$.fragment,e),el=a(e),he=p(e,"P",{"data-svelte-h":!0}),o(he)!=="svelte-291nyo"&&(he.innerHTML=Us),tl=a(e),Me=p(e,"P",{"data-svelte-h":!0}),o(Me)!=="svelte-p4w3tj"&&(Me.innerHTML=Is),ll=a(e),me=p(e,"UL",{"data-svelte-h":!0}),o(me)!=="svelte-1lnxf46"&&(me.innerHTML=$s),sl=a(e),ye=p(e,"P",{"data-svelte-h":!0}),o(ye)!=="svelte-xiq7bp"&&(ye.textContent=ks),nl=a(e),b=p(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),o(b)!=="svelte-1d5zj8d"&&(b.innerHTML=gs),al=a(e),c(Te.$$.fragment,e),il=a(e),je=p(e,"P",{"data-svelte-h":!0}),o(je)!=="svelte-17te4hc"&&(je.textContent=vs),pl=a(e),fe=p(e,"UL",{"data-svelte-h":!0}),o(fe)!=="svelte-17x1sgf"&&(fe.innerHTML=Cs),ol=a(e),c(Je.$$.fragment,e),rl=a(e),we=p(e,"P",{"data-svelte-h":!0}),o(we)!=="svelte-f057os"&&(we.innerHTML=xs),cl=a(e),be=p(e,"P",{"data-svelte-h":!0}),o(be)!=="svelte-d91b09"&&(be.innerHTML=_s),ul=a(e),c(Ue.$$.fragment,e),dl=a(e),Ie=p(e,"UL",{"data-svelte-h":!0}),o(Ie)!=="svelte-1z0ex63"&&(Ie.innerHTML=Hs),hl=a(e),$e=p(e,"P",{"data-svelte-h":!0}),o($e)!=="svelte-vq3k4i"&&($e.textContent=Ls),Ml=a(e),c(ke.$$.fragment,e),ml=a(e),ge=p(e,"UL",{"data-svelte-h":!0}),o(ge)!=="svelte-nrm36c"&&(ge.innerHTML=qs),yl=a(e),ve=p(e,"P",{"data-svelte-h":!0}),o(ve)!=="svelte-1xbbttu"&&(ve.textContent=Bs),Tl=a(e),c(Ce.$$.fragment,e),jl=a(e),xe=p(e,"P",{"data-svelte-h":!0}),o(xe)!=="svelte-5a71v6"&&(xe.innerHTML=As),fl=a(e),c(_e.$$.fragment,e),Jl=a(e),c(He.$$.fragment,e),wl=a(e),Le=p(e,"P",{"data-svelte-h":!0}),o(Le)!=="svelte-1z00i8l"&&(Le.innerHTML=Gs),bl=a(e),qe=p(e,"UL",{"data-svelte-h":!0}),o(qe)!=="svelte-1n44n6m"&&(qe.innerHTML=Zs),Ul=a(e),Be=p(e,"P",{"data-svelte-h":!0}),o(Be)!=="svelte-vo8uhp"&&(Be.innerHTML=Es),Il=a(e),c(Ae.$$.fragment,e),$l=a(e),Ge=p(e,"P",{"data-svelte-h":!0}),o(Ge)!=="svelte-whdu77"&&(Ge.innerHTML=Ns),kl=a(e),c(Ze.$$.fragment,e),gl=a(e),Ee=p(e,"P",{"data-svelte-h":!0}),o(Ee)!=="svelte-ew142v"&&(Ee.textContent=Qs),vl=a(e),Ne=p(e,"UL",{"data-svelte-h":!0}),o(Ne)!=="svelte-d986sl"&&(Ne.innerHTML=Rs),Cl=a(e),Qe=p(e,"P",{"data-svelte-h":!0}),o(Qe)!=="svelte-17brked"&&(Qe.innerHTML=Vs),xl=a(e),Re=p(e,"OL",{"data-svelte-h":!0}),o(Re)!=="svelte-1a9mvrx"&&(Re.innerHTML=Ws),_l=a(e),Ve=p(e,"P",{"data-svelte-h":!0}),o(Ve)!=="svelte-mthj86"&&(Ve.textContent=zs),Hl=a(e),c(We.$$.fragment,e),Ll=a(e),ze=p(e,"P",{"data-svelte-h":!0}),o(ze)!=="svelte-1xsl1kb"&&(ze.innerHTML=Ss),ql=a(e),c(Se.$$.fragment,e),Bl=a(e),Xe=p(e,"P",{"data-svelte-h":!0}),o(Xe)!=="svelte-9hcs08"&&(Xe.innerHTML=Xs),Al=a(e),c(Pe.$$.fragment,e),Gl=a(e),Ye=p(e,"P",{"data-svelte-h":!0}),o(Ye)!=="svelte-1jwjnkj"&&(Ye.innerHTML=Ps),Zl=a(e),c(Fe.$$.fragment,e),El=a(e),c(De.$$.fragment,e),Nl=a(e),f=p(e,"UL",{});var it=Wl(f);tt=p(it,"LI",{"data-svelte-h":!0}),o(tt)!=="svelte-1yjmw8t"&&(tt.innerHTML=Ys),zl=a(it),y=p(it,"LI",{});var J=Wl(y);lt=p(J,"P",{"data-svelte-h":!0}),o(lt)!=="svelte-1xx048c"&&(lt.innerHTML=Fs),Sl=a(J),c(Oe.$$.fragment,J),Xl=a(J),st=p(J,"P",{"data-svelte-h":!0}),o(st)!=="svelte-ca1g42"&&(st.innerHTML=Ds),Pl=a(J),c(Ke.$$.fragment,J),Yl=a(J),nt=p(J,"P",{"data-svelte-h":!0}),o(nt)!=="svelte-1v83762"&&(nt.innerHTML=Os),J.forEach(l),Fl=a(it),at=p(it,"LI",{"data-svelte-h":!0}),o(at)!=="svelte-wkdo8"&&(at.innerHTML=Ks),it.forEach(l),Ql=a(e),c(et.$$.fragment,e),Rl=a(e),ot=p(e,"P",{}),Wl(ot).forEach(l),this.h()},h(){Dl(w,"name","hf:doc:metadata"),Dl(w,"content",cn),Dl(b,"class","note")},m(e,t){T(document.head,w),s(e,rt,t),s(e,pt,t),s(e,ct,t),u(U,e,t),s(e,ut,t),u(I,e,t),s(e,dt,t),s(e,$,t),s(e,ht,t),s(e,k,t),s(e,Mt,t),u(g,e,t),s(e,mt,t),s(e,v,t),s(e,yt,t),u(C,e,t),s(e,Tt,t),s(e,x,t),s(e,jt,t),u(_,e,t),s(e,ft,t),s(e,H,t),s(e,Jt,t),u(L,e,t),s(e,wt,t),s(e,q,t),s(e,bt,t),s(e,B,t),s(e,Ut,t),u(A,e,t),s(e,It,t),s(e,G,t),s(e,$t,t),u(Z,e,t),s(e,kt,t),s(e,E,t),s(e,gt,t),s(e,N,t),s(e,vt,t),s(e,Q,t),s(e,Ct,t),u(R,e,t),s(e,xt,t),s(e,V,t),s(e,_t,t),u(W,e,t),s(e,Ht,t),s(e,z,t),s(e,Lt,t),u(S,e,t),s(e,qt,t),s(e,X,t),s(e,Bt,t),u(P,e,t),s(e,At,t),s(e,Y,t),s(e,Gt,t),u(F,e,t),s(e,Zt,t),s(e,D,t),s(e,Et,t),u(O,e,t),s(e,Nt,t),u(K,e,t),s(e,Qt,t),s(e,ee,t),s(e,Rt,t),u(te,e,t),s(e,Vt,t),u(le,e,t),s(e,Wt,t),s(e,se,t),s(e,zt,t),u(ne,e,t),s(e,St,t),u(ae,e,t),s(e,Xt,t),s(e,ie,t),s(e,Pt,t),s(e,pe,t),s(e,Yt,t),s(e,oe,t),s(e,Ft,t),s(e,re,t),s(e,Dt,t),s(e,ce,t),s(e,Ot,t),s(e,ue,t),s(e,Kt,t),u(de,e,t),s(e,el,t),s(e,he,t),s(e,tl,t),s(e,Me,t),s(e,ll,t),s(e,me,t),s(e,sl,t),s(e,ye,t),s(e,nl,t),s(e,b,t),s(e,al,t),u(Te,e,t),s(e,il,t),s(e,je,t),s(e,pl,t),s(e,fe,t),s(e,ol,t),u(Je,e,t),s(e,rl,t),s(e,we,t),s(e,cl,t),s(e,be,t),s(e,ul,t),u(Ue,e,t),s(e,dl,t),s(e,Ie,t),s(e,hl,t),s(e,$e,t),s(e,Ml,t),u(ke,e,t),s(e,ml,t),s(e,ge,t),s(e,yl,t),s(e,ve,t),s(e,Tl,t),u(Ce,e,t),s(e,jl,t),s(e,xe,t),s(e,fl,t),u(_e,e,t),s(e,Jl,t),u(He,e,t),s(e,wl,t),s(e,Le,t),s(e,bl,t),s(e,qe,t),s(e,Ul,t),s(e,Be,t),s(e,Il,t),u(Ae,e,t),s(e,$l,t),s(e,Ge,t),s(e,kl,t),u(Ze,e,t),s(e,gl,t),s(e,Ee,t),s(e,vl,t),s(e,Ne,t),s(e,Cl,t),s(e,Qe,t),s(e,xl,t),s(e,Re,t),s(e,_l,t),s(e,Ve,t),s(e,Hl,t),u(We,e,t),s(e,Ll,t),s(e,ze,t),s(e,ql,t),u(Se,e,t),s(e,Bl,t),s(e,Xe,t),s(e,Al,t),u(Pe,e,t),s(e,Gl,t),s(e,Ye,t),s(e,Zl,t),u(Fe,e,t),s(e,El,t),u(De,e,t),s(e,Nl,t),s(e,f,t),T(f,tt),T(f,zl),T(f,y),T(y,lt),T(y,Sl),u(Oe,y,null),T(y,Xl),T(y,st),T(y,Pl),u(Ke,y,null),T(y,Yl),T(y,nt),T(f,Fl),T(f,at),s(e,Ql,t),u(et,e,t),s(e,Rl,t),s(e,ot,t),Vl=!0},p:tn,i(e){Vl||(d(U.$$.fragment,e),d(I.$$.fragment,e),d(g.$$.fragment,e),d(C.$$.fragment,e),d(_.$$.fragment,e),d(L.$$.fragment,e),d(A.$$.fragment,e),d(Z.$$.fragment,e),d(R.$$.fragment,e),d(W.$$.fragment,e),d(S.$$.fragment,e),d(P.$$.fragment,e),d(F.$$.fragment,e),d(O.$$.fragment,e),d(K.$$.fragment,e),d(te.$$.fragment,e),d(le.$$.fragment,e),d(ne.$$.fragment,e),d(ae.$$.fragment,e),d(de.$$.fragment,e),d(Te.$$.fragment,e),d(Je.$$.fragment,e),d(Ue.$$.fragment,e),d(ke.$$.fragment,e),d(Ce.$$.fragment,e),d(_e.$$.fragment,e),d(He.$$.fragment,e),d(Ae.$$.fragment,e),d(Ze.$$.fragment,e),d(We.$$.fragment,e),d(Se.$$.fragment,e),d(Pe.$$.fragment,e),d(Fe.$$.fragment,e),d(De.$$.fragment,e),d(Oe.$$.fragment,e),d(Ke.$$.fragment,e),d(et.$$.fragment,e),Vl=!0)},o(e){h(U.$$.fragment,e),h(I.$$.fragment,e),h(g.$$.fragment,e),h(C.$$.fragment,e),h(_.$$.fragment,e),h(L.$$.fragment,e),h(A.$$.fragment,e),h(Z.$$.fragment,e),h(R.$$.fragment,e),h(W.$$.fragment,e),h(S.$$.fragment,e),h(P.$$.fragment,e),h(F.$$.fragment,e),h(O.$$.fragment,e),h(K.$$.fragment,e),h(te.$$.fragment,e),h(le.$$.fragment,e),h(ne.$$.fragment,e),h(ae.$$.fragment,e),h(de.$$.fragment,e),h(Te.$$.fragment,e),h(Je.$$.fragment,e),h(Ue.$$.fragment,e),h(ke.$$.fragment,e),h(Ce.$$.fragment,e),h(_e.$$.fragment,e),h(He.$$.fragment,e),h(Ae.$$.fragment,e),h(Ze.$$.fragment,e),h(We.$$.fragment,e),h(Se.$$.fragment,e),h(Pe.$$.fragment,e),h(Fe.$$.fragment,e),h(De.$$.fragment,e),h(Oe.$$.fragment,e),h(Ke.$$.fragment,e),h(et.$$.fragment,e),Vl=!1},d(e){e&&(l(rt),l(pt),l(ct),l(ut),l(dt),l($),l(ht),l(k),l(Mt),l(mt),l(v),l(yt),l(Tt),l(x),l(jt),l(ft),l(H),l(Jt),l(wt),l(q),l(bt),l(B),l(Ut),l(It),l(G),l($t),l(kt),l(E),l(gt),l(N),l(vt),l(Q),l(Ct),l(xt),l(V),l(_t),l(Ht),l(z),l(Lt),l(qt),l(X),l(Bt),l(At),l(Y),l(Gt),l(Zt),l(D),l(Et),l(Nt),l(Qt),l(ee),l(Rt),l(Vt),l(Wt),l(se),l(zt),l(St),l(Xt),l(ie),l(Pt),l(pe),l(Yt),l(oe),l(Ft),l(re),l(Dt),l(ce),l(Ot),l(ue),l(Kt),l(el),l(he),l(tl),l(Me),l(ll),l(me),l(sl),l(ye),l(nl),l(b),l(al),l(il),l(je),l(pl),l(fe),l(ol),l(rl),l(we),l(cl),l(be),l(ul),l(dl),l(Ie),l(hl),l($e),l(Ml),l(ml),l(ge),l(yl),l(ve),l(Tl),l(jl),l(xe),l(fl),l(Jl),l(wl),l(Le),l(bl),l(qe),l(Ul),l(Be),l(Il),l($l),l(Ge),l(kl),l(gl),l(Ee),l(vl),l(Ne),l(Cl),l(Qe),l(xl),l(Re),l(_l),l(Ve),l(Hl),l(Ll),l(ze),l(ql),l(Bl),l(Xe),l(Al),l(Gl),l(Ye),l(Zl),l(El),l(Nl),l(f),l(Ql),l(Rl),l(ot)),l(w),M(U,e),M(I,e),M(g,e),M(C,e),M(_,e),M(L,e),M(A,e),M(Z,e),M(R,e),M(W,e),M(S,e),M(P,e),M(F,e),M(O,e),M(K,e),M(te,e),M(le,e),M(ne,e),M(ae,e),M(de,e),M(Te,e),M(Je,e),M(Ue,e),M(ke,e),M(Ce,e),M(_e,e),M(He,e),M(Ae,e),M(Ze,e),M(We,e),M(Se,e),M(Pe,e),M(Fe,e),M(De,e),M(Oe),M(Ke),M(et,e)}}}const cn='{"title":"Kernel requirements","local":"kernel-requirements","sections":[{"title":"Repository type","local":"repository-type","sections":[],"depth":2},{"title":"Trusted publishers","local":"trusted-publishers","sections":[],"depth":2},{"title":"Directory layout","local":"directory-layout","sections":[],"depth":2},{"title":"Build variants","local":"build-variants","sections":[],"depth":2},{"title":"Kernel metadata","local":"kernel-metadata","sections":[],"depth":2},{"title":"Backend","local":"backend","sections":[{"title":"Python dependencies","local":"python-dependencies","sections":[{"title":"General dependencies","local":"general-dependencies","sections":[],"depth":4},{"title":"Backend-specific dependencies","local":"backend-specific-dependencies","sections":[],"depth":4},{"title":"Combined example","local":"combined-example","sections":[],"depth":4},{"title":"Allowed dependencies","local":"allowed-dependencies","sections":[],"depth":4}],"depth":3}],"depth":2},{"title":"Versioning","local":"versioning","sections":[],"depth":2},{"title":"Native Python module","local":"native-python-module","sections":[],"depth":2},{"title":"Compatibility with torch.compile","local":"compatibility-with-torchcompile","sections":[{"title":"Linux","local":"linux","sections":[],"depth":3},{"title":"macOS","local":"macos","sections":[],"depth":3},{"title":"ABI checker","local":"abi-checker","sections":[],"depth":3}],"depth":2},{"title":"Torch extension","local":"torch-extension","sections":[],"depth":2},{"title":"Layers","local":"layers","sections":[{"title":"Writing layers","local":"writing-layers","sections":[],"depth":3},{"title":"Exporting layers","local":"exporting-layers","sections":[],"depth":3}],"depth":2},{"title":"Python requirements","local":"python-requirements","sections":[],"depth":2}],"depth":1}';function un(Ol){return ln(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class yn extends sn{constructor(w){super(),nn(this,w,un,rn,en,{})}}export{yn as component}; | |
Xet Storage Details
- Size:
- 48.7 kB
- Xet hash:
- ea7d4aa1dc821913c0394d7d89e0f7bf573b93026f47f1abca43f4af95ec04e8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.