Buckets:
| import{s as Ds,n as Os,o as Ks}from"../chunks/scheduler.f3b1e791.js";import{S as en,i as tn,e as i,s as n,c as r,h as ln,a as p,d as l,b as a,f as Vl,g as c,j as o,k as Fs,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 sn}from"../chunks/CopyLLMTxtMenu.c780467c.js";import{C as f}from"../chunks/CodeBlock.fc650646.js";import{H as M,E as nn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.fb377ec3.js";function an(Yl){let J,ot,it,rt,b,ct,$,ut,I,Fl=`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.`,dt,U,Dl=`<a href="https://discord.gg/H6Tkmd88N3" rel="nofollow">Join us on Discord</a> for questions and discussions | |
| about building kernels!`,ht,v,mt,g,Ol=`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.`,Mt,k,yt,C,Kl=`<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>:`,Tt,x,ft,_,es=`The Hub also exposes a <code>trustedKernelPublisher</code> flag on the kernel API and | |
| displays a corresponding badge in the UI.`,jt,H,wt,L,ts=`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>.`,Jt,B,ls=`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>.`,bt,q,$t,Z,ss=`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.`,It,G,Ut,A,ns=`The build variant directory must contain a <code>metadata.json</code> file with kernel | |
| metadata. Currently the following top-level keys are supported:`,vt,E,as=`<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>backend</code> (<code>dict</code>, required): information about the compute backend that | |
| this build variant supports.</li> <li><code>python-depends</code> (<code>list[str]</code>, optional): list of Python dependencies | |
| from a curated set of Python dependencies.</li>`,gt,N,is="Example <code>metadata.json</code>:",kt,R,Ct,V,ps="The <code>metadata.json</code> file is generated automatically by <code>kernel-builder</code>.",xt,W,_t,Q,os="The <code>backend</code> specifies a dictionary of the following form:",Ht,X,Lt,P,rs=`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,z,qt,S,cs="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).",Zt,Y,Gt,F,us="For dependencies required regardless of the backend, use the <code>python-depends</code> field:",At,D,Et,O,Nt,K,ds="For dependencies that are only needed for specific backends, use the <code>python-depends-backends</code> field:",Rt,ee,Vt,te,Wt,le,hs="You can specify both general and backend-specific dependencies:",Qt,se,Xt,ne,Pt,ae,ms="The following dependencies are currently allowed:",zt,ie,Ms="<strong>General dependencies:</strong>",St,pe,ys="<li><code>einops</code></li>",Yt,oe,Ts="<strong>Backend-specific dependencies:</strong>",Ft,re,fs="<li>CUDA: <code>nvidia-cutlass-dsl</code></li> <li>XPU: <code>onednn</code></li>",Dt,ce,js="Dependencies are validated based on the backend being used. When a kernel is loaded, only the dependencies relevant to the active backend are checked.",Ot,ue,Kt,de,ws=`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>.`,el,he,Js="The version <strong>must</strong> be bumped in the following cases:",tl,me,bs=`<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>`,ll,Me,$s=`In both cases, build variants that are not updated must be removed from | |
| the new version’s branch.`,sl,ye,nl,Te,Is=`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:`,al,fe,Us="<li>Torch;</li> <li>CUDA/ROCm libraries installed as dependencies of Torch.</li>",il,je,pl,we,vs=`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.`,ol,Je,gs=`<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>.`,rl,be,cl,$e,ks=`<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>`,ul,Ie,Cs="These requirements can be checked with the ABI checker (see below).",dl,Ue,hl,ve,xs=`<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>`,ml,ge,_s="The ABI3 requirement can be checked with the ABI checker (see below).",Ml,ke,yl,Ce,Hs=`The manylinux_2_28 and Python ABI 3.9 version requirements can be checked with | |
| <code>kernel-builder check-abi</code>:`,Tl,xe,fl,_e,jl,He,Ls=`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:`,wl,Le,Bs=`<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>`,Jl,Be,qs=`<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.`,bl,qe,$l,Ze,Zs=`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.`,Il,Ge,Ul,Ae,Gs=`To make the extension of layers safe, the layers must fulfill the following | |
| requirements:`,vl,Ee,As=`<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>`,gl,Ne,Es="There are two exceptions to the <em>no class variables rule</em>:",kl,Re,Ns=`<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>`,Cl,Ve,Rs="This is an example of a pure layer:",xl,We,_l,Qe,Vs=`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:`,Hl,Xe,Ll,Pe,Ws=`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.`,Bl,ze,ql,Se,Qs=`To accommodate portable loading, <code>layers</code> must be defined in the main | |
| <code>__init__.py</code> file. For example:`,Zl,Ye,Gl,Fe,Al,j,et,Xs="<p>Python code must be compatible with Python 3.9 and later.</p>",Wl,y,tt,Ps=`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:`,Ql,De,Xl,lt,zs="<strong>Never use:</strong>",Pl,Oe,zl,st,Ss=`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.`,Sl,nt,Ys=`<p>Only modules from the Python standard library, Torch, or the kernel itself | |
| can be imported.</p>`,El,Ke,Nl,pt,Rl;return b=new sn({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),$=new M({props:{title:"Kernel requirements",local:"kernel-requirements",headingTag:"h1"}}),v=new M({props:{title:"Repository type",local:"repository-type",headingTag:"h2"}}),k=new M({props:{title:"Trusted publishers",local:"trusted-publishers",headingTag:"h2"}}),x=new f({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}}),H=new M({props:{title:"Directory layout",local:"directory-layout",headingTag:"h2"}}),q=new M({props:{title:"Build variants",local:"build-variants",headingTag:"h2"}}),G=new M({props:{title:"Kernel metadata",local:"kernel-metadata",headingTag:"h2"}}),R=new f({props:{code:"JTdCJTBBJTIwJTIwJTIybmFtZSUyMiUzQSUyMCUyMm15a2VybmVsJTIyJTJDJTBBJTIwJTIwJTIyaWQlMjIlM0ElMjAlMjJfbXlrZXJuZWxfY3VkYV83YTRlNWE3JTIyJTJDJTBBJTIwJTIwJTIydmVyc2lvbiUyMiUzQSUyMDElMkMlMEElMjAlMjAlMjJsaWNlbnNlJTIyJTNBJTIwJTIyQXBhY2hlLTIuMCUyMiUyQyUwQSUyMCUyMCUyMnB5dGhvbi1kZXBlbmRzJTIyJTNBJTIwJTVCJTIyZWlub3BzJTIyJTVEJTJDJTBBJTIwJTIwJTIyYmFja2VuZCUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMnR5cGUlMjIlM0ElMjAlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIyYXJjaHMlMjIlM0ElMjAlNUIlMjI3LjAlMjIlMkMlMjAlMjI3LjIlMjIlMkMlMjAlMjI3LjUlMjIlMkMlMjAlMjI4LjAlMjIlMkMlMjAlMjI4LjYlMjIlMkMlMjAlMjI4LjclMjIlMkMlMjAlMjI4LjklMjIlMkMlMjAlMjI5LjAlMkJQVFglMjIlNUQlMEElMjAlMjAlN0QlMEElN0Q=",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>`,lang:"json",wrap:!1}}),W=new M({props:{title:"Backend",local:"backend",headingTag:"h2"}}),X=new f({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}}),z=new M({props:{title:"Python dependencies",local:"python-dependencies",headingTag:"h3"}}),Y=new M({props:{title:"General dependencies",local:"general-dependencies",headingTag:"h4"}}),D=new f({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}}),O=new M({props:{title:"Backend-specific dependencies",local:"backend-specific-dependencies",headingTag:"h4"}}),ee=new f({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}}),te=new M({props:{title:"Combined example",local:"combined-example",headingTag:"h4"}}),se=new f({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}}),ne=new M({props:{title:"Allowed dependencies",local:"allowed-dependencies",headingTag:"h4"}}),ue=new M({props:{title:"Versioning",local:"versioning",headingTag:"h2"}}),ye=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"}}),be=new M({props:{title:"Linux",local:"linux",headingTag:"h3"}}),Ue=new M({props:{title:"macOS",local:"macos",headingTag:"h3"}}),ke=new M({props:{title:"ABI checker",local:"abi-checker",headingTag:"h3"}}),xe=new f({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}}),_e=new M({props:{title:"Torch extension",local:"torch-extension",headingTag:"h2"}}),qe=new M({props:{title:"Layers",local:"layers",headingTag:"h2"}}),Ge=new M({props:{title:"Writing layers",local:"writing-layers",headingTag:"h3"}}),We=new f({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}}),Xe=new f({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}}),ze=new M({props:{title:"Exporting layers",local:"exporting-layers",headingTag:"h3"}}),Ye=new f({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}}),Fe=new M({props:{title:"Python requirements",local:"python-requirements",headingTag:"h2"}}),De=new f({props:{code:"ZnJvbSUyMC5tb2R1bGVfYSUyMGltcG9ydCUyMGZvbw==",highlighted:'<span class="hljs-keyword">from</span> .module_a <span class="hljs-keyword">import</span> foo',lang:"python",wrap:!1}}),Oe=new f({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}}),Ke=new nn({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/kernel-requirements.md"}}),{c(){J=i("meta"),ot=n(),it=i("p"),rt=n(),r(b.$$.fragment),ct=n(),r($.$$.fragment),ut=n(),I=i("p"),I.textContent=Fl,dt=n(),U=i("p"),U.innerHTML=Dl,ht=n(),r(v.$$.fragment),mt=n(),g=i("p"),g.innerHTML=Ol,Mt=n(),r(k.$$.fragment),yt=n(),C=i("p"),C.innerHTML=Kl,Tt=n(),r(x.$$.fragment),ft=n(),_=i("p"),_.innerHTML=es,jt=n(),r(H.$$.fragment),wt=n(),L=i("p"),L.innerHTML=ts,Jt=n(),B=i("p"),B.innerHTML=ls,bt=n(),r(q.$$.fragment),$t=n(),Z=i("p"),Z.innerHTML=ss,It=n(),r(G.$$.fragment),Ut=n(),A=i("p"),A.innerHTML=ns,vt=n(),E=i("ul"),E.innerHTML=as,gt=n(),N=i("p"),N.innerHTML=is,kt=n(),r(R.$$.fragment),Ct=n(),V=i("p"),V.innerHTML=ps,xt=n(),r(W.$$.fragment),_t=n(),Q=i("p"),Q.innerHTML=os,Ht=n(),r(X.$$.fragment),Lt=n(),P=i("p"),P.innerHTML=rs,Bt=n(),r(z.$$.fragment),qt=n(),S=i("p"),S.textContent=cs,Zt=n(),r(Y.$$.fragment),Gt=n(),F=i("p"),F.innerHTML=us,At=n(),r(D.$$.fragment),Et=n(),r(O.$$.fragment),Nt=n(),K=i("p"),K.innerHTML=ds,Rt=n(),r(ee.$$.fragment),Vt=n(),r(te.$$.fragment),Wt=n(),le=i("p"),le.textContent=hs,Qt=n(),r(se.$$.fragment),Xt=n(),r(ne.$$.fragment),Pt=n(),ae=i("p"),ae.textContent=ms,zt=n(),ie=i("p"),ie.innerHTML=Ms,St=n(),pe=i("ul"),pe.innerHTML=ys,Yt=n(),oe=i("p"),oe.innerHTML=Ts,Ft=n(),re=i("ul"),re.innerHTML=fs,Dt=n(),ce=i("p"),ce.textContent=js,Ot=n(),r(ue.$$.fragment),Kt=n(),de=i("p"),de.innerHTML=ws,el=n(),he=i("p"),he.innerHTML=Js,tl=n(),me=i("ul"),me.innerHTML=bs,ll=n(),Me=i("p"),Me.textContent=$s,sl=n(),r(ye.$$.fragment),nl=n(),Te=i("p"),Te.textContent=Is,al=n(),fe=i("ul"),fe.innerHTML=Us,il=n(),r(je.$$.fragment),pl=n(),we=i("p"),we.innerHTML=vs,ol=n(),Je=i("p"),Je.innerHTML=gs,rl=n(),r(be.$$.fragment),cl=n(),$e=i("ul"),$e.innerHTML=ks,ul=n(),Ie=i("p"),Ie.textContent=Cs,dl=n(),r(Ue.$$.fragment),hl=n(),ve=i("ul"),ve.innerHTML=xs,ml=n(),ge=i("p"),ge.textContent=_s,Ml=n(),r(ke.$$.fragment),yl=n(),Ce=i("p"),Ce.innerHTML=Hs,Tl=n(),r(xe.$$.fragment),fl=n(),r(_e.$$.fragment),jl=n(),He=i("p"),He.innerHTML=Ls,wl=n(),Le=i("ul"),Le.innerHTML=Bs,Jl=n(),Be=i("p"),Be.innerHTML=qs,bl=n(),r(qe.$$.fragment),$l=n(),Ze=i("p"),Ze.innerHTML=Zs,Il=n(),r(Ge.$$.fragment),Ul=n(),Ae=i("p"),Ae.textContent=Gs,vl=n(),Ee=i("ul"),Ee.innerHTML=As,gl=n(),Ne=i("p"),Ne.innerHTML=Es,kl=n(),Re=i("ol"),Re.innerHTML=Ns,Cl=n(),Ve=i("p"),Ve.textContent=Rs,xl=n(),r(We.$$.fragment),_l=n(),Qe=i("p"),Qe.innerHTML=Vs,Hl=n(),r(Xe.$$.fragment),Ll=n(),Pe=i("p"),Pe.innerHTML=Ws,Bl=n(),r(ze.$$.fragment),ql=n(),Se=i("p"),Se.innerHTML=Qs,Zl=n(),r(Ye.$$.fragment),Gl=n(),r(Fe.$$.fragment),Al=n(),j=i("ul"),et=i("li"),et.innerHTML=Xs,Wl=n(),y=i("li"),tt=i("p"),tt.innerHTML=Ps,Ql=n(),r(De.$$.fragment),Xl=n(),lt=i("p"),lt.innerHTML=zs,Pl=n(),r(Oe.$$.fragment),zl=n(),st=i("p"),st.innerHTML=Ss,Sl=n(),nt=i("li"),nt.innerHTML=Ys,El=n(),r(Ke.$$.fragment),Nl=n(),pt=i("p"),this.h()},l(e){const t=ln("svelte-u9bgzb",document.head);J=p(t,"META",{name:!0,content:!0}),t.forEach(l),ot=a(e),it=p(e,"P",{}),Vl(it).forEach(l),rt=a(e),c(b.$$.fragment,e),ct=a(e),c($.$$.fragment,e),ut=a(e),I=p(e,"P",{"data-svelte-h":!0}),o(I)!=="svelte-omjx4j"&&(I.textContent=Fl),dt=a(e),U=p(e,"P",{"data-svelte-h":!0}),o(U)!=="svelte-yaa16r"&&(U.innerHTML=Dl),ht=a(e),c(v.$$.fragment,e),mt=a(e),g=p(e,"P",{"data-svelte-h":!0}),o(g)!=="svelte-1mgd6a1"&&(g.innerHTML=Ol),Mt=a(e),c(k.$$.fragment,e),yt=a(e),C=p(e,"P",{"data-svelte-h":!0}),o(C)!=="svelte-bjhhhu"&&(C.innerHTML=Kl),Tt=a(e),c(x.$$.fragment,e),ft=a(e),_=p(e,"P",{"data-svelte-h":!0}),o(_)!=="svelte-1gxmq4"&&(_.innerHTML=es),jt=a(e),c(H.$$.fragment,e),wt=a(e),L=p(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-1j93b1m"&&(L.innerHTML=ts),Jt=a(e),B=p(e,"P",{"data-svelte-h":!0}),o(B)!=="svelte-lxb45a"&&(B.innerHTML=ls),bt=a(e),c(q.$$.fragment,e),$t=a(e),Z=p(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-1hncd2g"&&(Z.innerHTML=ss),It=a(e),c(G.$$.fragment,e),Ut=a(e),A=p(e,"P",{"data-svelte-h":!0}),o(A)!=="svelte-1xoqb11"&&(A.innerHTML=ns),vt=a(e),E=p(e,"UL",{"data-svelte-h":!0}),o(E)!=="svelte-1n4kkv0"&&(E.innerHTML=as),gt=a(e),N=p(e,"P",{"data-svelte-h":!0}),o(N)!=="svelte-1ffxsqm"&&(N.innerHTML=is),kt=a(e),c(R.$$.fragment,e),Ct=a(e),V=p(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1vmj5p0"&&(V.innerHTML=ps),xt=a(e),c(W.$$.fragment,e),_t=a(e),Q=p(e,"P",{"data-svelte-h":!0}),o(Q)!=="svelte-1gfz1qx"&&(Q.innerHTML=os),Ht=a(e),c(X.$$.fragment,e),Lt=a(e),P=p(e,"P",{"data-svelte-h":!0}),o(P)!=="svelte-to1v1z"&&(P.innerHTML=rs),Bt=a(e),c(z.$$.fragment,e),qt=a(e),S=p(e,"P",{"data-svelte-h":!0}),o(S)!=="svelte-1pdg251"&&(S.textContent=cs),Zt=a(e),c(Y.$$.fragment,e),Gt=a(e),F=p(e,"P",{"data-svelte-h":!0}),o(F)!=="svelte-dqzi4g"&&(F.innerHTML=us),At=a(e),c(D.$$.fragment,e),Et=a(e),c(O.$$.fragment,e),Nt=a(e),K=p(e,"P",{"data-svelte-h":!0}),o(K)!=="svelte-uq0jdp"&&(K.innerHTML=ds),Rt=a(e),c(ee.$$.fragment,e),Vt=a(e),c(te.$$.fragment,e),Wt=a(e),le=p(e,"P",{"data-svelte-h":!0}),o(le)!=="svelte-9otw7q"&&(le.textContent=hs),Qt=a(e),c(se.$$.fragment,e),Xt=a(e),c(ne.$$.fragment,e),Pt=a(e),ae=p(e,"P",{"data-svelte-h":!0}),o(ae)!=="svelte-kluci1"&&(ae.textContent=ms),zt=a(e),ie=p(e,"P",{"data-svelte-h":!0}),o(ie)!=="svelte-1rr3jv8"&&(ie.innerHTML=Ms),St=a(e),pe=p(e,"UL",{"data-svelte-h":!0}),o(pe)!=="svelte-1qqxtz8"&&(pe.innerHTML=ys),Yt=a(e),oe=p(e,"P",{"data-svelte-h":!0}),o(oe)!=="svelte-1yeojtn"&&(oe.innerHTML=Ts),Ft=a(e),re=p(e,"UL",{"data-svelte-h":!0}),o(re)!=="svelte-hilu6n"&&(re.innerHTML=fs),Dt=a(e),ce=p(e,"P",{"data-svelte-h":!0}),o(ce)!=="svelte-18gtut1"&&(ce.textContent=js),Ot=a(e),c(ue.$$.fragment,e),Kt=a(e),de=p(e,"P",{"data-svelte-h":!0}),o(de)!=="svelte-291nyo"&&(de.innerHTML=ws),el=a(e),he=p(e,"P",{"data-svelte-h":!0}),o(he)!=="svelte-p4w3tj"&&(he.innerHTML=Js),tl=a(e),me=p(e,"UL",{"data-svelte-h":!0}),o(me)!=="svelte-1lnxf46"&&(me.innerHTML=bs),ll=a(e),Me=p(e,"P",{"data-svelte-h":!0}),o(Me)!=="svelte-xiq7bp"&&(Me.textContent=$s),sl=a(e),c(ye.$$.fragment,e),nl=a(e),Te=p(e,"P",{"data-svelte-h":!0}),o(Te)!=="svelte-17te4hc"&&(Te.textContent=Is),al=a(e),fe=p(e,"UL",{"data-svelte-h":!0}),o(fe)!=="svelte-17x1sgf"&&(fe.innerHTML=Us),il=a(e),c(je.$$.fragment,e),pl=a(e),we=p(e,"P",{"data-svelte-h":!0}),o(we)!=="svelte-f057os"&&(we.innerHTML=vs),ol=a(e),Je=p(e,"P",{"data-svelte-h":!0}),o(Je)!=="svelte-d91b09"&&(Je.innerHTML=gs),rl=a(e),c(be.$$.fragment,e),cl=a(e),$e=p(e,"UL",{"data-svelte-h":!0}),o($e)!=="svelte-1z0ex63"&&($e.innerHTML=ks),ul=a(e),Ie=p(e,"P",{"data-svelte-h":!0}),o(Ie)!=="svelte-vq3k4i"&&(Ie.textContent=Cs),dl=a(e),c(Ue.$$.fragment,e),hl=a(e),ve=p(e,"UL",{"data-svelte-h":!0}),o(ve)!=="svelte-nrm36c"&&(ve.innerHTML=xs),ml=a(e),ge=p(e,"P",{"data-svelte-h":!0}),o(ge)!=="svelte-1xbbttu"&&(ge.textContent=_s),Ml=a(e),c(ke.$$.fragment,e),yl=a(e),Ce=p(e,"P",{"data-svelte-h":!0}),o(Ce)!=="svelte-5a71v6"&&(Ce.innerHTML=Hs),Tl=a(e),c(xe.$$.fragment,e),fl=a(e),c(_e.$$.fragment,e),jl=a(e),He=p(e,"P",{"data-svelte-h":!0}),o(He)!=="svelte-1z00i8l"&&(He.innerHTML=Ls),wl=a(e),Le=p(e,"UL",{"data-svelte-h":!0}),o(Le)!=="svelte-1n44n6m"&&(Le.innerHTML=Bs),Jl=a(e),Be=p(e,"P",{"data-svelte-h":!0}),o(Be)!=="svelte-vo8uhp"&&(Be.innerHTML=qs),bl=a(e),c(qe.$$.fragment,e),$l=a(e),Ze=p(e,"P",{"data-svelte-h":!0}),o(Ze)!=="svelte-whdu77"&&(Ze.innerHTML=Zs),Il=a(e),c(Ge.$$.fragment,e),Ul=a(e),Ae=p(e,"P",{"data-svelte-h":!0}),o(Ae)!=="svelte-ew142v"&&(Ae.textContent=Gs),vl=a(e),Ee=p(e,"UL",{"data-svelte-h":!0}),o(Ee)!=="svelte-d986sl"&&(Ee.innerHTML=As),gl=a(e),Ne=p(e,"P",{"data-svelte-h":!0}),o(Ne)!=="svelte-17brked"&&(Ne.innerHTML=Es),kl=a(e),Re=p(e,"OL",{"data-svelte-h":!0}),o(Re)!=="svelte-1a9mvrx"&&(Re.innerHTML=Ns),Cl=a(e),Ve=p(e,"P",{"data-svelte-h":!0}),o(Ve)!=="svelte-mthj86"&&(Ve.textContent=Rs),xl=a(e),c(We.$$.fragment,e),_l=a(e),Qe=p(e,"P",{"data-svelte-h":!0}),o(Qe)!=="svelte-1xsl1kb"&&(Qe.innerHTML=Vs),Hl=a(e),c(Xe.$$.fragment,e),Ll=a(e),Pe=p(e,"P",{"data-svelte-h":!0}),o(Pe)!=="svelte-9hcs08"&&(Pe.innerHTML=Ws),Bl=a(e),c(ze.$$.fragment,e),ql=a(e),Se=p(e,"P",{"data-svelte-h":!0}),o(Se)!=="svelte-1jwjnkj"&&(Se.innerHTML=Qs),Zl=a(e),c(Ye.$$.fragment,e),Gl=a(e),c(Fe.$$.fragment,e),Al=a(e),j=p(e,"UL",{});var at=Vl(j);et=p(at,"LI",{"data-svelte-h":!0}),o(et)!=="svelte-1yjmw8t"&&(et.innerHTML=Xs),Wl=a(at),y=p(at,"LI",{});var w=Vl(y);tt=p(w,"P",{"data-svelte-h":!0}),o(tt)!=="svelte-1xx048c"&&(tt.innerHTML=Ps),Ql=a(w),c(De.$$.fragment,w),Xl=a(w),lt=p(w,"P",{"data-svelte-h":!0}),o(lt)!=="svelte-ca1g42"&&(lt.innerHTML=zs),Pl=a(w),c(Oe.$$.fragment,w),zl=a(w),st=p(w,"P",{"data-svelte-h":!0}),o(st)!=="svelte-1v83762"&&(st.innerHTML=Ss),w.forEach(l),Sl=a(at),nt=p(at,"LI",{"data-svelte-h":!0}),o(nt)!=="svelte-wkdo8"&&(nt.innerHTML=Ys),at.forEach(l),El=a(e),c(Ke.$$.fragment,e),Nl=a(e),pt=p(e,"P",{}),Vl(pt).forEach(l),this.h()},h(){Fs(J,"name","hf:doc:metadata"),Fs(J,"content",pn)},m(e,t){T(document.head,J),s(e,ot,t),s(e,it,t),s(e,rt,t),u(b,e,t),s(e,ct,t),u($,e,t),s(e,ut,t),s(e,I,t),s(e,dt,t),s(e,U,t),s(e,ht,t),u(v,e,t),s(e,mt,t),s(e,g,t),s(e,Mt,t),u(k,e,t),s(e,yt,t),s(e,C,t),s(e,Tt,t),u(x,e,t),s(e,ft,t),s(e,_,t),s(e,jt,t),u(H,e,t),s(e,wt,t),s(e,L,t),s(e,Jt,t),s(e,B,t),s(e,bt,t),u(q,e,t),s(e,$t,t),s(e,Z,t),s(e,It,t),u(G,e,t),s(e,Ut,t),s(e,A,t),s(e,vt,t),s(e,E,t),s(e,gt,t),s(e,N,t),s(e,kt,t),u(R,e,t),s(e,Ct,t),s(e,V,t),s(e,xt,t),u(W,e,t),s(e,_t,t),s(e,Q,t),s(e,Ht,t),u(X,e,t),s(e,Lt,t),s(e,P,t),s(e,Bt,t),u(z,e,t),s(e,qt,t),s(e,S,t),s(e,Zt,t),u(Y,e,t),s(e,Gt,t),s(e,F,t),s(e,At,t),u(D,e,t),s(e,Et,t),u(O,e,t),s(e,Nt,t),s(e,K,t),s(e,Rt,t),u(ee,e,t),s(e,Vt,t),u(te,e,t),s(e,Wt,t),s(e,le,t),s(e,Qt,t),u(se,e,t),s(e,Xt,t),u(ne,e,t),s(e,Pt,t),s(e,ae,t),s(e,zt,t),s(e,ie,t),s(e,St,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),u(ue,e,t),s(e,Kt,t),s(e,de,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),u(ye,e,t),s(e,nl,t),s(e,Te,t),s(e,al,t),s(e,fe,t),s(e,il,t),u(je,e,t),s(e,pl,t),s(e,we,t),s(e,ol,t),s(e,Je,t),s(e,rl,t),u(be,e,t),s(e,cl,t),s(e,$e,t),s(e,ul,t),s(e,Ie,t),s(e,dl,t),u(Ue,e,t),s(e,hl,t),s(e,ve,t),s(e,ml,t),s(e,ge,t),s(e,Ml,t),u(ke,e,t),s(e,yl,t),s(e,Ce,t),s(e,Tl,t),u(xe,e,t),s(e,fl,t),u(_e,e,t),s(e,jl,t),s(e,He,t),s(e,wl,t),s(e,Le,t),s(e,Jl,t),s(e,Be,t),s(e,bl,t),u(qe,e,t),s(e,$l,t),s(e,Ze,t),s(e,Il,t),u(Ge,e,t),s(e,Ul,t),s(e,Ae,t),s(e,vl,t),s(e,Ee,t),s(e,gl,t),s(e,Ne,t),s(e,kl,t),s(e,Re,t),s(e,Cl,t),s(e,Ve,t),s(e,xl,t),u(We,e,t),s(e,_l,t),s(e,Qe,t),s(e,Hl,t),u(Xe,e,t),s(e,Ll,t),s(e,Pe,t),s(e,Bl,t),u(ze,e,t),s(e,ql,t),s(e,Se,t),s(e,Zl,t),u(Ye,e,t),s(e,Gl,t),u(Fe,e,t),s(e,Al,t),s(e,j,t),T(j,et),T(j,Wl),T(j,y),T(y,tt),T(y,Ql),u(De,y,null),T(y,Xl),T(y,lt),T(y,Pl),u(Oe,y,null),T(y,zl),T(y,st),T(j,Sl),T(j,nt),s(e,El,t),u(Ke,e,t),s(e,Nl,t),s(e,pt,t),Rl=!0},p:Os,i(e){Rl||(d(b.$$.fragment,e),d($.$$.fragment,e),d(v.$$.fragment,e),d(k.$$.fragment,e),d(x.$$.fragment,e),d(H.$$.fragment,e),d(q.$$.fragment,e),d(G.$$.fragment,e),d(R.$$.fragment,e),d(W.$$.fragment,e),d(X.$$.fragment,e),d(z.$$.fragment,e),d(Y.$$.fragment,e),d(D.$$.fragment,e),d(O.$$.fragment,e),d(ee.$$.fragment,e),d(te.$$.fragment,e),d(se.$$.fragment,e),d(ne.$$.fragment,e),d(ue.$$.fragment,e),d(ye.$$.fragment,e),d(je.$$.fragment,e),d(be.$$.fragment,e),d(Ue.$$.fragment,e),d(ke.$$.fragment,e),d(xe.$$.fragment,e),d(_e.$$.fragment,e),d(qe.$$.fragment,e),d(Ge.$$.fragment,e),d(We.$$.fragment,e),d(Xe.$$.fragment,e),d(ze.$$.fragment,e),d(Ye.$$.fragment,e),d(Fe.$$.fragment,e),d(De.$$.fragment,e),d(Oe.$$.fragment,e),d(Ke.$$.fragment,e),Rl=!0)},o(e){h(b.$$.fragment,e),h($.$$.fragment,e),h(v.$$.fragment,e),h(k.$$.fragment,e),h(x.$$.fragment,e),h(H.$$.fragment,e),h(q.$$.fragment,e),h(G.$$.fragment,e),h(R.$$.fragment,e),h(W.$$.fragment,e),h(X.$$.fragment,e),h(z.$$.fragment,e),h(Y.$$.fragment,e),h(D.$$.fragment,e),h(O.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(se.$$.fragment,e),h(ne.$$.fragment,e),h(ue.$$.fragment,e),h(ye.$$.fragment,e),h(je.$$.fragment,e),h(be.$$.fragment,e),h(Ue.$$.fragment,e),h(ke.$$.fragment,e),h(xe.$$.fragment,e),h(_e.$$.fragment,e),h(qe.$$.fragment,e),h(Ge.$$.fragment,e),h(We.$$.fragment,e),h(Xe.$$.fragment,e),h(ze.$$.fragment,e),h(Ye.$$.fragment,e),h(Fe.$$.fragment,e),h(De.$$.fragment,e),h(Oe.$$.fragment,e),h(Ke.$$.fragment,e),Rl=!1},d(e){e&&(l(ot),l(it),l(rt),l(ct),l(ut),l(I),l(dt),l(U),l(ht),l(mt),l(g),l(Mt),l(yt),l(C),l(Tt),l(ft),l(_),l(jt),l(wt),l(L),l(Jt),l(B),l(bt),l($t),l(Z),l(It),l(Ut),l(A),l(vt),l(E),l(gt),l(N),l(kt),l(Ct),l(V),l(xt),l(_t),l(Q),l(Ht),l(Lt),l(P),l(Bt),l(qt),l(S),l(Zt),l(Gt),l(F),l(At),l(Et),l(Nt),l(K),l(Rt),l(Vt),l(Wt),l(le),l(Qt),l(Xt),l(Pt),l(ae),l(zt),l(ie),l(St),l(pe),l(Yt),l(oe),l(Ft),l(re),l(Dt),l(ce),l(Ot),l(Kt),l(de),l(el),l(he),l(tl),l(me),l(ll),l(Me),l(sl),l(nl),l(Te),l(al),l(fe),l(il),l(pl),l(we),l(ol),l(Je),l(rl),l(cl),l($e),l(ul),l(Ie),l(dl),l(hl),l(ve),l(ml),l(ge),l(Ml),l(yl),l(Ce),l(Tl),l(fl),l(jl),l(He),l(wl),l(Le),l(Jl),l(Be),l(bl),l($l),l(Ze),l(Il),l(Ul),l(Ae),l(vl),l(Ee),l(gl),l(Ne),l(kl),l(Re),l(Cl),l(Ve),l(xl),l(_l),l(Qe),l(Hl),l(Ll),l(Pe),l(Bl),l(ql),l(Se),l(Zl),l(Gl),l(Al),l(j),l(El),l(Nl),l(pt)),l(J),m(b,e),m($,e),m(v,e),m(k,e),m(x,e),m(H,e),m(q,e),m(G,e),m(R,e),m(W,e),m(X,e),m(z,e),m(Y,e),m(D,e),m(O,e),m(ee,e),m(te,e),m(se,e),m(ne,e),m(ue,e),m(ye,e),m(je,e),m(be,e),m(Ue,e),m(ke,e),m(xe,e),m(_e,e),m(qe,e),m(Ge,e),m(We,e),m(Xe,e),m(ze,e),m(Ye,e),m(Fe,e),m(De),m(Oe),m(Ke,e)}}}const pn='{"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 on(Yl){return Ks(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mn extends en{constructor(J){super(),tn(this,J,on,an,Ds,{})}}export{mn as component}; | |
Xet Storage Details
- Size:
- 45.5 kB
- Xet hash:
- 38fc57cb2a073a8175e48a4db402e51a2f63a1bc15330e0d2e5402ddee23f269
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.