Buckets:
| import{s as Kn,n as On,o as es}from"../chunks/scheduler.f3b1e791.js";import{S as ts,i as ls,e as i,s,c as r,h as ns,a as p,d as l,b as a,f as Nl,g as c,j as o,k as Dn,l as f,m as n,n as u,t as d,o as h,p as m}from"../chunks/index.023a9934.js";import{C as ss}from"../chunks/CopyLLMTxtMenu.5f3b0c01.js";import{C as y}from"../chunks/CodeBlock.fbf79025.js";import{H as M,E as as}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.3cccf7b6.js";function is(Xl){let J,ot,it,rt,b,ct,$,ut,I,Yl=`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,v,Dl=`<a href="https://discord.gg/H6Tkmd88N3" rel="nofollow">Join us on Discord</a> for questions and discussions | |
| about building kernels!`,ht,g,mt,U,Kl=`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,C,Tt,k,Ol=`<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>:`,ft,x,yt,L,en=`The Hub also exposes a <code>trustedKernelPublisher</code> flag on the kernel API and | |
| displays a corresponding badge in the UI.`,jt,_,wt,H,tn=`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,q,ln=`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,B,$t,A,nn=`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,E,vt,G,sn=`The build variant directory must contain a <code>metadata.json</code> file with kernel | |
| metadata. Currently the following top-level keys are supported:`,gt,P,an=`<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>`,Ut,Z,pn="Example <code>metadata.json</code>:",Ct,Q,kt,N,on="The <code>metadata.json</code> file is generated automatically by <code>kernel-builder</code>.",xt,S,Lt,V,rn="The <code>backend</code> specifies a dictionary of the following form:",_t,R,Ht,z,cn=`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.`,qt,W,Bt,F,un="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).",At,X,Et,Y,dn="For dependencies required regardless of the backend, use the <code>python-depends</code> field:",Gt,D,Pt,K,Zt,O,hn="For dependencies that are only needed for specific backends, use the <code>python-depends-backends</code> field:",Qt,ee,Nt,te,St,le,mn="You can specify both general and backend-specific dependencies:",Vt,ne,Rt,se,zt,ae,Mn="The following dependencies are currently allowed:",Wt,ie,Tn="<strong>General dependencies:</strong>",Ft,pe,fn="<li><code>einops</code></li>",Xt,oe,yn="<strong>Backend-specific dependencies:</strong>",Yt,re,jn="<li>CUDA: <code>nvidia-cutlass-dsl</code></li> <li>XPU: <code>onednn</code></li>",Dt,ce,wn="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,ue,Ot,de,Jn=`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,bn="The version <strong>must</strong> be bumped in the following cases:",tl,me,$n=`<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,In=`In both cases, build variants that are not updated must be removed from | |
| the new version’s branch.`,nl,Te,sl,fe,vn=`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,ye,gn="<li>Torch;</li> <li>CUDA/ROCm libraries installed as dependencies of Torch.</li>",il,je,pl,we,Un=`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,Cn=`<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,kn=`<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,xn="These requirements can be checked with the ABI checker (see below).",dl,ve,hl,ge,Ln=`<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,Ue,_n="The ABI3 requirement can be checked with the ABI checker (see below).",Ml,Ce,Tl,ke,Hn=`The manylinux_2_28 and Python ABI 3.9 version requirements can be checked with | |
| <a href="https://crates.io/crates/kernel-abi-check" rel="nofollow"><code>kernel-abi-check</code></a>:`,fl,xe,yl,Le,jl,_e,qn=`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,He,Bn=`<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,qe,An=`<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,Be,$l,Ae,En=`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,Ee,vl,Ge,Gn=`To make the extension of layers safe, the layers must fulfill the following | |
| requirements:`,gl,Pe,Pn=`<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>`,Ul,Ze,Zn="There are two exceptions to the <em>no class variables rule</em>:",Cl,Qe,Qn=`<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>`,kl,Ne,Nn="This is an example of a pure layer:",xl,Se,Ll,Ve,Sn=`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:`,_l,Re,Hl,ze,Vn=`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.`,ql,We,Bl,Fe,Rn=`To accommodate portable loading, <code>layers</code> must be defined in the main | |
| <code>__init__.py</code> file. For example:`,Al,Xe,El,Ye,Gl,j,et,zn="<p>Python code must be compatible with Python 3.9 and later.</p>",Sl,T,tt,Wn=`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:`,Vl,De,Rl,lt,Fn="<strong>Never use:</strong>",zl,Ke,Wl,nt,Xn=`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,st,Yn=`<p>Only modules from the Python standard library, Torch, or the kernel itself | |
| can be imported.</p>`,Pl,Oe,Zl,pt,Ql;return b=new ss({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"}}),g=new M({props:{title:"Repository type",local:"repository-type",headingTag:"h2"}}),C=new M({props:{title:"Trusted publishers",local:"trusted-publishers",headingTag:"h2"}}),x=new y({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}}),_=new M({props:{title:"Directory layout",local:"directory-layout",headingTag:"h2"}}),B=new M({props:{title:"Build variants",local:"build-variants",headingTag:"h2"}}),E=new M({props:{title:"Kernel metadata",local:"kernel-metadata",headingTag:"h2"}}),Q=new y({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}}),S=new M({props:{title:"Backend",local:"backend",headingTag:"h2"}}),R=new y({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}}),W=new M({props:{title:"Python dependencies",local:"python-dependencies",headingTag:"h3"}}),X=new M({props:{title:"General dependencies",local:"general-dependencies",headingTag:"h4"}}),D=new y({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"}}),ee=new y({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"}}),ne=new y({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}}),se=new M({props:{title:"Allowed dependencies",local:"allowed-dependencies",headingTag:"h4"}}),ue=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"}}),be=new M({props:{title:"Linux",local:"linux",headingTag:"h3"}}),ve=new M({props:{title:"macOS",local:"macos",headingTag:"h3"}}),Ce=new M({props:{title:"ABI checker",local:"abi-checker",headingTag:"h3"}}),xe=new y({props:{code:"JTBBJTI0JTIwY2FyZ28lMjBpbnN0YWxsJTIwa2VybmVsLWFiaS1jaGVjayUwQSUyNCUyMGtlcm5lbC1hYmktY2hlY2slMjByZXN1bHQlMkZyZWx1JTJGX3JlbHVfZTg3ZTBjYV9kaXJ0eS5hYmkzLnNvJTBBJUYwJTlGJTkwJThEJTIwQ2hlY2tpbmclMjBmb3IlMjBjb21wYXRpYmlsaXR5JTIwd2l0aCUyMG1hbnlsaW51eF8yXzI4JTIwYW5kJTIwUHl0aG9uJTIwQUJJJTIwdmVyc2lvbiUyMDMuOSUwQSVFMiU5QyU4NSUyME5vJTIwY29tcGF0aWJpbGl0eSUyMGlzc3VlcyUyMGZvdW5k",highlighted:` | |
| $ cargo install kernel-abi-check | |
| $ kernel-abi-check result/relu/_relu_e87e0ca_dirty.abi3.so | |
| 🐍 Checking <span class="hljs-keyword">for</span> compatibility with manylinux_2_28 and Python ABI version 3.9 | |
| ✅ No compatibility issues found`,lang:"bash",wrap:!1}}),Le=new M({props:{title:"Torch extension",local:"torch-extension",headingTag:"h2"}}),Be=new M({props:{title:"Layers",local:"layers",headingTag:"h2"}}),Ee=new M({props:{title:"Writing layers",local:"writing-layers",headingTag:"h3"}}),Se=new y({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}}),Re=new y({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}}),We=new M({props:{title:"Exporting layers",local:"exporting-layers",headingTag:"h3"}}),Xe=new y({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}}),Ye=new M({props:{title:"Python requirements",local:"python-requirements",headingTag:"h2"}}),De=new y({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 y({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}}),Oe=new as({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/kernel-requirements.md"}}),{c(){J=i("meta"),ot=s(),it=i("p"),rt=s(),r(b.$$.fragment),ct=s(),r($.$$.fragment),ut=s(),I=i("p"),I.textContent=Yl,dt=s(),v=i("p"),v.innerHTML=Dl,ht=s(),r(g.$$.fragment),mt=s(),U=i("p"),U.innerHTML=Kl,Mt=s(),r(C.$$.fragment),Tt=s(),k=i("p"),k.innerHTML=Ol,ft=s(),r(x.$$.fragment),yt=s(),L=i("p"),L.innerHTML=en,jt=s(),r(_.$$.fragment),wt=s(),H=i("p"),H.innerHTML=tn,Jt=s(),q=i("p"),q.innerHTML=ln,bt=s(),r(B.$$.fragment),$t=s(),A=i("p"),A.innerHTML=nn,It=s(),r(E.$$.fragment),vt=s(),G=i("p"),G.innerHTML=sn,gt=s(),P=i("ul"),P.innerHTML=an,Ut=s(),Z=i("p"),Z.innerHTML=pn,Ct=s(),r(Q.$$.fragment),kt=s(),N=i("p"),N.innerHTML=on,xt=s(),r(S.$$.fragment),Lt=s(),V=i("p"),V.innerHTML=rn,_t=s(),r(R.$$.fragment),Ht=s(),z=i("p"),z.innerHTML=cn,qt=s(),r(W.$$.fragment),Bt=s(),F=i("p"),F.textContent=un,At=s(),r(X.$$.fragment),Et=s(),Y=i("p"),Y.innerHTML=dn,Gt=s(),r(D.$$.fragment),Pt=s(),r(K.$$.fragment),Zt=s(),O=i("p"),O.innerHTML=hn,Qt=s(),r(ee.$$.fragment),Nt=s(),r(te.$$.fragment),St=s(),le=i("p"),le.textContent=mn,Vt=s(),r(ne.$$.fragment),Rt=s(),r(se.$$.fragment),zt=s(),ae=i("p"),ae.textContent=Mn,Wt=s(),ie=i("p"),ie.innerHTML=Tn,Ft=s(),pe=i("ul"),pe.innerHTML=fn,Xt=s(),oe=i("p"),oe.innerHTML=yn,Yt=s(),re=i("ul"),re.innerHTML=jn,Dt=s(),ce=i("p"),ce.textContent=wn,Kt=s(),r(ue.$$.fragment),Ot=s(),de=i("p"),de.innerHTML=Jn,el=s(),he=i("p"),he.innerHTML=bn,tl=s(),me=i("ul"),me.innerHTML=$n,ll=s(),Me=i("p"),Me.textContent=In,nl=s(),r(Te.$$.fragment),sl=s(),fe=i("p"),fe.textContent=vn,al=s(),ye=i("ul"),ye.innerHTML=gn,il=s(),r(je.$$.fragment),pl=s(),we=i("p"),we.innerHTML=Un,ol=s(),Je=i("p"),Je.innerHTML=Cn,rl=s(),r(be.$$.fragment),cl=s(),$e=i("ul"),$e.innerHTML=kn,ul=s(),Ie=i("p"),Ie.textContent=xn,dl=s(),r(ve.$$.fragment),hl=s(),ge=i("ul"),ge.innerHTML=Ln,ml=s(),Ue=i("p"),Ue.textContent=_n,Ml=s(),r(Ce.$$.fragment),Tl=s(),ke=i("p"),ke.innerHTML=Hn,fl=s(),r(xe.$$.fragment),yl=s(),r(Le.$$.fragment),jl=s(),_e=i("p"),_e.innerHTML=qn,wl=s(),He=i("ul"),He.innerHTML=Bn,Jl=s(),qe=i("p"),qe.innerHTML=An,bl=s(),r(Be.$$.fragment),$l=s(),Ae=i("p"),Ae.innerHTML=En,Il=s(),r(Ee.$$.fragment),vl=s(),Ge=i("p"),Ge.textContent=Gn,gl=s(),Pe=i("ul"),Pe.innerHTML=Pn,Ul=s(),Ze=i("p"),Ze.innerHTML=Zn,Cl=s(),Qe=i("ol"),Qe.innerHTML=Qn,kl=s(),Ne=i("p"),Ne.textContent=Nn,xl=s(),r(Se.$$.fragment),Ll=s(),Ve=i("p"),Ve.innerHTML=Sn,_l=s(),r(Re.$$.fragment),Hl=s(),ze=i("p"),ze.innerHTML=Vn,ql=s(),r(We.$$.fragment),Bl=s(),Fe=i("p"),Fe.innerHTML=Rn,Al=s(),r(Xe.$$.fragment),El=s(),r(Ye.$$.fragment),Gl=s(),j=i("ul"),et=i("li"),et.innerHTML=zn,Sl=s(),T=i("li"),tt=i("p"),tt.innerHTML=Wn,Vl=s(),r(De.$$.fragment),Rl=s(),lt=i("p"),lt.innerHTML=Fn,zl=s(),r(Ke.$$.fragment),Wl=s(),nt=i("p"),nt.innerHTML=Xn,Fl=s(),st=i("li"),st.innerHTML=Yn,Pl=s(),r(Oe.$$.fragment),Zl=s(),pt=i("p"),this.h()},l(e){const t=ns("svelte-u9bgzb",document.head);J=p(t,"META",{name:!0,content:!0}),t.forEach(l),ot=a(e),it=p(e,"P",{}),Nl(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=Yl),dt=a(e),v=p(e,"P",{"data-svelte-h":!0}),o(v)!=="svelte-yaa16r"&&(v.innerHTML=Dl),ht=a(e),c(g.$$.fragment,e),mt=a(e),U=p(e,"P",{"data-svelte-h":!0}),o(U)!=="svelte-1mgd6a1"&&(U.innerHTML=Kl),Mt=a(e),c(C.$$.fragment,e),Tt=a(e),k=p(e,"P",{"data-svelte-h":!0}),o(k)!=="svelte-bjhhhu"&&(k.innerHTML=Ol),ft=a(e),c(x.$$.fragment,e),yt=a(e),L=p(e,"P",{"data-svelte-h":!0}),o(L)!=="svelte-1gxmq4"&&(L.innerHTML=en),jt=a(e),c(_.$$.fragment,e),wt=a(e),H=p(e,"P",{"data-svelte-h":!0}),o(H)!=="svelte-1j93b1m"&&(H.innerHTML=tn),Jt=a(e),q=p(e,"P",{"data-svelte-h":!0}),o(q)!=="svelte-lxb45a"&&(q.innerHTML=ln),bt=a(e),c(B.$$.fragment,e),$t=a(e),A=p(e,"P",{"data-svelte-h":!0}),o(A)!=="svelte-1hncd2g"&&(A.innerHTML=nn),It=a(e),c(E.$$.fragment,e),vt=a(e),G=p(e,"P",{"data-svelte-h":!0}),o(G)!=="svelte-1xoqb11"&&(G.innerHTML=sn),gt=a(e),P=p(e,"UL",{"data-svelte-h":!0}),o(P)!=="svelte-1n4kkv0"&&(P.innerHTML=an),Ut=a(e),Z=p(e,"P",{"data-svelte-h":!0}),o(Z)!=="svelte-1ffxsqm"&&(Z.innerHTML=pn),Ct=a(e),c(Q.$$.fragment,e),kt=a(e),N=p(e,"P",{"data-svelte-h":!0}),o(N)!=="svelte-1vmj5p0"&&(N.innerHTML=on),xt=a(e),c(S.$$.fragment,e),Lt=a(e),V=p(e,"P",{"data-svelte-h":!0}),o(V)!=="svelte-1gfz1qx"&&(V.innerHTML=rn),_t=a(e),c(R.$$.fragment,e),Ht=a(e),z=p(e,"P",{"data-svelte-h":!0}),o(z)!=="svelte-to1v1z"&&(z.innerHTML=cn),qt=a(e),c(W.$$.fragment,e),Bt=a(e),F=p(e,"P",{"data-svelte-h":!0}),o(F)!=="svelte-1pdg251"&&(F.textContent=un),At=a(e),c(X.$$.fragment,e),Et=a(e),Y=p(e,"P",{"data-svelte-h":!0}),o(Y)!=="svelte-dqzi4g"&&(Y.innerHTML=dn),Gt=a(e),c(D.$$.fragment,e),Pt=a(e),c(K.$$.fragment,e),Zt=a(e),O=p(e,"P",{"data-svelte-h":!0}),o(O)!=="svelte-uq0jdp"&&(O.innerHTML=hn),Qt=a(e),c(ee.$$.fragment,e),Nt=a(e),c(te.$$.fragment,e),St=a(e),le=p(e,"P",{"data-svelte-h":!0}),o(le)!=="svelte-9otw7q"&&(le.textContent=mn),Vt=a(e),c(ne.$$.fragment,e),Rt=a(e),c(se.$$.fragment,e),zt=a(e),ae=p(e,"P",{"data-svelte-h":!0}),o(ae)!=="svelte-kluci1"&&(ae.textContent=Mn),Wt=a(e),ie=p(e,"P",{"data-svelte-h":!0}),o(ie)!=="svelte-1rr3jv8"&&(ie.innerHTML=Tn),Ft=a(e),pe=p(e,"UL",{"data-svelte-h":!0}),o(pe)!=="svelte-1qqxtz8"&&(pe.innerHTML=fn),Xt=a(e),oe=p(e,"P",{"data-svelte-h":!0}),o(oe)!=="svelte-1yeojtn"&&(oe.innerHTML=yn),Yt=a(e),re=p(e,"UL",{"data-svelte-h":!0}),o(re)!=="svelte-hilu6n"&&(re.innerHTML=jn),Dt=a(e),ce=p(e,"P",{"data-svelte-h":!0}),o(ce)!=="svelte-18gtut1"&&(ce.textContent=wn),Kt=a(e),c(ue.$$.fragment,e),Ot=a(e),de=p(e,"P",{"data-svelte-h":!0}),o(de)!=="svelte-291nyo"&&(de.innerHTML=Jn),el=a(e),he=p(e,"P",{"data-svelte-h":!0}),o(he)!=="svelte-p4w3tj"&&(he.innerHTML=bn),tl=a(e),me=p(e,"UL",{"data-svelte-h":!0}),o(me)!=="svelte-1lnxf46"&&(me.innerHTML=$n),ll=a(e),Me=p(e,"P",{"data-svelte-h":!0}),o(Me)!=="svelte-xiq7bp"&&(Me.textContent=In),nl=a(e),c(Te.$$.fragment,e),sl=a(e),fe=p(e,"P",{"data-svelte-h":!0}),o(fe)!=="svelte-17te4hc"&&(fe.textContent=vn),al=a(e),ye=p(e,"UL",{"data-svelte-h":!0}),o(ye)!=="svelte-17x1sgf"&&(ye.innerHTML=gn),il=a(e),c(je.$$.fragment,e),pl=a(e),we=p(e,"P",{"data-svelte-h":!0}),o(we)!=="svelte-f057os"&&(we.innerHTML=Un),ol=a(e),Je=p(e,"P",{"data-svelte-h":!0}),o(Je)!=="svelte-d91b09"&&(Je.innerHTML=Cn),rl=a(e),c(be.$$.fragment,e),cl=a(e),$e=p(e,"UL",{"data-svelte-h":!0}),o($e)!=="svelte-1z0ex63"&&($e.innerHTML=kn),ul=a(e),Ie=p(e,"P",{"data-svelte-h":!0}),o(Ie)!=="svelte-vq3k4i"&&(Ie.textContent=xn),dl=a(e),c(ve.$$.fragment,e),hl=a(e),ge=p(e,"UL",{"data-svelte-h":!0}),o(ge)!=="svelte-nrm36c"&&(ge.innerHTML=Ln),ml=a(e),Ue=p(e,"P",{"data-svelte-h":!0}),o(Ue)!=="svelte-1xbbttu"&&(Ue.textContent=_n),Ml=a(e),c(Ce.$$.fragment,e),Tl=a(e),ke=p(e,"P",{"data-svelte-h":!0}),o(ke)!=="svelte-16l01xm"&&(ke.innerHTML=Hn),fl=a(e),c(xe.$$.fragment,e),yl=a(e),c(Le.$$.fragment,e),jl=a(e),_e=p(e,"P",{"data-svelte-h":!0}),o(_e)!=="svelte-1z00i8l"&&(_e.innerHTML=qn),wl=a(e),He=p(e,"UL",{"data-svelte-h":!0}),o(He)!=="svelte-1n44n6m"&&(He.innerHTML=Bn),Jl=a(e),qe=p(e,"P",{"data-svelte-h":!0}),o(qe)!=="svelte-vo8uhp"&&(qe.innerHTML=An),bl=a(e),c(Be.$$.fragment,e),$l=a(e),Ae=p(e,"P",{"data-svelte-h":!0}),o(Ae)!=="svelte-whdu77"&&(Ae.innerHTML=En),Il=a(e),c(Ee.$$.fragment,e),vl=a(e),Ge=p(e,"P",{"data-svelte-h":!0}),o(Ge)!=="svelte-ew142v"&&(Ge.textContent=Gn),gl=a(e),Pe=p(e,"UL",{"data-svelte-h":!0}),o(Pe)!=="svelte-d986sl"&&(Pe.innerHTML=Pn),Ul=a(e),Ze=p(e,"P",{"data-svelte-h":!0}),o(Ze)!=="svelte-17brked"&&(Ze.innerHTML=Zn),Cl=a(e),Qe=p(e,"OL",{"data-svelte-h":!0}),o(Qe)!=="svelte-1a9mvrx"&&(Qe.innerHTML=Qn),kl=a(e),Ne=p(e,"P",{"data-svelte-h":!0}),o(Ne)!=="svelte-mthj86"&&(Ne.textContent=Nn),xl=a(e),c(Se.$$.fragment,e),Ll=a(e),Ve=p(e,"P",{"data-svelte-h":!0}),o(Ve)!=="svelte-1xsl1kb"&&(Ve.innerHTML=Sn),_l=a(e),c(Re.$$.fragment,e),Hl=a(e),ze=p(e,"P",{"data-svelte-h":!0}),o(ze)!=="svelte-9hcs08"&&(ze.innerHTML=Vn),ql=a(e),c(We.$$.fragment,e),Bl=a(e),Fe=p(e,"P",{"data-svelte-h":!0}),o(Fe)!=="svelte-1jwjnkj"&&(Fe.innerHTML=Rn),Al=a(e),c(Xe.$$.fragment,e),El=a(e),c(Ye.$$.fragment,e),Gl=a(e),j=p(e,"UL",{});var at=Nl(j);et=p(at,"LI",{"data-svelte-h":!0}),o(et)!=="svelte-1yjmw8t"&&(et.innerHTML=zn),Sl=a(at),T=p(at,"LI",{});var w=Nl(T);tt=p(w,"P",{"data-svelte-h":!0}),o(tt)!=="svelte-1xx048c"&&(tt.innerHTML=Wn),Vl=a(w),c(De.$$.fragment,w),Rl=a(w),lt=p(w,"P",{"data-svelte-h":!0}),o(lt)!=="svelte-ca1g42"&&(lt.innerHTML=Fn),zl=a(w),c(Ke.$$.fragment,w),Wl=a(w),nt=p(w,"P",{"data-svelte-h":!0}),o(nt)!=="svelte-1v83762"&&(nt.innerHTML=Xn),w.forEach(l),Fl=a(at),st=p(at,"LI",{"data-svelte-h":!0}),o(st)!=="svelte-wkdo8"&&(st.innerHTML=Yn),at.forEach(l),Pl=a(e),c(Oe.$$.fragment,e),Zl=a(e),pt=p(e,"P",{}),Nl(pt).forEach(l),this.h()},h(){Dn(J,"name","hf:doc:metadata"),Dn(J,"content",ps)},m(e,t){f(document.head,J),n(e,ot,t),n(e,it,t),n(e,rt,t),u(b,e,t),n(e,ct,t),u($,e,t),n(e,ut,t),n(e,I,t),n(e,dt,t),n(e,v,t),n(e,ht,t),u(g,e,t),n(e,mt,t),n(e,U,t),n(e,Mt,t),u(C,e,t),n(e,Tt,t),n(e,k,t),n(e,ft,t),u(x,e,t),n(e,yt,t),n(e,L,t),n(e,jt,t),u(_,e,t),n(e,wt,t),n(e,H,t),n(e,Jt,t),n(e,q,t),n(e,bt,t),u(B,e,t),n(e,$t,t),n(e,A,t),n(e,It,t),u(E,e,t),n(e,vt,t),n(e,G,t),n(e,gt,t),n(e,P,t),n(e,Ut,t),n(e,Z,t),n(e,Ct,t),u(Q,e,t),n(e,kt,t),n(e,N,t),n(e,xt,t),u(S,e,t),n(e,Lt,t),n(e,V,t),n(e,_t,t),u(R,e,t),n(e,Ht,t),n(e,z,t),n(e,qt,t),u(W,e,t),n(e,Bt,t),n(e,F,t),n(e,At,t),u(X,e,t),n(e,Et,t),n(e,Y,t),n(e,Gt,t),u(D,e,t),n(e,Pt,t),u(K,e,t),n(e,Zt,t),n(e,O,t),n(e,Qt,t),u(ee,e,t),n(e,Nt,t),u(te,e,t),n(e,St,t),n(e,le,t),n(e,Vt,t),u(ne,e,t),n(e,Rt,t),u(se,e,t),n(e,zt,t),n(e,ae,t),n(e,Wt,t),n(e,ie,t),n(e,Ft,t),n(e,pe,t),n(e,Xt,t),n(e,oe,t),n(e,Yt,t),n(e,re,t),n(e,Dt,t),n(e,ce,t),n(e,Kt,t),u(ue,e,t),n(e,Ot,t),n(e,de,t),n(e,el,t),n(e,he,t),n(e,tl,t),n(e,me,t),n(e,ll,t),n(e,Me,t),n(e,nl,t),u(Te,e,t),n(e,sl,t),n(e,fe,t),n(e,al,t),n(e,ye,t),n(e,il,t),u(je,e,t),n(e,pl,t),n(e,we,t),n(e,ol,t),n(e,Je,t),n(e,rl,t),u(be,e,t),n(e,cl,t),n(e,$e,t),n(e,ul,t),n(e,Ie,t),n(e,dl,t),u(ve,e,t),n(e,hl,t),n(e,ge,t),n(e,ml,t),n(e,Ue,t),n(e,Ml,t),u(Ce,e,t),n(e,Tl,t),n(e,ke,t),n(e,fl,t),u(xe,e,t),n(e,yl,t),u(Le,e,t),n(e,jl,t),n(e,_e,t),n(e,wl,t),n(e,He,t),n(e,Jl,t),n(e,qe,t),n(e,bl,t),u(Be,e,t),n(e,$l,t),n(e,Ae,t),n(e,Il,t),u(Ee,e,t),n(e,vl,t),n(e,Ge,t),n(e,gl,t),n(e,Pe,t),n(e,Ul,t),n(e,Ze,t),n(e,Cl,t),n(e,Qe,t),n(e,kl,t),n(e,Ne,t),n(e,xl,t),u(Se,e,t),n(e,Ll,t),n(e,Ve,t),n(e,_l,t),u(Re,e,t),n(e,Hl,t),n(e,ze,t),n(e,ql,t),u(We,e,t),n(e,Bl,t),n(e,Fe,t),n(e,Al,t),u(Xe,e,t),n(e,El,t),u(Ye,e,t),n(e,Gl,t),n(e,j,t),f(j,et),f(j,Sl),f(j,T),f(T,tt),f(T,Vl),u(De,T,null),f(T,Rl),f(T,lt),f(T,zl),u(Ke,T,null),f(T,Wl),f(T,nt),f(j,Fl),f(j,st),n(e,Pl,t),u(Oe,e,t),n(e,Zl,t),n(e,pt,t),Ql=!0},p:On,i(e){Ql||(d(b.$$.fragment,e),d($.$$.fragment,e),d(g.$$.fragment,e),d(C.$$.fragment,e),d(x.$$.fragment,e),d(_.$$.fragment,e),d(B.$$.fragment,e),d(E.$$.fragment,e),d(Q.$$.fragment,e),d(S.$$.fragment,e),d(R.$$.fragment,e),d(W.$$.fragment,e),d(X.$$.fragment,e),d(D.$$.fragment,e),d(K.$$.fragment,e),d(ee.$$.fragment,e),d(te.$$.fragment,e),d(ne.$$.fragment,e),d(se.$$.fragment,e),d(ue.$$.fragment,e),d(Te.$$.fragment,e),d(je.$$.fragment,e),d(be.$$.fragment,e),d(ve.$$.fragment,e),d(Ce.$$.fragment,e),d(xe.$$.fragment,e),d(Le.$$.fragment,e),d(Be.$$.fragment,e),d(Ee.$$.fragment,e),d(Se.$$.fragment,e),d(Re.$$.fragment,e),d(We.$$.fragment,e),d(Xe.$$.fragment,e),d(Ye.$$.fragment,e),d(De.$$.fragment,e),d(Ke.$$.fragment,e),d(Oe.$$.fragment,e),Ql=!0)},o(e){h(b.$$.fragment,e),h($.$$.fragment,e),h(g.$$.fragment,e),h(C.$$.fragment,e),h(x.$$.fragment,e),h(_.$$.fragment,e),h(B.$$.fragment,e),h(E.$$.fragment,e),h(Q.$$.fragment,e),h(S.$$.fragment,e),h(R.$$.fragment,e),h(W.$$.fragment,e),h(X.$$.fragment,e),h(D.$$.fragment,e),h(K.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(ne.$$.fragment,e),h(se.$$.fragment,e),h(ue.$$.fragment,e),h(Te.$$.fragment,e),h(je.$$.fragment,e),h(be.$$.fragment,e),h(ve.$$.fragment,e),h(Ce.$$.fragment,e),h(xe.$$.fragment,e),h(Le.$$.fragment,e),h(Be.$$.fragment,e),h(Ee.$$.fragment,e),h(Se.$$.fragment,e),h(Re.$$.fragment,e),h(We.$$.fragment,e),h(Xe.$$.fragment,e),h(Ye.$$.fragment,e),h(De.$$.fragment,e),h(Ke.$$.fragment,e),h(Oe.$$.fragment,e),Ql=!1},d(e){e&&(l(ot),l(it),l(rt),l(ct),l(ut),l(I),l(dt),l(v),l(ht),l(mt),l(U),l(Mt),l(Tt),l(k),l(ft),l(yt),l(L),l(jt),l(wt),l(H),l(Jt),l(q),l(bt),l($t),l(A),l(It),l(vt),l(G),l(gt),l(P),l(Ut),l(Z),l(Ct),l(kt),l(N),l(xt),l(Lt),l(V),l(_t),l(Ht),l(z),l(qt),l(Bt),l(F),l(At),l(Et),l(Y),l(Gt),l(Pt),l(Zt),l(O),l(Qt),l(Nt),l(St),l(le),l(Vt),l(Rt),l(zt),l(ae),l(Wt),l(ie),l(Ft),l(pe),l(Xt),l(oe),l(Yt),l(re),l(Dt),l(ce),l(Kt),l(Ot),l(de),l(el),l(he),l(tl),l(me),l(ll),l(Me),l(nl),l(sl),l(fe),l(al),l(ye),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(ge),l(ml),l(Ue),l(Ml),l(Tl),l(ke),l(fl),l(yl),l(jl),l(_e),l(wl),l(He),l(Jl),l(qe),l(bl),l($l),l(Ae),l(Il),l(vl),l(Ge),l(gl),l(Pe),l(Ul),l(Ze),l(Cl),l(Qe),l(kl),l(Ne),l(xl),l(Ll),l(Ve),l(_l),l(Hl),l(ze),l(ql),l(Bl),l(Fe),l(Al),l(El),l(Gl),l(j),l(Pl),l(Zl),l(pt)),l(J),m(b,e),m($,e),m(g,e),m(C,e),m(x,e),m(_,e),m(B,e),m(E,e),m(Q,e),m(S,e),m(R,e),m(W,e),m(X,e),m(D,e),m(K,e),m(ee,e),m(te,e),m(ne,e),m(se,e),m(ue,e),m(Te,e),m(je,e),m(be,e),m(ve,e),m(Ce,e),m(xe,e),m(Le,e),m(Be,e),m(Ee,e),m(Se,e),m(Re,e),m(We,e),m(Xe,e),m(Ye,e),m(De),m(Ke),m(Oe,e)}}}const ps='{"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 os(Xl){return es(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ms extends ts{constructor(J){super(),ls(this,J,os,is,Kn,{})}}export{ms as component}; | |
Xet Storage Details
- Size:
- 43.4 kB
- Xet hash:
- 1c5b9882c2fcc83c59d89b93ec0a2c4f3173458f4913136a9729c0975500e136
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.