Buckets:

HuggingFaceDocBuilder's picture
download
raw
83.8 kB
import{s as Xs,o as Ns,n as V}from"../chunks/scheduler.f3b1e791.js";import{S as As,i as Qs,e as c,s as r,c as u,h as Fs,a as m,d as o,b as a,f as j,g as M,j as b,k as J,l as p,m as i,n as f,t as h,o as w,p as g}from"../chunks/index.023a9934.js";import{C as Ls,H as $,E as zs}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.76705b3b.js";import{D as _,E}from"../chunks/ExampleCodeBlock.a2766af7.js";import{C as W}from"../chunks/CodeBlock.368f51b1.js";function Hs(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEElMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwdXNlX2tlcm5lbGl6ZWRfZnVuYyUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwTW9kZSUyQyUyMGtlcm5lbGl6ZSUwQSUwQSU0MHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiglMjJNeUN1c3RvbUxheWVyJTIyKSUwQWNsYXNzJTIwTXlDdXN0b21MYXllcihubi5Nb2R1bGUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19pbml0X18oc2VsZiUyQyUyMGhpZGRlbl9zaXplKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHN1cGVyKCkuX19pbml0X18oKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNlbGYuaGlkZGVuX3NpemUlMjAlM0QlMjBoaWRkZW5fc2l6ZSUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMHglM0ElMjB0b3JjaC5UZW5zb3IpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIzJTIwb3JpZ2luYWwlMjBpbXBsZW1lbnRhdGlvbiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMHglMEElMEFtb2RlbCUyMCUzRCUyME15Q3VzdG9tTGF5ZXIoNzY4KSUwQSUwQSUyMyUyMFRoZSUyMGxheWVyJTIwY2FuJTIwbm93JTIwYmUlMjBrZXJuZWxpemVkJTNBJTBBJTIzJTIwbW9kZWwlMjAlM0QlMjBrZXJuZWxpemUobW9kZWwlMkMlMjBtb2RlJTNETW9kZS5UUkFJTklORyUyMCU3QyUyME1vZGUuVE9SQ0hfQ09NUElMRSUyQyUyMGRldmljZSUzRCUyMmN1ZGElMjIpJTBBJTBBJTIzJTIwVXNlJTIwb24lMjBhJTIwZnVuY3Rpb24lMjAoY29udmVydHMlMjB0aGUlMjBmdW5jdGlvbiUyMHRvJTIwJTYwbm4uTW9kdWxlJTYwKS4lMjBUaGUlMjBmdW5jdGlvbiUwQSUyMyUyMGNhbiUyMHRoZW4lMjBiZSUyMHJlcGxhY2VkJTIwd2l0aCUyMGElMjBsYXllciUyMG1hcHBpbmclMjBmb3IlMjAlNjBNeUN1c3RvbUxheWVyJTYwLiUwQSU0MHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiglMjJNeUN1c3RvbUxheWVyJTIyKSUwQWRlZiUyMGlkZW50aXR5KHglM0ElMjB0b3JjaC5UZW5zb3IpJTIwLSUzRSUyMHRvcmNoLlRlbnNvciUzQSUwQSUyMCUyMCUyMCUyMHJldHVybiUyMHglMEElMEElNDB1c2Vfa2VybmVsaXplZF9mdW5jKGlkZW50aXR5KSUwQWNsYXNzJTIwTGF5ZXJVc2luZ0lkZW50aXR5KG5uLk1vZHVsZSklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBmb3J3YXJkKHNlbGYlMkMlMjB4JTNBJTIwdG9yY2guVGVuc29yKSUyMC0lM0UlMjB0b3JjaC5UZW5zb3IlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBpZGVudGl0eSh4KSUwQQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_forward_from_hub
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernelized_func
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> Mode, kernelize
<span class="hljs-meta">@use_kernel_forward_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;MyCustomLayer&quot;</span></span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyCustomLayer</span>(nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self, hidden_size</span>):
<span class="hljs-built_in">super</span>().__init__()
self.hidden_size = hidden_size
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>):
<span class="hljs-comment"># original implementation</span>
<span class="hljs-keyword">return</span> x
model = MyCustomLayer(<span class="hljs-number">768</span>)
<span class="hljs-comment"># The layer can now be kernelized:</span>
<span class="hljs-comment"># model = kernelize(model, mode=Mode.TRAINING | Mode.TORCH_COMPILE, device=&quot;cuda&quot;)</span>
<span class="hljs-comment"># Use on a function (converts the function to \`nn.Module\`). The function</span>
<span class="hljs-comment"># can then be replaced with a layer mapping for \`MyCustomLayer\`.</span>
<span class="hljs-meta">@use_kernel_forward_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;MyCustomLayer&quot;</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">identity</span>(<span class="hljs-params">x: torch.Tensor</span>) -&gt; torch.Tensor:
<span class="hljs-keyword">return</span> x
<span class="hljs-meta">@use_kernelized_func(<span class="hljs-params">identity</span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">LayerUsingIdentity</span>(nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>) -&gt; torch.Tensor:
<span class="hljs-keyword">return</span> identity(x)
`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function Ys(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEElMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMHVzZV9rZXJuZWxfZnVuY19mcm9tX2h1YiUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwTW9kZSUyQyUyMGtlcm5lbGl6ZSUwQSUwQSU0MHVzZV9rZXJuZWxfZnVuY19mcm9tX2h1YiglMjJteV9jdXN0b21fZnVuYyUyMiklMEFkZWYlMjBteV9jdXN0b21fZnVuYyh4JTNBJTIwdG9yY2guVGVuc29yKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyME9yaWdpbmFsJTIwaW1wbGVtZW50YXRpb24lMEElMjAlMjAlMjAlMjByZXR1cm4lMjB4JTBBJTBBY2xhc3MlMjBNeU1vZGVsKHRvcmNoLm5uLk1vZHVsZSklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBfX2luaXRfXyhzZWxmKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHN1cGVyKCkuX19pbml0X18oKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHNlbGYuZm4lMjAlM0QlMjBteV9jdXN0b21fZnVuYyUwQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGZvcndhcmQoc2VsZiUyQyUyMHgpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwc2VsZi5mbih4KSUwQSUwQW1vZGVsJTIwJTNEJTIwTXlNb2RlbCgpJTBBJTBBJTIzJTIwVGhlJTIwbGF5ZXIlMjBjYW4lMjBub3clMjBiZSUyMGtlcm5lbGl6ZWQlM0ElMEElMjMlMjBtb2RlbCUyMCUzRCUyMGtlcm5lbGl6ZShtb2RlbCUyQyUyMG1vZGUlM0RNb2RlLlRSQUlOSU5HJTIwJTdDJTIwTW9kZS5UT1JDSF9DT01QSUxFJTJDJTIwZGV2aWNlJTNEJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_func_from_hub
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> Mode, kernelize
<span class="hljs-meta">@use_kernel_func_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;my_custom_func&quot;</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">my_custom_func</span>(<span class="hljs-params">x: torch.Tensor</span>):
<span class="hljs-comment"># Original implementation</span>
<span class="hljs-keyword">return</span> x
<span class="hljs-keyword">class</span> <span class="hljs-title class_">MyModel</span>(torch.nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">__init__</span>(<span class="hljs-params">self</span>):
<span class="hljs-built_in">super</span>().__init__()
self.fn = my_custom_func
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x</span>):
<span class="hljs-keyword">return</span> self.fn(x)
model = MyModel()
<span class="hljs-comment"># The layer can now be kernelized:</span>
<span class="hljs-comment"># model = kernelize(model, mode=Mode.TRAINING | Mode.TORCH_COMPILE, device=&quot;cuda&quot;)</span>`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function Ds(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEElMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwdXNlX2tlcm5lbGl6ZWRfZnVuYyUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwTW9kZSUyQyUyMGtlcm5lbGl6ZSUwQSUwQSUyMyUyMFVzZSUyMG9uJTIwYSUyMGZ1bmN0aW9uJTIwKGNvbnZlcnRzJTIwdGhlJTIwZnVuY3Rpb24lMjB0byUyMCU2MG5uLk1vZHVsZSU2MCkuJTIwVGhlJTIwZnVuY3Rpb24lMEElMjMlMjBjYW4lMjB0aGVuJTIwYmUlMjByZXBsYWNlZCUyMHdpdGglMjBhJTIwbGF5ZXIlMjBtYXBwaW5nJTIwZm9yJTIwJTYwTXlDdXN0b21MYXllciU2MC4lMEElNDB1c2Vfa2VybmVsX2ZvcndhcmRfZnJvbV9odWIoJTIyTXlDdXN0b21MYXllciUyMiklMEFkZWYlMjBpZGVudGl0eSh4JTNBJTIwdG9yY2guVGVuc29yKSUyMC0lM0UlMjB0b3JjaC5UZW5zb3IlM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjB4JTBBJTBBJTQwdXNlX2tlcm5lbGl6ZWRfZnVuYyhpZGVudGl0eSklMEFjbGFzcyUyMExheWVyVXNpbmdJZGVudGl0eShubi5Nb2R1bGUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIweCUzQSUyMHRvcmNoLlRlbnNvciklMjAtJTNFJTIwdG9yY2guVGVuc29yJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmV0dXJuJTIwaWRlbnRpdHkoeCklMEElMEFtb2RlbCUyMCUzRCUyMExheWVyVXNpbmdJZGVudGl0eSgpJTBBJTBBJTIzJTIwVGhlJTIwbGF5ZXIlMjBjYW4lMjBub3clMjBiZSUyMGtlcm5lbGl6ZWQlM0ElMEElMjMlMjBtb2RlbCUyMCUzRCUyMGtlcm5lbGl6ZShtb2RlbCUyQyUyMG1vZGUlM0RNb2RlLlRSQUlOSU5HJTIwJTdDJTIwTW9kZS5UT1JDSF9DT01QSUxFJTJDJTIwZGV2aWNlJTNEJTIyY3VkYSUyMik=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_forward_from_hub
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernelized_func
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> Mode, kernelize
<span class="hljs-comment"># Use on a function (converts the function to \`nn.Module\`). The function</span>
<span class="hljs-comment"># can then be replaced with a layer mapping for \`MyCustomLayer\`.</span>
<span class="hljs-meta">@use_kernel_forward_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;MyCustomLayer&quot;</span></span>)</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">identity</span>(<span class="hljs-params">x: torch.Tensor</span>) -&gt; torch.Tensor:
<span class="hljs-keyword">return</span> x
<span class="hljs-meta">@use_kernelized_func(<span class="hljs-params">identity</span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">LayerUsingIdentity</span>(nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>) -&gt; torch.Tensor:
<span class="hljs-keyword">return</span> identity(x)
model = LayerUsingIdentity()
<span class="hljs-comment"># The layer can now be kernelized:</span>
<span class="hljs-comment"># model = kernelize(model, mode=Mode.TRAINING | Mode.TORCH_COMPILE, device=&quot;cuda&quot;)</span>`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function Ps(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjByZXBsYWNlX2tlcm5lbF9mb3J3YXJkX2Zyb21faHViJTBBaW1wb3J0JTIwdG9yY2gubm4lMjBhcyUyMG5uJTBBJTBBcmVwbGFjZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1Yihubi5MYXllck5vcm0lMkMlMjAlMjJMYXllck5vcm0lMjIp",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> replace_kernel_forward_from_hub
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
replace_kernel_forward_from_hub(nn.LayerNorm, <span class="hljs-string">&quot;LayerNorm&quot;</span>)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function qs(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEFmcm9tJTIwdG9yY2gubm4lMjBpbXBvcnQlMjBmdW5jdGlvbmFsJTIwYXMlMjBGJTBBJTBBZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjB1c2Vfa2VybmVsX2ZvcndhcmRfZnJvbV9odWIlMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMHVzZV9rZXJuZWxfbWFwcGluZyUyQyUyMExheWVyUmVwb3NpdG9yeSUyQyUyMERldmljZSUwQWZyb20lMjBrZXJuZWxzJTIwaW1wb3J0JTIwTW9kZSUyQyUyMGtlcm5lbGl6ZSUwQSUwQSUyMyUyMERlZmluZSUyMGElMjBtYXBwaW5nJTBBbWFwcGluZyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMlNpbHVBbmRNdWwlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjdWRhJTIyJTNBJTIwTGF5ZXJSZXBvc2l0b3J5KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJrZXJuZWxzLWNvbW11bml0eSUyRmFjdGl2YXRpb24lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYXllcl9uYW1lJTNEJTIyU2lsdUFuZE11bCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHZlcnNpb24lM0QxJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMCU3RCUwQSU3RCUwQSUwQSU0MHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiglMjJTaWx1QW5kTXVsJTIyKSUwQWNsYXNzJTIwU2lsdUFuZE11bChubi5Nb2R1bGUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIweCUzQSUyMHRvcmNoLlRlbnNvciklMjAtJTNFJTIwdG9yY2guVGVuc29yJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZCUyMCUzRCUyMHguc2hhcGUlNUItMSU1RCUyMCUyRiUyRiUyMDIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBGLnNpbHUoeCU1Qi4uLiUyQyUyMCUzQWQlNUQpJTIwKiUyMHglNUIuLi4lMkMlMjBkJTNBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBTaWx1QW5kTXVsKCklMEElMEElMjMlMjBVc2UlMjB0aGUlMjBtYXBwaW5nJTIwZm9yJTIwdGhlJTIwZHVyYXRpb24lMjBvZiUyMHRoZSUyMGNvbnRleHQuJTBBd2l0aCUyMHVzZV9rZXJuZWxfbWFwcGluZyhtYXBwaW5nKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMGtlcm5lbGl6ZSUyMHVzZXMlMjB0aGUlMjB0ZW1wb3JhcnklMjBtYXBwaW5nJTBBJTIwJTIwJTIwJTIwbW9kZWwlMjAlM0QlMjBrZXJuZWxpemUobW9kZWwlMkMlMjBtb2RlJTNETW9kZS5UUkFJTklORyUyMCU3QyUyME1vZGUuVE9SQ0hfQ09NUElMRSUyQyUyMGRldmljZSUzRCUyMmN1ZGElMjIpJTBBJTBBJTIzJTIwT3V0c2lkZSUyMHRoZSUyMGNvbnRleHQlMkMlMjBvcmlnaW5hbCUyMG1hcHBpbmdzJTIwYXJlJTIwcmVzdG9yZWQ=",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-keyword">from</span> torch.nn <span class="hljs-keyword">import</span> functional <span class="hljs-keyword">as</span> F
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_forward_from_hub
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_mapping, LayerRepository, Device
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> Mode, kernelize
<span class="hljs-comment"># Define a mapping</span>
mapping = {
<span class="hljs-string">&quot;SiluAndMul&quot;</span>: {
<span class="hljs-string">&quot;cuda&quot;</span>: LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/activation&quot;</span>,
layer_name=<span class="hljs-string">&quot;SiluAndMul&quot;</span>,
version=<span class="hljs-number">1</span>
)
}
}
<span class="hljs-meta">@use_kernel_forward_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;SiluAndMul&quot;</span></span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">SiluAndMul</span>(nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>) -&gt; torch.Tensor:
d = x.shape[-<span class="hljs-number">1</span>] // <span class="hljs-number">2</span>
<span class="hljs-keyword">return</span> F.silu(x[..., :d]) * x[..., d:]
model = SiluAndMul()
<span class="hljs-comment"># Use the mapping for the duration of the context.</span>
<span class="hljs-keyword">with</span> use_kernel_mapping(mapping):
<span class="hljs-comment"># kernelize uses the temporary mapping</span>
model = kernelize(model, mode=Mode.TRAINING | Mode.TORCH_COMPILE, device=<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-comment"># Outside the context, original mappings are restored</span>`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function Ks(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBMYXllclJlcG9zaXRvcnklMkMlMjByZWdpc3Rlcl9rZXJuZWxfbWFwcGluZyUyQyUyME1vZGUlMEElMEElMjMlMjBTaW1wbGUlMjBtYXBwaW5nJTIwZm9yJTIwYSUyMHNpbmdsZSUyMGtlcm5lbCUyMHBlciUyMGRldmljZSUwQWtlcm5lbF9sYXllcl9tYXBwaW5nJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIyTGxhbWFSTVNOb3JtJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY3VkYSUyMiUzQSUyMExheWVyUmVwb3NpdG9yeSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXBvX2lkJTNEJTIya2VybmVscy1jb21tdW5pdHklMkZsYXllcl9ub3JtJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbGF5ZXJfbmFtZSUzRCUyMkxsYW1hUk1TTm9ybSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHZlcnNpb24lM0QxJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSU3RCUwQXJlZ2lzdGVyX2tlcm5lbF9tYXBwaW5nKGtlcm5lbF9sYXllcl9tYXBwaW5nKSUwQSUwQSUyMyUyMEFkdmFuY2VkJTIwbWFwcGluZyUyMHdpdGglMjBtb2RlLXNwZWNpZmljJTIwa2VybmVscyUwQWFkdmFuY2VkX21hcHBpbmclMjAlM0QlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjJNdWx0aUhlYWRBdHRlbnRpb24lMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjdWRhJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwTW9kZS5UUkFJTklORyUzQSUyMExheWVyUmVwb3NpdG9yeSglMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXBvX2lkJTNEJTIya2VybmVscy1jb21tdW5pdHklMkZ0cmFpbmluZy1rZXJuZWxzJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbGF5ZXJfbmFtZSUzRCUyMlRyYWluaW5nQXR0ZW50aW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwdmVyc2lvbiUzRDElMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjApJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwTW9kZS5JTkZFUkVOQ0UlM0ElMjBMYXllclJlcG9zaXRvcnkoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVwb19pZCUzRCUyMmtlcm5lbHMtY29tbXVuaXR5JTJGaW5mZXJlbmNlLWtlcm5lbHMlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYXllcl9uYW1lJTNEJTIyRmFzdEF0dGVudGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHZlcnNpb24lM0QxJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUwQSUyMCUyMCUyMCUyMCU3RCUwQSU3RCUwQXJlZ2lzdGVyX2tlcm5lbF9tYXBwaW5nKGFkdmFuY2VkX21hcHBpbmcp",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> LayerRepository, register_kernel_mapping, Mode
<span class="hljs-comment"># Simple mapping for a single kernel per device</span>
kernel_layer_mapping = {
<span class="hljs-string">&quot;LlamaRMSNorm&quot;</span>: {
<span class="hljs-string">&quot;cuda&quot;</span>: LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/layer_norm&quot;</span>,
layer_name=<span class="hljs-string">&quot;LlamaRMSNorm&quot;</span>,
version=<span class="hljs-number">1</span>,
),
},
}
register_kernel_mapping(kernel_layer_mapping)
<span class="hljs-comment"># Advanced mapping with mode-specific kernels</span>
advanced_mapping = {
<span class="hljs-string">&quot;MultiHeadAttention&quot;</span>: {
<span class="hljs-string">&quot;cuda&quot;</span>: {
Mode.TRAINING: LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/training-kernels&quot;</span>,
layer_name=<span class="hljs-string">&quot;TrainingAttention&quot;</span>,
version=<span class="hljs-number">1</span>,
),
Mode.INFERENCE: LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/inference-kernels&quot;</span>,
layer_name=<span class="hljs-string">&quot;FastAttention&quot;</span>,
version=<span class="hljs-number">1</span>,
),
}
}
}
register_kernel_mapping(advanced_mapping)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function Os(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"aW1wb3J0JTIwdG9yY2glMEFpbXBvcnQlMjB0b3JjaC5ubiUyMGFzJTIwbm4lMEElMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMGtlcm5lbGl6ZSUyQyUyME1vZGUlMkMlMjB1c2Vfa2VybmVsX21hcHBpbmclMkMlMjBMYXllclJlcG9zaXRvcnklMEFmcm9tJTIwa2VybmVscyUyMGltcG9ydCUyMHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiUwQSUwQSU0MHVzZV9rZXJuZWxfZm9yd2FyZF9mcm9tX2h1YiglMjJTaWx1QW5kTXVsJTIyKSUwQWNsYXNzJTIwU2lsdUFuZE11bChubi5Nb2R1bGUpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZm9yd2FyZChzZWxmJTJDJTIweCUzQSUyMHRvcmNoLlRlbnNvciklMjAtJTNFJTIwdG9yY2guVGVuc29yJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwZCUyMCUzRCUyMHguc2hhcGUlNUItMSU1RCUyMCUyRiUyRiUyMDIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBGLnNpbHUoeCU1Qi4uLiUyQyUyMCUzQWQlNUQpJTIwKiUyMHglNUIuLi4lMkMlMjBkJTNBJTVEJTBBJTBBbWFwcGluZyUyMCUzRCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMlNpbHVBbmRNdWwlMjIlM0ElMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJjdWRhJTIyJTNBJTIwTGF5ZXJSZXBvc2l0b3J5KCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJlcG9faWQlM0QlMjJrZXJuZWxzLWNvbW11bml0eSUyRmFjdGl2YXRpb24lMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYXllcl9uYW1lJTNEJTIyU2lsdUFuZE11bCUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHZlcnNpb24lM0QxJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwKSUwQSUyMCUyMCUyMCUyMCU3RCUwQSU3RCUwQSUwQSUyMyUyMENyZWF0ZSUyMGFuZCUyMGtlcm5lbGl6ZSUyMGElMjBtb2RlbCUwQW1vZGVsJTIwJTNEJTIwbm4uU2VxdWVudGlhbCglMEElMjAlMjAlMjAlMjBubi5MaW5lYXIoMTAyNCUyQyUyMDIwNDglMkMlMjBkZXZpY2UlM0QlMjJjdWRhJTIyKSUyQyUwQSUyMCUyMCUyMCUyMFNpbHVBbmRNdWwoKSUyQyUwQSklMEElMEElMjMlMjBLZXJuZWxpemUlMjBmb3IlMjBpbmZlcmVuY2UlMEF3aXRoJTIwdXNlX2tlcm5lbF9tYXBwaW5nKG1hcHBpbmcpJTNBJTBBJTIwJTIwJTIwJTIwa2VybmVsaXplZF9tb2RlbCUyMCUzRCUyMGtlcm5lbGl6ZShtb2RlbCUyQyUyMG1vZGUlM0RNb2RlLlRSQUlOSU5HJTIwJTdDJTIwTW9kZS5UT1JDSF9DT01QSUxFKQ==",highlighted:`<span class="hljs-keyword">import</span> torch
<span class="hljs-keyword">import</span> torch.nn <span class="hljs-keyword">as</span> nn
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> kernelize, Mode, use_kernel_mapping, LayerRepository
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> use_kernel_forward_from_hub
<span class="hljs-meta">@use_kernel_forward_from_hub(<span class="hljs-params"><span class="hljs-string">&quot;SiluAndMul&quot;</span></span>)</span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">SiluAndMul</span>(nn.Module):
<span class="hljs-keyword">def</span> <span class="hljs-title function_">forward</span>(<span class="hljs-params">self, x: torch.Tensor</span>) -&gt; torch.Tensor:
d = x.shape[-<span class="hljs-number">1</span>] // <span class="hljs-number">2</span>
<span class="hljs-keyword">return</span> F.silu(x[..., :d]) * x[..., d:]
mapping = {
<span class="hljs-string">&quot;SiluAndMul&quot;</span>: {
<span class="hljs-string">&quot;cuda&quot;</span>: LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/activation&quot;</span>,
layer_name=<span class="hljs-string">&quot;SiluAndMul&quot;</span>,
version=<span class="hljs-number">1</span>,
)
}
}
<span class="hljs-comment"># Create and kernelize a model</span>
model = nn.Sequential(
nn.Linear(<span class="hljs-number">1024</span>, <span class="hljs-number">2048</span>, device=<span class="hljs-string">&quot;cuda&quot;</span>),
SiluAndMul(),
)
<span class="hljs-comment"># Kernelize for inference</span>
<span class="hljs-keyword">with</span> use_kernel_mapping(mapping):
kernelized_model = kernelize(model, mode=Mode.TRAINING | Mode.TORCH_COMPILE)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function er(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBEZXZpY2UlMkMlMjBDVURBUHJvcGVydGllcyUwQSUwQSUyMyUyMEJhc2ljJTIwQ1VEQSUyMGRldmljZSUwQWN1ZGFfZGV2aWNlJTIwJTNEJTIwRGV2aWNlKHR5cGUlM0QlMjJjdWRhJTIyKSUwQSUwQSUyMyUyMENVREElMjBkZXZpY2UlMjB3aXRoJTIwc3BlY2lmaWMlMjBjYXBhYmlsaXR5JTIwcmVxdWlyZW1lbnRzJTBBY3VkYV9kZXZpY2Vfd2l0aF9wcm9wcyUyMCUzRCUyMERldmljZSglMEElMjAlMjAlMjAlMjB0eXBlJTNEJTIyY3VkYSUyMiUyQyUwQSUyMCUyMCUyMCUyMHByb3BlcnRpZXMlM0RDVURBUHJvcGVydGllcyhtaW5fY2FwYWJpbGl0eSUzRDc1JTJDJTIwbWF4X2NhcGFiaWxpdHklM0Q5MCklMEEpJTBBJTBBJTIzJTIwTVBTJTIwZGV2aWNlJTIwZm9yJTIwQXBwbGUlMjBTaWxpY29uJTBBbXBzX2RldmljZSUyMCUzRCUyMERldmljZSh0eXBlJTNEJTIybXBzJTIyKSUwQSUwQSUyMyUyMFhQVSUyMGRldmljZSUyMChlLmcuJTJDJTIwSW50ZWwoUiklMjBEYXRhJTIwQ2VudGVyJTIwR1BVJTIwTWF4JTIwMTU1MCklMEF4cHVfZGV2aWNlJTIwJTNEJTIwRGV2aWNlKHR5cGUlM0QlMjJ4cHUlMjIpJTBBJTBBJTIzJTIwTlBVJTIwZGV2aWNlJTIwKEh1YXdlaSUyMEFzY2VuZCklMEFucHVfZGV2aWNlJTIwJTNEJTIwRGV2aWNlKHR5cGUlM0QlMjJucHUlMjIp",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> Device, CUDAProperties
<span class="hljs-comment"># Basic CUDA device</span>
cuda_device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;cuda&quot;</span>)
<span class="hljs-comment"># CUDA device with specific capability requirements</span>
cuda_device_with_props = Device(
<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;cuda&quot;</span>,
properties=CUDAProperties(min_capability=<span class="hljs-number">75</span>, max_capability=<span class="hljs-number">90</span>)
)
<span class="hljs-comment"># MPS device for Apple Silicon</span>
mps_device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;mps&quot;</span>)
<span class="hljs-comment"># XPU device (e.g., Intel(R) Data Center GPU Max 1550)</span>
xpu_device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;xpu&quot;</span>)
<span class="hljs-comment"># NPU device (Huawei Ascend)</span>
npu_device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;npu&quot;</span>)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function tr(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBDVURBUHJvcGVydGllcyUyQyUyMERldmljZSUwQSUwQSUyMyUyMERlZmluZSUyMENVREElMjBwcm9wZXJ0aWVzJTIwZm9yJTIwbW9kZXJuJTIwR1BVcyUyMChjb21wdXRlJTIwY2FwYWJpbGl0eSUyMDcuNSUyMHRvJTIwOS4wKSUwQWN1ZGFfcHJvcHMlMjAlM0QlMjBDVURBUHJvcGVydGllcyhtaW5fY2FwYWJpbGl0eSUzRDc1JTJDJTIwbWF4X2NhcGFiaWxpdHklM0Q5MCklMEElMEElMjMlMjBDcmVhdGUlMjBhJTIwZGV2aWNlJTIwd2l0aCUyMHRoZXNlJTIwcHJvcGVydGllcyUwQWRldmljZSUyMCUzRCUyMERldmljZSh0eXBlJTNEJTIyY3VkYSUyMiUyQyUyMHByb3BlcnRpZXMlM0RjdWRhX3Byb3BzKQ==",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> CUDAProperties, Device
<span class="hljs-comment"># Define CUDA properties for modern GPUs (compute capability 7.5 to 9.0)</span>
cuda_props = CUDAProperties(min_capability=<span class="hljs-number">75</span>, max_capability=<span class="hljs-number">90</span>)
<span class="hljs-comment"># Create a device with these properties</span>
device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;cuda&quot;</span>, properties=cuda_props)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function nr(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBST0NNUHJvcGVydGllcyUyQyUyMERldmljZSUwQSUwQSUyMyUyMERlZmluZSUyMFJPQ00lMjBwcm9wZXJ0aWVzJTIwZm9yJTIwbW9kZXJuJTIwR1BVcyUyMChjb21wdXRlJTIwY2FwYWJpbGl0eSUyMDcuNSUyMHRvJTIwOS4wKSUwQXJvY21fcHJvcHMlMjAlM0QlMjBST0NNUHJvcGVydGllcyhtaW5fY2FwYWJpbGl0eSUzRDc1JTJDJTIwbWF4X2NhcGFiaWxpdHklM0Q5MCklMEElMEElMjMlMjBDcmVhdGUlMjBhJTIwZGV2aWNlJTIwd2l0aCUyMHRoZXNlJTIwcHJvcGVydGllcyUwQWRldmljZSUyMCUzRCUyMERldmljZSh0eXBlJTNEJTIycm9jbSUyMiUyQyUyMHByb3BlcnRpZXMlM0Ryb2NtX3Byb3BzKQ==",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> ROCMProperties, Device
<span class="hljs-comment"># Define ROCM properties for modern GPUs (compute capability 7.5 to 9.0)</span>
rocm_props = ROCMProperties(min_capability=<span class="hljs-number">75</span>, max_capability=<span class="hljs-number">90</span>)
<span class="hljs-comment"># Create a device with these properties</span>
device = Device(<span class="hljs-built_in">type</span>=<span class="hljs-string">&quot;rocm&quot;</span>, properties=rocm_props)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function lr(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBGdW5jUmVwb3NpdG9yeSUwQSUwQSUyMyUyMFJlZmVyZW5jZSUyMGElMjBzcGVjaWZpYyUyMGxheWVyJTIwYnklMjByZXZpc2lvbiUwQWxheWVyX3JlcG8lMjAlM0QlMjBGdW5jUmVwb3NpdG9yeSglMEElMjAlMjAlMjAlMjByZXBvX2lkJTNEJTIya2VybmVscy1jb21tdW5pdHklMkZhY3RpdmF0aW9uJTIyJTJDJTBBJTIwJTIwJTIwJTIwZnVuY19uYW1lJTNEJTIyc2lsdV9hbmRfbXVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwcmV2aXNpb24lM0QlMjJtYWluJTIyJTJDJTBBKSUwQSUwQSUyMyUyMFJlZmVyZW5jZSUyMGElMjBsYXllciUyMGJ5JTIwdmVyc2lvbiUwQWxheWVyX3JlcG9fdmVyc2lvbmVkJTIwJTNEJTIwRnVuY1JlcG9zaXRvcnkoJTBBJTIwJTIwJTIwJTIwcmVwb19pZCUzRCUyMmtlcm5lbHMtY29tbXVuaXR5JTJGcmVsdSUyMiUyQyUwQSUyMCUyMCUyMCUyMGZ1bmNfbmFtZSUzRCUyMnJlbHUlMjIlMkMlMEElMjAlMjAlMjAlMjB2ZXJzaW9uJTNEMSUwQSk=",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> FuncRepository
<span class="hljs-comment"># Reference a specific layer by revision</span>
layer_repo = FuncRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/activation&quot;</span>,
func_name=<span class="hljs-string">&quot;silu_and_mul&quot;</span>,
revision=<span class="hljs-string">&quot;main&quot;</span>,
)
<span class="hljs-comment"># Reference a layer by version</span>
layer_repo_versioned = FuncRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/relu&quot;</span>,
func_name=<span class="hljs-string">&quot;relu&quot;</span>,
version=<span class="hljs-number">1</span>
)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function sr(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBMYXllclJlcG9zaXRvcnklMEElMEElMjMlMjBSZWZlcmVuY2UlMjBhJTIwc3BlY2lmaWMlMjBsYXllciUyMGJ5JTIwdmVyc2lvbiUwQWxheWVyX3JlcG8lMjAlM0QlMjBMYXllclJlcG9zaXRvcnkoJTBBJTIwJTIwJTIwJTIwcmVwb19pZCUzRCUyMmtlcm5lbHMtY29tbXVuaXR5JTJGYWN0aXZhdGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMGxheWVyX25hbWUlM0QlMjJTaWx1QW5kTXVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwdmVyc2lvbiUzRDElMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> LayerRepository
<span class="hljs-comment"># Reference a specific layer by version</span>
layer_repo = LayerRepository(
repo_id=<span class="hljs-string">&quot;kernels-community/activation&quot;</span>,
layer_name=<span class="hljs-string">&quot;SiluAndMul&quot;</span>,
version=<span class="hljs-number">1</span>,
)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function rr(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTBBJTBBZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBMb2NhbEZ1bmNSZXBvc2l0b3J5JTBBJTBBJTIzJTIwUmVmZXJlbmNlJTIwYSUyMHNwZWNpZmljJTIwbGF5ZXIlMjBieSUyMHJldmlzaW9uJTBBbGF5ZXJfcmVwbyUyMCUzRCUyMExvY2FsRnVuY1JlcG9zaXRvcnkoJTBBJTIwJTIwJTIwJTIwcmVwb19wYXRoJTNEUGF0aCglMjIlMkZob21lJTJGZGFuaWVsJTJGa2VybmVscyUyRmFjdGl2YXRpb24lMjIpJTJDJTBBJTIwJTIwJTIwJTIwZnVuY19uYW1lJTNEJTIyc2lsdV9hbmRfbXVsJTIyJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> LocalFuncRepository
<span class="hljs-comment"># Reference a specific layer by revision</span>
layer_repo = LocalFuncRepository(
repo_path=Path(<span class="hljs-string">&quot;/home/daniel/kernels/activation&quot;</span>),
func_name=<span class="hljs-string">&quot;silu_and_mul&quot;</span>,
)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function ar(k){let n,U="Example:",y,s,d;return s=new W({props:{code:"ZnJvbSUyMHBhdGhsaWIlMjBpbXBvcnQlMjBQYXRoJTBBJTBBZnJvbSUyMGtlcm5lbHMlMjBpbXBvcnQlMjBMb2NhbExheWVyUmVwb3NpdG9yeSUwQSUwQSUyMyUyMFJlZmVyZW5jZSUyMGElMjBzcGVjaWZpYyUyMGxheWVyJTIwYnklMjByZXZpc2lvbiUwQWxheWVyX3JlcG8lMjAlM0QlMjBMb2NhbExheWVyUmVwb3NpdG9yeSglMEElMjAlMjAlMjAlMjByZXBvX3BhdGglM0RQYXRoKCUyMiUyRmhvbWUlMkZkYW5pZWwlMkZrZXJuZWxzJTJGYWN0aXZhdGlvbiUyMiklMkMlMEElMjAlMjAlMjAlMjBsYXllcl9uYW1lJTNEJTIyU2lsdUFuZE11bCUyMiUyQyUwQSk=",highlighted:`<span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-keyword">from</span> kernels <span class="hljs-keyword">import</span> LocalLayerRepository
<span class="hljs-comment"># Reference a specific layer by revision</span>
layer_repo = LocalLayerRepository(
repo_path=Path(<span class="hljs-string">&quot;/home/daniel/kernels/activation&quot;</span>),
layer_name=<span class="hljs-string">&quot;SiluAndMul&quot;</span>,
)`,lang:"python",wrap:!1}}),{c(){n=c("p"),n.textContent=U,y=r(),u(s.$$.fragment)},l(t){n=m(t,"P",{"data-svelte-h":!0}),b(n)!=="svelte-11lpom8"&&(n.textContent=U),y=a(t),M(s.$$.fragment,t)},m(t,T){i(t,n,T),i(t,y,T),f(s,t,T),d=!0},p:V,i(t){d||(h(s.$$.fragment,t),d=!0)},o(t){w(s.$$.fragment,t),d=!1},d(t){t&&(o(n),o(y)),g(s,t)}}}function or(k){let n,U,y,s,d,t,T,on,je,pn,$e,cn,x,_e,Dn,Tt,Ol="Decorator factory that makes a layer extensible using the specified layer name.",Pn,bt,es=`This decorator which prepares a layer class to use kernel layers from the Hugging
Face Hub.`,qn,Ut,ts=`When applied to a function, the function is converted into a layer (<code>nn.Module</code>),
made extensible using the given layer name, and then the class is instantiated.
Since <code>nn.Module</code> also implements the <code>__call__</code> method, the module can still be
used as if it was a function. Note that a decorated function is only visible to
<a href="/docs/kernels/pr_676/en/api/layers#kernels.kernelize">kernelize()</a> if it is attached to a module using <a href="/docs/kernels/pr_676/en/api/layers#kernels.use_kernelized_func">use_kernelized_func()</a>.`,Kn,re,mn,Ce,dn,C,Ie,On,kt,ns="Decorator that makes a function extensible using the specified function name.",el,Jt,ls=`This is a decorator factory that returns a decorator which prepares a function to use kernels from the
Hugging Face Hub.`,tl,jt,ss=`The function will be exposed as an instance of <code>torch.nn.Module</code> in which
the function is called in <code>forward</code>. For the function to be properly
kernelized, it <strong>must</strong> be a member of another <code>torch.nn.Module</code> that is
part of the model (see the example).`,nl,ve,rs=`<p><code>use_kernel_func_from_hub</code> is deprecated and will be removed in kernels 0.17.
Use <a href="/docs/kernels/pr_676/en/api/layers#kernels.use_kernel_forward_from_hub">use_kernel_forward_from_hub()</a> instead.</p>`,ll,ae,yn,xe,un,D,Be,sl,$t,as=`This decorator attaches the target function within the module as a plain
attribute (not as a submodule). This makes the function visible to
<a href="/docs/kernels/pr_676/en/api/layers#kernels.kernelize">kernelize()</a>.`,rl,oe,Mn,Ze,fn,S,Re,al,_t,os="Function that prepares a layer class to use kernels from the Hugging Face Hub.",ol,Ct,ps=`It is recommended to use <a href="/docs/kernels/pr_676/en/api/layers#kernels.use_kernel_forward_from_hub">use_kernel_forward_from_hub()</a> decorator instead.
This function should only be used as a last resort to extend third-party layers,
it is inherently fragile since the member variables and <code>forward</code> signature
of such a layer can change.`,pl,pe,hn,Ge,wn,Ee,gn,X,Ve,il,It,is="Context manager that sets a kernel mapping for the duration of the context.",cl,vt,cs=`This function allows temporary kernel mappings to be applied within a specific context, enabling different
kernel configurations for different parts of your code.`,ml,ie,Tn,We,bn,N,Se,dl,xt,ms="Register a global mapping between layer names and their corresponding kernel implementations.",yl,Bt,ds=`This function allows you to register a mapping between a layer name and the corresponding kernel(s) to use,
depending on the device and mode. This should be used in conjunction with <a href="/docs/kernels/pr_676/en/api/layers#kernels.kernelize">kernelize()</a>.`,ul,ce,Un,Xe,kn,Ne,Jn,A,Ae,Ml,Zt,ys="Replace layer forward methods with optimized kernel implementations.",fl,Rt,us=`This function iterates over all modules in the model and replaces the <code>forward</code> method of extensible layers
for which kernels are registered using <a href="/docs/kernels/pr_676/en/api/layers#kernels.register_kernel_mapping">register_kernel_mapping()</a> or <a href="/docs/kernels/pr_676/en/api/layers#kernels.use_kernel_mapping">use_kernel_mapping()</a>.`,hl,me,jn,Qe,$n,Fe,_n,B,Le,wl,Gt,Ms="Represents a compute device with optional properties.",gl,Et,fs=`This class encapsulates device information including device type and optional device-specific properties
like CUDA capabilities.`,Tl,de,bl,ye,ze,Ul,Vt,hs="Run class validators on the instance.",Cn,He,In,I,Ye,kl,Wt,ws="CUDA-specific device properties for capability-based kernel selection.",Jl,St,gs=`This class defines CUDA compute capability constraints for kernel selection, allowing kernels to specify
minimum and maximum CUDA compute capabilities they support.`,jl,ue,$l,Xt,Ts=`Note:
CUDA compute capabilities are represented as integers where the major and minor versions are concatenated.
For example, compute capability 7.5 is represented as 75, and 8.6 is represented as 86.`,_l,Me,De,Cl,Nt,bs="Run class validators on the instance.",vn,Pe,xn,v,qe,Il,At,Us="ROCM-specific device properties for capability-based kernel selection.",vl,Qt,ks=`This class defines ROCM compute capability constraints for kernel selection, allowing kernels to specify
minimum and maximum ROCM compute capabilities they support.`,xl,fe,Bl,Ft,Js=`Note:
ROCM compute capabilities are represented as integers where the major and minor versions are concatenated.
For example, compute capability 7.5 is represented as 75, and 8.6 is represented as 86.`,Zl,he,Ke,Rl,Lt,js="Run class validators on the instance.",Bn,Oe,Zn,Q,et,Gl,zt,$s="Kernelize mode",El,Ht,_s=`The <code>Mode</code> flag is used by <a href="/docs/kernels/pr_676/en/api/layers#kernels.kernelize">kernelize()</a> to select kernels for the given mode. Mappings can be registered for
specific modes.`,Vl,Yt,Cs=`Note:
Different modes can be combined. For instance, <code>INFERENCE | TORCH_COMPILE</code> should be used for layers that
are used for inference <em>with</em> <code>torch.compile</code>.`,Rn,tt,Gn,F,nt,Wl,Dt,Is="Repository and name of a function for kernel mapping.",Sl,lt,vs=`<p><code>FuncRepository</code> is deprecated and will be removed in kernels 0.17.
Use <a href="/docs/kernels/pr_676/en/api/layers#kernels.LayerRepository">LayerRepository</a> instead.</p>`,Xl,we,En,st,Vn,P,rt,Nl,Pt,xs="Repository and name of a layer for kernel mapping.",Al,ge,Wn,at,Sn,L,ot,Ql,qt,Bs="Repository and function name from a local directory for kernel mapping.",Fl,pt,Zs=`<p><code>LocalFuncRepository</code> is deprecated and will be removed in kernels 0.17.
Use <a href="/docs/kernels/pr_676/en/api/layers#kernels.LocalLayerRepository">LocalLayerRepository</a> instead.</p>`,Ll,Te,Xn,it,Nn,q,ct,zl,Kt,Rs="Repository from a local directory for kernel mapping.",Hl,be,An,mt,Qn,z,dt,Yl,Ot,Gs="Repository and name of a function.",Dl,en,Es=`In contrast to <code>FuncRepository</code>, this class uses repositories that
are locked inside a project.`,Pl,yt,Vs=`<p><code>LockedFuncRepository</code> is deprecated and will be removed in kernels 0.17.
Use <a href="/docs/kernels/pr_676/en/api/layers#kernels.LockedLayerRepository">LockedLayerRepository</a> instead.</p>`,Fn,ut,Ln,K,Mt,ql,tn,Ws="Repository and name of a layer.",Kl,nn,Ss=`In contrast to <code>LayerRepository</code>, this class uses repositories that
are locked inside a project.`,zn,ft,Hn,an,Yn;return d=new Ls({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),T=new $({props:{title:"Layers API Reference",local:"layers-api-reference",headingTag:"h1"}}),je=new $({props:{title:"Making layers kernel-aware",local:"making-layers-kernel-aware",headingTag:"h2"}}),$e=new $({props:{title:"use_kernel_forward_from_hub",local:"kernels.use_kernel_forward_from_hub",headingTag:"h3"}}),_e=new _({props:{name:"kernels.use_kernel_forward_from_hub",anchor:"kernels.use_kernel_forward_from_hub",parameters:[{name:"layer_name",val:": str"}],parametersDescription:[{anchor:"kernels.use_kernel_forward_from_hub.layer_name",description:`<strong>layer_name</strong> (<code>str</code>) &#x2014;
The name of the layer to use for kernel lookup in registered mappings.`,name:"layer_name"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L270",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A decorator function that can be applied to layer classes.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>Callable</code></p>
`}}),re=new E({props:{anchor:"kernels.use_kernel_forward_from_hub.example",$$slots:{default:[Hs]},$$scope:{ctx:k}}}),Ce=new $({props:{title:"use_kernel_func_from_hub",local:"kernels.use_kernel_func_from_hub",headingTag:"h3"}}),Ie=new _({props:{name:"kernels.use_kernel_func_from_hub",anchor:"kernels.use_kernel_func_from_hub",parameters:[{name:"func_name",val:": str"}],parametersDescription:[{anchor:"kernels.use_kernel_func_from_hub.func_name",description:`<strong>func_name</strong> (<code>str</code>) &#x2014;
The name of the function name to use for kernel lookup in registered mappings.`,name:"func_name"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/func.py#L196",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A decorator function that can be applied to layer classes.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>Callable</code></p>
`}}),ae=new E({props:{anchor:"kernels.use_kernel_func_from_hub.example",$$slots:{default:[Ys]},$$scope:{ctx:k}}}),xe=new $({props:{title:"use_kernelized_func",local:"kernels.use_kernelized_func",headingTag:"h3"}}),Be=new _({props:{name:"kernels.use_kernelized_func",anchor:"kernels.use_kernelized_func",parameters:[{name:"*args",val:": Callable"}],parametersDescription:[{anchor:"kernels.use_kernelized_func.*args",description:`<strong>*args</strong> (<code>Callable</code>) &#x2014;
Kernel functions to attach to the module.`,name:"*args"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L342",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>A decorator function that can be applied to modules.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>Callable</code></p>
`}}),oe=new E({props:{anchor:"kernels.use_kernelized_func.example",$$slots:{default:[Ds]},$$scope:{ctx:k}}}),Ze=new $({props:{title:"replace_kernel_forward_from_hub",local:"kernels.replace_kernel_forward_from_hub",headingTag:"h3"}}),Re=new _({props:{name:"kernels.replace_kernel_forward_from_hub",anchor:"kernels.replace_kernel_forward_from_hub",parameters:[{name:"layer_name",val:": str"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L247"}}),pe=new E({props:{anchor:"kernels.replace_kernel_forward_from_hub.example",$$slots:{default:[Ps]},$$scope:{ctx:k}}}),Ge=new $({props:{title:"Registering kernel mappings",local:"registering-kernel-mappings",headingTag:"h2"}}),Ee=new $({props:{title:"use_kernel_mapping",local:"kernels.use_kernel_mapping",headingTag:"h3"}}),Ve=new _({props:{name:"kernels.use_kernel_mapping",anchor:"kernels.use_kernel_mapping",parameters:[{name:"mapping",val:": dict[str, dict[Device | str, RepositoryProtocol | dict[Mode, RepositoryProtocol]]]"},{name:"inherit_mapping",val:": bool = True"}],parametersDescription:[{anchor:"kernels.use_kernel_mapping.mapping",description:`<strong>mapping</strong> (<code>dict[str, dict[Union[Device, str], Union[LayerRepositoryProtocol, dict[Mode, LayerRepositoryProtocol]]]]</code>) &#x2014;
The kernel mapping to apply. Maps layer names to device-specific kernel configurations.`,name:"mapping"},{anchor:"kernels.use_kernel_mapping.inherit_mapping",description:`<strong>inherit_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
When <code>True</code>, the current mapping will be extended by <code>mapping</code> inside the context. When <code>False</code>,
only <code>mapping</code> is used inside the context.`,name:"inherit_mapping"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/kernelize.py#L17",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>Context manager that handles the temporary kernel mapping.</p>
`}}),ie=new E({props:{anchor:"kernels.use_kernel_mapping.example",$$slots:{default:[qs]},$$scope:{ctx:k}}}),We=new $({props:{title:"register_kernel_mapping",local:"kernels.register_kernel_mapping",headingTag:"h3"}}),Se=new _({props:{name:"kernels.register_kernel_mapping",anchor:"kernels.register_kernel_mapping",parameters:[{name:"mapping",val:": dict[str, dict[Device | str, RepositoryProtocol | dict[Mode, RepositoryProtocol]]]"},{name:"inherit_mapping",val:": bool = True"}],parametersDescription:[{anchor:"kernels.register_kernel_mapping.mapping",description:`<strong>mapping</strong> (<code>dict[str, dict[Union[Device, str], Union[RepositoryProtocol, dict[Mode, RepositoryProtocol]]]]</code>) &#x2014;
The kernel mapping to register globally. Maps layer names to device-specific kernels.
The mapping can specify different kernels for different modes (training, inference, etc.).`,name:"mapping"},{anchor:"kernels.register_kernel_mapping.inherit_mapping",description:`<strong>inherit_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
When <code>True</code>, the current mapping will be extended by <code>mapping</code>. When <code>False</code>, the existing mappings
are erased before adding <code>mapping</code>.`,name:"inherit_mapping"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/kernelize.py#L97"}}),ce=new E({props:{anchor:"kernels.register_kernel_mapping.example",$$slots:{default:[Ks]},$$scope:{ctx:k}}}),Xe=new $({props:{title:"Kernelizing a model",local:"kernelizing-a-model",headingTag:"h2"}}),Ne=new $({props:{title:"kernelize",local:"kernels.kernelize",headingTag:"h3"}}),Ae=new _({props:{name:"kernels.kernelize",anchor:"kernels.kernelize",parameters:[{name:"model",val:": 'nn.Module'"},{name:"mode",val:": Mode"},{name:"device",val:": str | 'torch.device' | None = None"},{name:"use_fallback",val:": bool = True"}],parametersDescription:[{anchor:"kernels.kernelize.model",description:`<strong>model</strong> (<code>nn.Module</code>) &#x2014;
The PyTorch model to kernelize.`,name:"model"},{anchor:"kernels.kernelize.mode",description:`<strong>mode</strong> (<a href="/docs/kernels/pr_676/en/api/layers#kernels.Mode">Mode</a>) &#x2014; The mode that the kernel is going to be used in. For example,
<code>Mode.TRAINING | Mode.TORCH_COMPILE</code> kernelizes the model for training with
<code>torch.compile</code>.`,name:"mode"},{anchor:"kernels.kernelize.device",description:`<strong>device</strong> (<code>Union[str, torch.device]</code>, <em>optional</em>) &#x2014;
The device type to load kernels for. Supported device types are: &#x201C;cuda&#x201D;, &#x201C;mps&#x201D;, &#x201C;npu&#x201D;, &#x201C;rocm&#x201D;, &#x201C;xpu&#x201D;.
The device type will be inferred from the model parameters when not provided.`,name:"device"},{anchor:"kernels.kernelize.use_fallback",description:`<strong>use_fallback</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether to use the original forward method of modules when no compatible kernel could be found.
If set to <code>False</code>, an exception will be raised in such cases.`,name:"use_fallback"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/kernelize.py#L175",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>
<p>The kernelized model with optimized kernel implementations.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>
<p><code>nn.Module</code></p>
`}}),me=new E({props:{anchor:"kernels.kernelize.example",$$slots:{default:[Os]},$$scope:{ctx:k}}}),Qe=new $({props:{title:"Classes",local:"classes",headingTag:"h2"}}),Fe=new $({props:{title:"Device",local:"kernels.Device",headingTag:"h3"}}),Le=new _({props:{name:"class kernels.Device",anchor:"kernels.Device",parameters:[{name:"type",val:": str"},{name:"properties",val:": kernels.layer.device.CUDAProperties | kernels.layer.device.ROCMProperties | None = None"}],parametersDescription:[{anchor:"kernels.Device.type",description:`<strong>type</strong> (<code>str</code>) &#x2014;
The device type (e.g., &#x201C;cuda&#x201D;, &#x201C;mps&#x201D;, &#x201C;npu&#x201D;, &#x201C;rocm&#x201D;, &#x201C;xpu&#x201D;).`,name:"type"},{anchor:"kernels.Device.properties",description:`<strong>properties</strong> (<a href="/docs/kernels/pr_676/en/api/layers#kernels.CUDAProperties">CUDAProperties</a>, <em>optional</em>) &#x2014;
Device-specific properties. Currently only <a href="/docs/kernels/pr_676/en/api/layers#kernels.CUDAProperties">CUDAProperties</a> is supported for CUDA devices.`,name:"properties"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/device.py#L106"}}),de=new E({props:{anchor:"kernels.Device.example",$$slots:{default:[er]},$$scope:{ctx:k}}}),ze=new _({props:{name:"validate",anchor:"kernels.Device.validate",parameters:[],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/huggingface_hub/dataclasses.py#L247"}}),He=new $({props:{title:"CUDAProperties",local:"kernels.CUDAProperties",headingTag:"h3"}}),Ye=new _({props:{name:"class kernels.CUDAProperties",anchor:"kernels.CUDAProperties",parameters:[{name:"min_capability",val:": int"},{name:"max_capability",val:": int"}],parametersDescription:[{anchor:"kernels.CUDAProperties.min_capability",description:`<strong>min_capability</strong> (<code>int</code>) &#x2014;
Minimum CUDA compute capability required (e.g., 75 for compute capability 7.5).`,name:"min_capability"},{anchor:"kernels.CUDAProperties.max_capability",description:`<strong>max_capability</strong> (<code>int</code>) &#x2014;
Maximum CUDA compute capability supported (e.g., 90 for compute capability 9.0).`,name:"max_capability"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/device.py#L8"}}),ue=new E({props:{anchor:"kernels.CUDAProperties.example",$$slots:{default:[tr]},$$scope:{ctx:k}}}),De=new _({props:{name:"validate",anchor:"kernels.CUDAProperties.validate",parameters:[],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/huggingface_hub/dataclasses.py#L247"}}),Pe=new $({props:{title:"ROCMProperties",local:"kernels.ROCMProperties",headingTag:"h3"}}),qe=new _({props:{name:"class kernels.ROCMProperties",anchor:"kernels.ROCMProperties",parameters:[{name:"min_capability",val:": int"},{name:"max_capability",val:": int"}],parametersDescription:[{anchor:"kernels.ROCMProperties.min_capability",description:`<strong>min_capability</strong> (<code>int</code>) &#x2014;
Minimum ROCM compute capability required (e.g., 75 for compute capability 7.5).`,name:"min_capability"},{anchor:"kernels.ROCMProperties.max_capability",description:`<strong>max_capability</strong> (<code>int</code>) &#x2014;
Maximum ROCM compute capability supported (e.g., 90 for compute capability 9.0).`,name:"max_capability"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/device.py#L57"}}),fe=new E({props:{anchor:"kernels.ROCMProperties.example",$$slots:{default:[nr]},$$scope:{ctx:k}}}),Ke=new _({props:{name:"validate",anchor:"kernels.ROCMProperties.validate",parameters:[],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/huggingface_hub/dataclasses.py#L247"}}),Oe=new $({props:{title:"Mode",local:"kernels.Mode",headingTag:"h3"}}),et=new _({props:{name:"class kernels.Mode",anchor:"kernels.Mode",parameters:[{name:"value",val:""},{name:"names",val:" = None"},{name:"module",val:" = None"},{name:"qualname",val:" = None"},{name:"type",val:" = None"},{name:"start",val:" = 1"}],parametersDescription:[{anchor:"kernels.Mode.INFERENCE",description:"<strong>INFERENCE</strong> &#x2014; The kernel is used for inference.",name:"INFERENCE"},{anchor:"kernels.Mode.TRAINING",description:"<strong>TRAINING</strong> &#x2014; The kernel is used for training.",name:"TRAINING"},{anchor:"kernels.Mode.TORCH_COMPILE",description:"<strong>TORCH_COMPILE</strong> &#x2014; The kernel is used with <code>torch.compile</code>.",name:"TORCH_COMPILE"},{anchor:"kernels.Mode.FALLBACK",description:"<strong>FALLBACK</strong> &#x2014; In a kernel mapping, this kernel is used when no other mode matches.",name:"FALLBACK"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/mode.py#L4"}}),tt=new $({props:{title:"FuncRepository",local:"kernels.FuncRepository",headingTag:"h3"}}),nt=new _({props:{name:"class kernels.FuncRepository",anchor:"kernels.FuncRepository",parameters:[{name:"repo_id",val:": str"},{name:"func_name",val:": str"},{name:"revision",val:": str | None = None"},{name:"version",val:": int | None = None"},{name:"trust_remote_code",val:": bool | list[str] = False"}],parametersDescription:[{anchor:"kernels.FuncRepository.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The Hub repository containing the layer.`,name:"repo_id"},{anchor:"kernels.FuncRepository.func_name",description:`<strong>func_name</strong> (<code>str</code>) &#x2014;
The name of the function within the kernel repository.`,name:"func_name"},{anchor:"kernels.FuncRepository.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The specific revision (branch, tag, or commit) to download. Cannot be used together with <code>version</code>.`,name:"revision"},{anchor:"kernels.FuncRepository.version",description:`<strong>version</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The kernel version to download. Cannot be used together with <code>revision</code>.
Either <code>version</code> or <code>revision</code> must be specified.`,name:"version"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/func.py#L26"}}),we=new E({props:{anchor:"kernels.FuncRepository.example",$$slots:{default:[lr]},$$scope:{ctx:k}}}),st=new $({props:{title:"LayerRepository",local:"kernels.LayerRepository",headingTag:"h3"}}),rt=new _({props:{name:"class kernels.LayerRepository",anchor:"kernels.LayerRepository",parameters:[{name:"repo_id",val:": str"},{name:"layer_name",val:": str"},{name:"revision",val:": str | None = None"},{name:"version",val:": int | None = None"},{name:"trust_remote_code",val:": bool | list[str] = False"}],parametersDescription:[{anchor:"kernels.LayerRepository.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The Hub repository containing the layer.`,name:"repo_id"},{anchor:"kernels.LayerRepository.layer_name",description:`<strong>layer_name</strong> (<code>str</code>) &#x2014;
The name of the layer within the kernel repository.`,name:"layer_name"},{anchor:"kernels.LayerRepository.revision",description:`<strong>revision</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The specific revision (branch, tag, or commit) to download. Cannot be used together with <code>version</code>.`,name:"revision"},{anchor:"kernels.LayerRepository.version",description:`<strong>version</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The kernel version to download. Cannot be used together with <code>revision</code>.
Either <code>version</code> or <code>revision</code> must be specified.`,name:"version"},{anchor:"kernels.LayerRepository.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool | list[str]</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to allow loading kernels from untrusted organisations. A list
of signing identities can be provided for future verification support;
until then it warns and falls back to the default trust check.`,name:"trust_remote_code"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L33"}}),ge=new E({props:{anchor:"kernels.LayerRepository.example",$$slots:{default:[sr]},$$scope:{ctx:k}}}),at=new $({props:{title:"LocalFuncRepository",local:"kernels.LocalFuncRepository",headingTag:"h3"}}),ot=new _({props:{name:"class kernels.LocalFuncRepository",anchor:"kernels.LocalFuncRepository",parameters:[{name:"repo_path",val:": Path"},{name:"func_name",val:": str"}],parametersDescription:[{anchor:"kernels.LocalFuncRepository.repo_path",description:`<strong>repo_path</strong> (<code>Path</code>) &#x2014;
The local repository containing the layer.`,name:"repo_path"},{anchor:"kernels.LocalFuncRepository.func_name",description:`<strong>func_name</strong> (<code>str</code>) &#x2014;
The name of the function within the kernel repository.`,name:"func_name"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/func.py#L135"}}),Te=new E({props:{anchor:"kernels.LocalFuncRepository.example",$$slots:{default:[rr]},$$scope:{ctx:k}}}),it=new $({props:{title:"LocalLayerRepository",local:"kernels.LocalLayerRepository",headingTag:"h3"}}),ct=new _({props:{name:"class kernels.LocalLayerRepository",anchor:"kernels.LocalLayerRepository",parameters:[{name:"repo_path",val:": Path"},{name:"layer_name",val:": str"}],parametersDescription:[{anchor:"kernels.LocalLayerRepository.repo_path",description:`<strong>repo_path</strong> (<code>Path</code>) &#x2014;
The local repository containing the layer.`,name:"repo_path"},{anchor:"kernels.LocalLayerRepository.layer_name",description:`<strong>layer_name</strong> (<code>str</code>) &#x2014;
The name of the layer within the kernel repository.`,name:"layer_name"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L129"}}),be=new E({props:{anchor:"kernels.LocalLayerRepository.example",$$slots:{default:[ar]},$$scope:{ctx:k}}}),mt=new $({props:{title:"LockedFuncRepository",local:"kernels.LockedFuncRepository",headingTag:"h3"}}),dt=new _({props:{name:"class kernels.LockedFuncRepository",anchor:"kernels.LockedFuncRepository",parameters:[{name:"repo_id",val:": str"},{name:"lockfile",val:": pathlib.Path | None = None"},{name:"func_name",val:": str"},{name:"trust_remote_code",val:": bool | list[str] = False"}],parametersDescription:[{anchor:"kernels.LockedFuncRepository.repo_id",description:"<strong>repo_id</strong> (<code>str</code>) &#x2014; The Hub repository containing the function.",name:"repo_id"},{anchor:"kernels.LockedFuncRepository.lockfile",description:`<strong>lockfile</strong> (<code>Path</code>, <em>optional</em>) &#x2014; Path to the lockfile. If not provided,
the lockfile will be inferred from the caller&#x2019;s context.`,name:"lockfile"},{anchor:"kernels.LockedFuncRepository.func_name",description:"<strong>func_name</strong> (<code>str</code>) &#x2014; The name of the function within the kernel repository.",name:"func_name"},{anchor:"kernels.LockedFuncRepository.trust_remote_code",description:`<strong>trust_remote_code</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether to allow loading kernels from untrusted organisations.`,name:"trust_remote_code"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/func.py#L255"}}),ut=new $({props:{title:"LockedLayerRepository",local:"kernels.LockedLayerRepository",headingTag:"h3"}}),Mt=new _({props:{name:"class kernels.LockedLayerRepository",anchor:"kernels.LockedLayerRepository",parameters:[{name:"repo_id",val:": str"},{name:"lockfile",val:": Path | None = None"},{name:"layer_name",val:": str"},{name:"trust_remote_code",val:": bool | list[str] = False"}],source:"https://github.com/huggingface/kernels/blob/vr_676/kernels/src/kernels/layer/layer.py#L180"}}),ft=new zs({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/api/layers.md"}}),{c(){n=c("meta"),U=r(),y=c("p"),s=r(),u(d.$$.fragment),t=r(),u(T.$$.fragment),on=r(),u(je.$$.fragment),pn=r(),u($e.$$.fragment),cn=r(),x=c("div"),u(_e.$$.fragment),Dn=r(),Tt=c("p"),Tt.textContent=Ol,Pn=r(),bt=c("p"),bt.textContent=es,qn=r(),Ut=c("p"),Ut.innerHTML=ts,Kn=r(),u(re.$$.fragment),mn=r(),u(Ce.$$.fragment),dn=r(),C=c("div"),u(Ie.$$.fragment),On=r(),kt=c("p"),kt.textContent=ns,el=r(),Jt=c("p"),Jt.textContent=ls,tl=r(),jt=c("p"),jt.innerHTML=ss,nl=r(),ve=c("blockquote"),ve.innerHTML=rs,ll=r(),u(ae.$$.fragment),yn=r(),u(xe.$$.fragment),un=r(),D=c("div"),u(Be.$$.fragment),sl=r(),$t=c("p"),$t.innerHTML=as,rl=r(),u(oe.$$.fragment),Mn=r(),u(Ze.$$.fragment),fn=r(),S=c("div"),u(Re.$$.fragment),al=r(),_t=c("p"),_t.textContent=os,ol=r(),Ct=c("p"),Ct.innerHTML=ps,pl=r(),u(pe.$$.fragment),hn=r(),u(Ge.$$.fragment),wn=r(),u(Ee.$$.fragment),gn=r(),X=c("div"),u(Ve.$$.fragment),il=r(),It=c("p"),It.textContent=is,cl=r(),vt=c("p"),vt.textContent=cs,ml=r(),u(ie.$$.fragment),Tn=r(),u(We.$$.fragment),bn=r(),N=c("div"),u(Se.$$.fragment),dl=r(),xt=c("p"),xt.textContent=ms,yl=r(),Bt=c("p"),Bt.innerHTML=ds,ul=r(),u(ce.$$.fragment),Un=r(),u(Xe.$$.fragment),kn=r(),u(Ne.$$.fragment),Jn=r(),A=c("div"),u(Ae.$$.fragment),Ml=r(),Zt=c("p"),Zt.textContent=ys,fl=r(),Rt=c("p"),Rt.innerHTML=us,hl=r(),u(me.$$.fragment),jn=r(),u(Qe.$$.fragment),$n=r(),u(Fe.$$.fragment),_n=r(),B=c("div"),u(Le.$$.fragment),wl=r(),Gt=c("p"),Gt.textContent=Ms,gl=r(),Et=c("p"),Et.textContent=fs,Tl=r(),u(de.$$.fragment),bl=r(),ye=c("div"),u(ze.$$.fragment),Ul=r(),Vt=c("p"),Vt.textContent=hs,Cn=r(),u(He.$$.fragment),In=r(),I=c("div"),u(Ye.$$.fragment),kl=r(),Wt=c("p"),Wt.textContent=ws,Jl=r(),St=c("p"),St.textContent=gs,jl=r(),u(ue.$$.fragment),$l=r(),Xt=c("p"),Xt.textContent=Ts,_l=r(),Me=c("div"),u(De.$$.fragment),Cl=r(),Nt=c("p"),Nt.textContent=bs,vn=r(),u(Pe.$$.fragment),xn=r(),v=c("div"),u(qe.$$.fragment),Il=r(),At=c("p"),At.textContent=Us,vl=r(),Qt=c("p"),Qt.textContent=ks,xl=r(),u(fe.$$.fragment),Bl=r(),Ft=c("p"),Ft.textContent=Js,Zl=r(),he=c("div"),u(Ke.$$.fragment),Rl=r(),Lt=c("p"),Lt.textContent=js,Bn=r(),u(Oe.$$.fragment),Zn=r(),Q=c("div"),u(et.$$.fragment),Gl=r(),zt=c("p"),zt.textContent=$s,El=r(),Ht=c("p"),Ht.innerHTML=_s,Vl=r(),Yt=c("p"),Yt.innerHTML=Cs,Rn=r(),u(tt.$$.fragment),Gn=r(),F=c("div"),u(nt.$$.fragment),Wl=r(),Dt=c("p"),Dt.textContent=Is,Sl=r(),lt=c("blockquote"),lt.innerHTML=vs,Xl=r(),u(we.$$.fragment),En=r(),u(st.$$.fragment),Vn=r(),P=c("div"),u(rt.$$.fragment),Nl=r(),Pt=c("p"),Pt.textContent=xs,Al=r(),u(ge.$$.fragment),Wn=r(),u(at.$$.fragment),Sn=r(),L=c("div"),u(ot.$$.fragment),Ql=r(),qt=c("p"),qt.textContent=Bs,Fl=r(),pt=c("blockquote"),pt.innerHTML=Zs,Ll=r(),u(Te.$$.fragment),Xn=r(),u(it.$$.fragment),Nn=r(),q=c("div"),u(ct.$$.fragment),zl=r(),Kt=c("p"),Kt.textContent=Rs,Hl=r(),u(be.$$.fragment),An=r(),u(mt.$$.fragment),Qn=r(),z=c("div"),u(dt.$$.fragment),Yl=r(),Ot=c("p"),Ot.textContent=Gs,Dl=r(),en=c("p"),en.innerHTML=Es,Pl=r(),yt=c("blockquote"),yt.innerHTML=Vs,Fn=r(),u(ut.$$.fragment),Ln=r(),K=c("div"),u(Mt.$$.fragment),ql=r(),tn=c("p"),tn.textContent=Ws,Kl=r(),nn=c("p"),nn.innerHTML=Ss,zn=r(),u(ft.$$.fragment),Hn=r(),an=c("p"),this.h()},l(e){const l=Fs("svelte-u9bgzb",document.head);n=m(l,"META",{name:!0,content:!0}),l.forEach(o),U=a(e),y=m(e,"P",{}),j(y).forEach(o),s=a(e),M(d.$$.fragment,e),t=a(e),M(T.$$.fragment,e),on=a(e),M(je.$$.fragment,e),pn=a(e),M($e.$$.fragment,e),cn=a(e),x=m(e,"DIV",{class:!0});var H=j(x);M(_e.$$.fragment,H),Dn=a(H),Tt=m(H,"P",{"data-svelte-h":!0}),b(Tt)!=="svelte-17ebw3h"&&(Tt.textContent=Ol),Pn=a(H),bt=m(H,"P",{"data-svelte-h":!0}),b(bt)!=="svelte-1c5jxb9"&&(bt.textContent=es),qn=a(H),Ut=m(H,"P",{"data-svelte-h":!0}),b(Ut)!=="svelte-1vd3c8r"&&(Ut.innerHTML=ts),Kn=a(H),M(re.$$.fragment,H),H.forEach(o),mn=a(e),M(Ce.$$.fragment,e),dn=a(e),C=m(e,"DIV",{class:!0});var Z=j(C);M(Ie.$$.fragment,Z),On=a(Z),kt=m(Z,"P",{"data-svelte-h":!0}),b(kt)!=="svelte-1gabpyp"&&(kt.textContent=ns),el=a(Z),Jt=m(Z,"P",{"data-svelte-h":!0}),b(Jt)!=="svelte-nc81mu"&&(Jt.textContent=ls),tl=a(Z),jt=m(Z,"P",{"data-svelte-h":!0}),b(jt)!=="svelte-1fgrp05"&&(jt.innerHTML=ss),nl=a(Z),ve=m(Z,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(ve)!=="svelte-1x5zgua"&&(ve.innerHTML=rs),ll=a(Z),M(ae.$$.fragment,Z),Z.forEach(o),yn=a(e),M(xe.$$.fragment,e),un=a(e),D=m(e,"DIV",{class:!0});var se=j(D);M(Be.$$.fragment,se),sl=a(se),$t=m(se,"P",{"data-svelte-h":!0}),b($t)!=="svelte-18ai2u6"&&($t.innerHTML=as),rl=a(se),M(oe.$$.fragment,se),se.forEach(o),Mn=a(e),M(Ze.$$.fragment,e),fn=a(e),S=m(e,"DIV",{class:!0});var O=j(S);M(Re.$$.fragment,O),al=a(O),_t=m(O,"P",{"data-svelte-h":!0}),b(_t)!=="svelte-17bjf1v"&&(_t.textContent=os),ol=a(O),Ct=m(O,"P",{"data-svelte-h":!0}),b(Ct)!=="svelte-1d1ofe8"&&(Ct.innerHTML=ps),pl=a(O),M(pe.$$.fragment,O),O.forEach(o),hn=a(e),M(Ge.$$.fragment,e),wn=a(e),M(Ee.$$.fragment,e),gn=a(e),X=m(e,"DIV",{class:!0});var ee=j(X);M(Ve.$$.fragment,ee),il=a(ee),It=m(ee,"P",{"data-svelte-h":!0}),b(It)!=="svelte-4v5vcp"&&(It.textContent=is),cl=a(ee),vt=m(ee,"P",{"data-svelte-h":!0}),b(vt)!=="svelte-124m5et"&&(vt.textContent=cs),ml=a(ee),M(ie.$$.fragment,ee),ee.forEach(o),Tn=a(e),M(We.$$.fragment,e),bn=a(e),N=m(e,"DIV",{class:!0});var te=j(N);M(Se.$$.fragment,te),dl=a(te),xt=m(te,"P",{"data-svelte-h":!0}),b(xt)!=="svelte-h5yso0"&&(xt.textContent=ms),yl=a(te),Bt=m(te,"P",{"data-svelte-h":!0}),b(Bt)!=="svelte-jpqkh0"&&(Bt.innerHTML=ds),ul=a(te),M(ce.$$.fragment,te),te.forEach(o),Un=a(e),M(Xe.$$.fragment,e),kn=a(e),M(Ne.$$.fragment,e),Jn=a(e),A=m(e,"DIV",{class:!0});var ne=j(A);M(Ae.$$.fragment,ne),Ml=a(ne),Zt=m(ne,"P",{"data-svelte-h":!0}),b(Zt)!=="svelte-11gfrdt"&&(Zt.textContent=ys),fl=a(ne),Rt=m(ne,"P",{"data-svelte-h":!0}),b(Rt)!=="svelte-j79gfd"&&(Rt.innerHTML=us),hl=a(ne),M(me.$$.fragment,ne),ne.forEach(o),jn=a(e),M(Qe.$$.fragment,e),$n=a(e),M(Fe.$$.fragment,e),_n=a(e),B=m(e,"DIV",{class:!0});var Y=j(B);M(Le.$$.fragment,Y),wl=a(Y),Gt=m(Y,"P",{"data-svelte-h":!0}),b(Gt)!=="svelte-19eu2wi"&&(Gt.textContent=Ms),gl=a(Y),Et=m(Y,"P",{"data-svelte-h":!0}),b(Et)!=="svelte-9t0i4c"&&(Et.textContent=fs),Tl=a(Y),M(de.$$.fragment,Y),bl=a(Y),ye=m(Y,"DIV",{class:!0});var ht=j(ye);M(ze.$$.fragment,ht),Ul=a(ht),Vt=m(ht,"P",{"data-svelte-h":!0}),b(Vt)!=="svelte-3wcl39"&&(Vt.textContent=hs),ht.forEach(o),Y.forEach(o),Cn=a(e),M(He.$$.fragment,e),In=a(e),I=m(e,"DIV",{class:!0});var R=j(I);M(Ye.$$.fragment,R),kl=a(R),Wt=m(R,"P",{"data-svelte-h":!0}),b(Wt)!=="svelte-42achz"&&(Wt.textContent=ws),Jl=a(R),St=m(R,"P",{"data-svelte-h":!0}),b(St)!=="svelte-3u6o6h"&&(St.textContent=gs),jl=a(R),M(ue.$$.fragment,R),$l=a(R),Xt=m(R,"P",{"data-svelte-h":!0}),b(Xt)!=="svelte-1i6k98o"&&(Xt.textContent=Ts),_l=a(R),Me=m(R,"DIV",{class:!0});var wt=j(Me);M(De.$$.fragment,wt),Cl=a(wt),Nt=m(wt,"P",{"data-svelte-h":!0}),b(Nt)!=="svelte-3wcl39"&&(Nt.textContent=bs),wt.forEach(o),R.forEach(o),vn=a(e),M(Pe.$$.fragment,e),xn=a(e),v=m(e,"DIV",{class:!0});var G=j(v);M(qe.$$.fragment,G),Il=a(G),At=m(G,"P",{"data-svelte-h":!0}),b(At)!=="svelte-gq8bgn"&&(At.textContent=Us),vl=a(G),Qt=m(G,"P",{"data-svelte-h":!0}),b(Qt)!=="svelte-xvkga1"&&(Qt.textContent=ks),xl=a(G),M(fe.$$.fragment,G),Bl=a(G),Ft=m(G,"P",{"data-svelte-h":!0}),b(Ft)!=="svelte-ssqjuc"&&(Ft.textContent=Js),Zl=a(G),he=m(G,"DIV",{class:!0});var gt=j(he);M(Ke.$$.fragment,gt),Rl=a(gt),Lt=m(gt,"P",{"data-svelte-h":!0}),b(Lt)!=="svelte-3wcl39"&&(Lt.textContent=js),gt.forEach(o),G.forEach(o),Bn=a(e),M(Oe.$$.fragment,e),Zn=a(e),Q=m(e,"DIV",{class:!0});var le=j(Q);M(et.$$.fragment,le),Gl=a(le),zt=m(le,"P",{"data-svelte-h":!0}),b(zt)!=="svelte-wlnf64"&&(zt.textContent=$s),El=a(le),Ht=m(le,"P",{"data-svelte-h":!0}),b(Ht)!=="svelte-1eknzx0"&&(Ht.innerHTML=_s),Vl=a(le),Yt=m(le,"P",{"data-svelte-h":!0}),b(Yt)!=="svelte-x58jtu"&&(Yt.innerHTML=Cs),le.forEach(o),Rn=a(e),M(tt.$$.fragment,e),Gn=a(e),F=m(e,"DIV",{class:!0});var Ue=j(F);M(nt.$$.fragment,Ue),Wl=a(Ue),Dt=m(Ue,"P",{"data-svelte-h":!0}),b(Dt)!=="svelte-1fbxeta"&&(Dt.textContent=Is),Sl=a(Ue),lt=m(Ue,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(lt)!=="svelte-1p695ky"&&(lt.innerHTML=vs),Xl=a(Ue),M(we.$$.fragment,Ue),Ue.forEach(o),En=a(e),M(st.$$.fragment,e),Vn=a(e),P=m(e,"DIV",{class:!0});var ln=j(P);M(rt.$$.fragment,ln),Nl=a(ln),Pt=m(ln,"P",{"data-svelte-h":!0}),b(Pt)!=="svelte-1foq575"&&(Pt.textContent=xs),Al=a(ln),M(ge.$$.fragment,ln),ln.forEach(o),Wn=a(e),M(at.$$.fragment,e),Sn=a(e),L=m(e,"DIV",{class:!0});var ke=j(L);M(ot.$$.fragment,ke),Ql=a(ke),qt=m(ke,"P",{"data-svelte-h":!0}),b(qt)!=="svelte-1nb80ft"&&(qt.textContent=Bs),Fl=a(ke),pt=m(ke,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(pt)!=="svelte-g397cl"&&(pt.innerHTML=Zs),Ll=a(ke),M(Te.$$.fragment,ke),ke.forEach(o),Xn=a(e),M(it.$$.fragment,e),Nn=a(e),q=m(e,"DIV",{class:!0});var sn=j(q);M(ct.$$.fragment,sn),zl=a(sn),Kt=m(sn,"P",{"data-svelte-h":!0}),b(Kt)!=="svelte-17opoc3"&&(Kt.textContent=Rs),Hl=a(sn),M(be.$$.fragment,sn),sn.forEach(o),An=a(e),M(mt.$$.fragment,e),Qn=a(e),z=m(e,"DIV",{class:!0});var Je=j(z);M(dt.$$.fragment,Je),Yl=a(Je),Ot=m(Je,"P",{"data-svelte-h":!0}),b(Ot)!=="svelte-10rrvzk"&&(Ot.textContent=Gs),Dl=a(Je),en=m(Je,"P",{"data-svelte-h":!0}),b(en)!=="svelte-1m7rt2a"&&(en.innerHTML=Es),Pl=a(Je),yt=m(Je,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),b(yt)!=="svelte-1a7x26k"&&(yt.innerHTML=Vs),Je.forEach(o),Fn=a(e),M(ut.$$.fragment,e),Ln=a(e),K=m(e,"DIV",{class:!0});var rn=j(K);M(Mt.$$.fragment,rn),ql=a(rn),tn=m(rn,"P",{"data-svelte-h":!0}),b(tn)!=="svelte-10njn0v"&&(tn.textContent=Ws),Kl=a(rn),nn=m(rn,"P",{"data-svelte-h":!0}),b(nn)!=="svelte-1u9ojx1"&&(nn.innerHTML=Ss),rn.forEach(o),zn=a(e),M(ft.$$.fragment,e),Hn=a(e),an=m(e,"P",{}),j(an).forEach(o),this.h()},h(){J(n,"name","hf:doc:metadata"),J(n,"content",pr),J(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(ve,"class","warning"),J(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Me,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(he,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(lt,"class","warning"),J(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(pt,"class","warning"),J(L,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(yt,"class","warning"),J(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),J(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,l){p(document.head,n),i(e,U,l),i(e,y,l),i(e,s,l),f(d,e,l),i(e,t,l),f(T,e,l),i(e,on,l),f(je,e,l),i(e,pn,l),f($e,e,l),i(e,cn,l),i(e,x,l),f(_e,x,null),p(x,Dn),p(x,Tt),p(x,Pn),p(x,bt),p(x,qn),p(x,Ut),p(x,Kn),f(re,x,null),i(e,mn,l),f(Ce,e,l),i(e,dn,l),i(e,C,l),f(Ie,C,null),p(C,On),p(C,kt),p(C,el),p(C,Jt),p(C,tl),p(C,jt),p(C,nl),p(C,ve),p(C,ll),f(ae,C,null),i(e,yn,l),f(xe,e,l),i(e,un,l),i(e,D,l),f(Be,D,null),p(D,sl),p(D,$t),p(D,rl),f(oe,D,null),i(e,Mn,l),f(Ze,e,l),i(e,fn,l),i(e,S,l),f(Re,S,null),p(S,al),p(S,_t),p(S,ol),p(S,Ct),p(S,pl),f(pe,S,null),i(e,hn,l),f(Ge,e,l),i(e,wn,l),f(Ee,e,l),i(e,gn,l),i(e,X,l),f(Ve,X,null),p(X,il),p(X,It),p(X,cl),p(X,vt),p(X,ml),f(ie,X,null),i(e,Tn,l),f(We,e,l),i(e,bn,l),i(e,N,l),f(Se,N,null),p(N,dl),p(N,xt),p(N,yl),p(N,Bt),p(N,ul),f(ce,N,null),i(e,Un,l),f(Xe,e,l),i(e,kn,l),f(Ne,e,l),i(e,Jn,l),i(e,A,l),f(Ae,A,null),p(A,Ml),p(A,Zt),p(A,fl),p(A,Rt),p(A,hl),f(me,A,null),i(e,jn,l),f(Qe,e,l),i(e,$n,l),f(Fe,e,l),i(e,_n,l),i(e,B,l),f(Le,B,null),p(B,wl),p(B,Gt),p(B,gl),p(B,Et),p(B,Tl),f(de,B,null),p(B,bl),p(B,ye),f(ze,ye,null),p(ye,Ul),p(ye,Vt),i(e,Cn,l),f(He,e,l),i(e,In,l),i(e,I,l),f(Ye,I,null),p(I,kl),p(I,Wt),p(I,Jl),p(I,St),p(I,jl),f(ue,I,null),p(I,$l),p(I,Xt),p(I,_l),p(I,Me),f(De,Me,null),p(Me,Cl),p(Me,Nt),i(e,vn,l),f(Pe,e,l),i(e,xn,l),i(e,v,l),f(qe,v,null),p(v,Il),p(v,At),p(v,vl),p(v,Qt),p(v,xl),f(fe,v,null),p(v,Bl),p(v,Ft),p(v,Zl),p(v,he),f(Ke,he,null),p(he,Rl),p(he,Lt),i(e,Bn,l),f(Oe,e,l),i(e,Zn,l),i(e,Q,l),f(et,Q,null),p(Q,Gl),p(Q,zt),p(Q,El),p(Q,Ht),p(Q,Vl),p(Q,Yt),i(e,Rn,l),f(tt,e,l),i(e,Gn,l),i(e,F,l),f(nt,F,null),p(F,Wl),p(F,Dt),p(F,Sl),p(F,lt),p(F,Xl),f(we,F,null),i(e,En,l),f(st,e,l),i(e,Vn,l),i(e,P,l),f(rt,P,null),p(P,Nl),p(P,Pt),p(P,Al),f(ge,P,null),i(e,Wn,l),f(at,e,l),i(e,Sn,l),i(e,L,l),f(ot,L,null),p(L,Ql),p(L,qt),p(L,Fl),p(L,pt),p(L,Ll),f(Te,L,null),i(e,Xn,l),f(it,e,l),i(e,Nn,l),i(e,q,l),f(ct,q,null),p(q,zl),p(q,Kt),p(q,Hl),f(be,q,null),i(e,An,l),f(mt,e,l),i(e,Qn,l),i(e,z,l),f(dt,z,null),p(z,Yl),p(z,Ot),p(z,Dl),p(z,en),p(z,Pl),p(z,yt),i(e,Fn,l),f(ut,e,l),i(e,Ln,l),i(e,K,l),f(Mt,K,null),p(K,ql),p(K,tn),p(K,Kl),p(K,nn),i(e,zn,l),f(ft,e,l),i(e,Hn,l),i(e,an,l),Yn=!0},p(e,[l]){const H={};l&2&&(H.$$scope={dirty:l,ctx:e}),re.$set(H);const Z={};l&2&&(Z.$$scope={dirty:l,ctx:e}),ae.$set(Z);const se={};l&2&&(se.$$scope={dirty:l,ctx:e}),oe.$set(se);const O={};l&2&&(O.$$scope={dirty:l,ctx:e}),pe.$set(O);const ee={};l&2&&(ee.$$scope={dirty:l,ctx:e}),ie.$set(ee);const te={};l&2&&(te.$$scope={dirty:l,ctx:e}),ce.$set(te);const ne={};l&2&&(ne.$$scope={dirty:l,ctx:e}),me.$set(ne);const Y={};l&2&&(Y.$$scope={dirty:l,ctx:e}),de.$set(Y);const ht={};l&2&&(ht.$$scope={dirty:l,ctx:e}),ue.$set(ht);const R={};l&2&&(R.$$scope={dirty:l,ctx:e}),fe.$set(R);const wt={};l&2&&(wt.$$scope={dirty:l,ctx:e}),we.$set(wt);const G={};l&2&&(G.$$scope={dirty:l,ctx:e}),ge.$set(G);const gt={};l&2&&(gt.$$scope={dirty:l,ctx:e}),Te.$set(gt);const le={};l&2&&(le.$$scope={dirty:l,ctx:e}),be.$set(le)},i(e){Yn||(h(d.$$.fragment,e),h(T.$$.fragment,e),h(je.$$.fragment,e),h($e.$$.fragment,e),h(_e.$$.fragment,e),h(re.$$.fragment,e),h(Ce.$$.fragment,e),h(Ie.$$.fragment,e),h(ae.$$.fragment,e),h(xe.$$.fragment,e),h(Be.$$.fragment,e),h(oe.$$.fragment,e),h(Ze.$$.fragment,e),h(Re.$$.fragment,e),h(pe.$$.fragment,e),h(Ge.$$.fragment,e),h(Ee.$$.fragment,e),h(Ve.$$.fragment,e),h(ie.$$.fragment,e),h(We.$$.fragment,e),h(Se.$$.fragment,e),h(ce.$$.fragment,e),h(Xe.$$.fragment,e),h(Ne.$$.fragment,e),h(Ae.$$.fragment,e),h(me.$$.fragment,e),h(Qe.$$.fragment,e),h(Fe.$$.fragment,e),h(Le.$$.fragment,e),h(de.$$.fragment,e),h(ze.$$.fragment,e),h(He.$$.fragment,e),h(Ye.$$.fragment,e),h(ue.$$.fragment,e),h(De.$$.fragment,e),h(Pe.$$.fragment,e),h(qe.$$.fragment,e),h(fe.$$.fragment,e),h(Ke.$$.fragment,e),h(Oe.$$.fragment,e),h(et.$$.fragment,e),h(tt.$$.fragment,e),h(nt.$$.fragment,e),h(we.$$.fragment,e),h(st.$$.fragment,e),h(rt.$$.fragment,e),h(ge.$$.fragment,e),h(at.$$.fragment,e),h(ot.$$.fragment,e),h(Te.$$.fragment,e),h(it.$$.fragment,e),h(ct.$$.fragment,e),h(be.$$.fragment,e),h(mt.$$.fragment,e),h(dt.$$.fragment,e),h(ut.$$.fragment,e),h(Mt.$$.fragment,e),h(ft.$$.fragment,e),Yn=!0)},o(e){w(d.$$.fragment,e),w(T.$$.fragment,e),w(je.$$.fragment,e),w($e.$$.fragment,e),w(_e.$$.fragment,e),w(re.$$.fragment,e),w(Ce.$$.fragment,e),w(Ie.$$.fragment,e),w(ae.$$.fragment,e),w(xe.$$.fragment,e),w(Be.$$.fragment,e),w(oe.$$.fragment,e),w(Ze.$$.fragment,e),w(Re.$$.fragment,e),w(pe.$$.fragment,e),w(Ge.$$.fragment,e),w(Ee.$$.fragment,e),w(Ve.$$.fragment,e),w(ie.$$.fragment,e),w(We.$$.fragment,e),w(Se.$$.fragment,e),w(ce.$$.fragment,e),w(Xe.$$.fragment,e),w(Ne.$$.fragment,e),w(Ae.$$.fragment,e),w(me.$$.fragment,e),w(Qe.$$.fragment,e),w(Fe.$$.fragment,e),w(Le.$$.fragment,e),w(de.$$.fragment,e),w(ze.$$.fragment,e),w(He.$$.fragment,e),w(Ye.$$.fragment,e),w(ue.$$.fragment,e),w(De.$$.fragment,e),w(Pe.$$.fragment,e),w(qe.$$.fragment,e),w(fe.$$.fragment,e),w(Ke.$$.fragment,e),w(Oe.$$.fragment,e),w(et.$$.fragment,e),w(tt.$$.fragment,e),w(nt.$$.fragment,e),w(we.$$.fragment,e),w(st.$$.fragment,e),w(rt.$$.fragment,e),w(ge.$$.fragment,e),w(at.$$.fragment,e),w(ot.$$.fragment,e),w(Te.$$.fragment,e),w(it.$$.fragment,e),w(ct.$$.fragment,e),w(be.$$.fragment,e),w(mt.$$.fragment,e),w(dt.$$.fragment,e),w(ut.$$.fragment,e),w(Mt.$$.fragment,e),w(ft.$$.fragment,e),Yn=!1},d(e){e&&(o(U),o(y),o(s),o(t),o(on),o(pn),o(cn),o(x),o(mn),o(dn),o(C),o(yn),o(un),o(D),o(Mn),o(fn),o(S),o(hn),o(wn),o(gn),o(X),o(Tn),o(bn),o(N),o(Un),o(kn),o(Jn),o(A),o(jn),o($n),o(_n),o(B),o(Cn),o(In),o(I),o(vn),o(xn),o(v),o(Bn),o(Zn),o(Q),o(Rn),o(Gn),o(F),o(En),o(Vn),o(P),o(Wn),o(Sn),o(L),o(Xn),o(Nn),o(q),o(An),o(Qn),o(z),o(Fn),o(Ln),o(K),o(zn),o(Hn),o(an)),o(n),g(d,e),g(T,e),g(je,e),g($e,e),g(_e),g(re),g(Ce,e),g(Ie),g(ae),g(xe,e),g(Be),g(oe),g(Ze,e),g(Re),g(pe),g(Ge,e),g(Ee,e),g(Ve),g(ie),g(We,e),g(Se),g(ce),g(Xe,e),g(Ne,e),g(Ae),g(me),g(Qe,e),g(Fe,e),g(Le),g(de),g(ze),g(He,e),g(Ye),g(ue),g(De),g(Pe,e),g(qe),g(fe),g(Ke),g(Oe,e),g(et),g(tt,e),g(nt),g(we),g(st,e),g(rt),g(ge),g(at,e),g(ot),g(Te),g(it,e),g(ct),g(be),g(mt,e),g(dt),g(ut,e),g(Mt),g(ft,e)}}}const pr='{"title":"Layers API Reference","local":"layers-api-reference","sections":[{"title":"Making layers kernel-aware","local":"making-layers-kernel-aware","sections":[{"title":"use_kernel_forward_from_hub","local":"kernels.use_kernel_forward_from_hub","sections":[],"depth":3},{"title":"use_kernel_func_from_hub","local":"kernels.use_kernel_func_from_hub","sections":[],"depth":3},{"title":"use_kernelized_func","local":"kernels.use_kernelized_func","sections":[],"depth":3},{"title":"replace_kernel_forward_from_hub","local":"kernels.replace_kernel_forward_from_hub","sections":[],"depth":3}],"depth":2},{"title":"Registering kernel mappings","local":"registering-kernel-mappings","sections":[{"title":"use_kernel_mapping","local":"kernels.use_kernel_mapping","sections":[],"depth":3},{"title":"register_kernel_mapping","local":"kernels.register_kernel_mapping","sections":[],"depth":3}],"depth":2},{"title":"Kernelizing a model","local":"kernelizing-a-model","sections":[{"title":"kernelize","local":"kernels.kernelize","sections":[],"depth":3}],"depth":2},{"title":"Classes","local":"classes","sections":[{"title":"Device","local":"kernels.Device","sections":[],"depth":3},{"title":"CUDAProperties","local":"kernels.CUDAProperties","sections":[],"depth":3},{"title":"ROCMProperties","local":"kernels.ROCMProperties","sections":[],"depth":3},{"title":"Mode","local":"kernels.Mode","sections":[],"depth":3},{"title":"FuncRepository","local":"kernels.FuncRepository","sections":[],"depth":3},{"title":"LayerRepository","local":"kernels.LayerRepository","sections":[],"depth":3},{"title":"LocalFuncRepository","local":"kernels.LocalFuncRepository","sections":[],"depth":3},{"title":"LocalLayerRepository","local":"kernels.LocalLayerRepository","sections":[],"depth":3},{"title":"LockedFuncRepository","local":"kernels.LockedFuncRepository","sections":[],"depth":3},{"title":"LockedLayerRepository","local":"kernels.LockedLayerRepository","sections":[],"depth":3}],"depth":2}],"depth":1}';function ir(k){return Ns(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Mr extends As{constructor(n){super(),Qs(this,n,ir,or,Xs,{})}}export{Mr as component};

Xet Storage Details

Size:
83.8 kB
·
Xet hash:
42fc1db09a41295ae15957dcaffc62ed1c0fa61b403e07235e6912d16f7d57cc

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