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