import{s as Ft,n as Dt,o as _t}from"../chunks/scheduler.f3b1e791.js";import{S as Ot,i as Pt,e as a,s as i,c as d,h as qt,a as r,d as l,b as s,f as Xt,g as p,j as M,k as Tt,l as Kt,m as n,n as o,t as c,o as h,p as u}from"../chunks/index.023a9934.js";import{C as el}from"../chunks/CopyLLMTxtMenu.ee636735.js";import{C as y}from"../chunks/CodeBlock.5aa52fca.js";import{H as m,E as tl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.9b009efe.js";function ll(xt){let b,fe,ye,Te,T,xe,x,ge,g,we,f,gt=`<p>The <a href="writing-kernels#quick-install">install script</a> automates
the Nix and kernel-builder setup described below. Use these manual
instructions if you prefer step-by-step control.</p>`,ke,w,$e,k,wt=`The kernel builder uses Nix for building kernels. You can build or
run the kernels directly if you have Nix installed on your system.
We recommend installing Nix in the following way:`,Je,$,kt=`<li>Linux: use the <a href="https://nixos.org/download/" rel="nofollow">official Nix installer</a>.</li> <li>macOS: use the <a href="https://docs.determinate.systems/determinate-nix/" rel="nofollow">Determinate Nix installer</a>.
In addition, Xcode 16.x is currently required to build kernels.</li>`,Ue,J,je,U,$t=`Since the kernel builder depends on many packages (e.g. every supported
PyTorch version), it is recommended to enable the huggingface cache
to avoid expensive rebuilds.`,Ce,j,Jt="To use the cache, you can either install cachix and configure it:",Ie,C,Ge,I,Ut="Or run it once without installing cachix permanently:",Ne,G,Ze,N,ve,Z,jt=`The kernel builder also provides Nix development shells with all Torch
and CUDA/ROCm dependencies needed to develop kernels (see below). If
you want to test your kernels inside a Nix development shell and you
are not using NixOS, <a href="https://danieldk.eu/Nix-CUDA-on-non-NixOS-systems#make-runopengl-driverlib-and-symlink-the-driver-library" rel="nofollow">make sure that the CUDA driver is visible</a> to Torch.`,We,v,Ve,W,Ct=`The easiest way to start a new kernel is using the <code>kernel-builder init</code>
subcommand, which is discussed in <a href="writing-kernels">Writing Kernels</a>.
The commands discussed in the following sections will also work on
existing kernel sources that have <code>build.toml</code>/<code>flake.nix</code>.`,He,V,Be,H,It=`A kernel can be built with the <code>kernel-builder build-and-copy</code> command.
For example:`,Ye,B,Ee,Y,Gt=`The <code>-L</code> option prints out build logs in the terminal, which can be handy
for monitoring the build. The compiled kernel will then be in the local
<code>build/</code> directory.`,Le,E,Se,L,Nt=`<code>kernel-builder</code> provides shells for developing kernels. In such a shell,
all required dependencies are available, as well as <code>kernel-builder</code> for generating
project files. For example:`,ze,S,Re,z,Zt=`If you want to test the kernel as a Python package, you can do so.
<code>kernel-builder devshell</code> will automatically create a virtual environment in
the <code>.venv</code> and activate it. You can install the kernel as a regular
Python package in this virtual environment:`,Qe,R,Ae,Q,vt=`Development shells are available for every build configuration. For
instance, you can get a Torch 2.11 development shell for ROCm kernels
using:`,Xe,A,Fe,X,Wt=`You can list the variants that the kernel supports with the <code>list-variants</code>
subcommand:`,De,F,_e,D,Oe,_,Vt=`You can also start a test shell. This will give you a Python interpreter
with the kernel in Python’s search path. This makes it more convenient to run
tests:`,Pe,O,qe,P,Ht=`<code>testshell</code> also supports the <code>--variant</code> option, so you can test a particular
kernel variant.`,Ke,q,et,K,Bt=`You can add test dependencies to a development or testing shell. Adapt
the kernel’s <code>flake.nix</code> to use the <code>pythonCheckInputs</code> option:`,tt,ee,lt,te,Yt='The available packages can be found on <a href="https://search.nixos.org/packages?channel=25.05&amp;query=python312Packages" rel="nofollow">search.nixos.org</a>.',nt,le,Et=`Keep in mind that these additional dependencies will only be available to
the Nix shells, not the final kernel uploaded to the Hub.`,it,ne,st,ie,Lt=`Finally, when you are ready to make a kernel release, you can build and
upload a kernel to the Hub:`,at,se,rt,ae,St=`Aside from building and uploading the kernel itself, this will also fill
the card template and upload it as <code>README.md</code> to the Hub if the card
template is provided in the source repository as <code>CARD.md</code>.`,dt,re,zt=`The repository to upload to is determined by the <code>repo-id</code> and <code>version</code>
fields in <code>build.toml</code>. For example, with the following <code>build.toml</code>, the
kernel will be uploaded to the repository <code>kernels-community/flash-attn4</code>
in the <code>v1</code> version branch:`,pt,de,ot,pe,Rt=`See <a href="writing-kernels">Writing Kernels</a> for more details on the <code>build.toml</code>
format.`,ct,oe,ht,ce,Qt=`The kernel’s dependencies are fully pinned down in the <code>flake.lock</code> that
is shipped with the kernel. We periodically release new versions of the
build toolchain that includes bug fixes and supports newer Torch and compute backend
versions. To update the kernel build toolchain, run <code>nix flake update</code>
in the kernel directory:`,ut,he,Mt,ue,mt,Me,At=`<code>kernel-builder</code> verifies that a kernel can be
imported with the <a href="https://github.com/huggingface/kernels" rel="nofollow"><code>kernels</code></a>
package. This check can be disabled by passing <code>doGetKernelCheck = false</code>
to <code>genKernelFlakeOutputs</code>. <strong>Warning:</strong> it is strongly recommended to keep
this check enabled, as it is one of the checks that validates that a kernel
is compliant. This option is primarily intended for kernels with
<code>triton.autotune</code> decorators, which can fail because there is no GPU available
in the build sandbox.`,yt,me,bt,be,ft;return T=new el({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),x=new m({props:{title:"Using the kernel builder with Nix",local:"using-the-kernel-builder-with-nix",headingTag:"h1"}}),g=new m({props:{title:"Installation",local:"installation",headingTag:"h2"}}),w=new m({props:{title:"Installing Nix",local:"installing-nix",headingTag:"h3"}}),J=new m({props:{title:"Using the Hugging Face binary cache",local:"using-the-hugging-face-binary-cache",headingTag:"h3"}}),C=new y({props:{code:"JTIzJTIwSW5zdGFsbCUyMGNhY2hpeCUyMGFuZCUyMGNvbmZpZ3VyZSUyMHRoZSUyMGNhY2hlJTBBY2FjaGl4JTIwdXNlJTIwaHVnZ2luZ2ZhY2U=",highlighted:`<span class="hljs-comment"># Install cachix and configure the cache</span>
cachix use huggingface`,wrap:!1}}),G=new y({props:{code:"JTIzJTIwVXNlJTIwY2FjaGl4JTIwd2l0aG91dCUyMGluc3RhbGxpbmclMjBpdCUwQW5peCUyMHJ1biUyMG5peHBrZ3MlMjNjYWNoaXglMjAtLSUyMHVzZSUyMGh1Z2dpbmdmYWNl",highlighted:`<span class="hljs-comment"># Use cachix without installing it</span>
nix run nixpkgs<span class="hljs-comment">#cachix -- use huggingface</span>`,wrap:!1}}),N=new m({props:{title:"GPU library configuration",local:"gpu-library-configuration",headingTag:"h3"}}),v=new m({props:{title:"Getting started",local:"getting-started",headingTag:"h2"}}),V=new m({props:{title:"Building a kernel",local:"building-a-kernel",headingTag:"h2"}}),B=new y({props:{code:"Y2QlMjBleGFtcGxlcyUyRnJlbHUlMEFrZXJuZWwtYnVpbGRlciUyMGJ1aWxkLWFuZC1jb3B5JTIwLUw=",highlighted:`<span class="hljs-built_in">cd</span> examples/relu
kernel-builder build-and-copy -L`,wrap:!1}}),E=new m({props:{title:"Shell for local development",local:"shell-for-local-development",headingTag:"h2"}}),S=new y({props:{code:"JTI0JTIwa2VybmVsLWJ1aWxkZXIlMjBkZXZzaGVsbCUwQSUyMyUyMEElMjBkZXZzaGVsbCUyMGlzJTIwb3BlbmVkJTIwaW4lMjB3aGljaCUyMHlvdSUyMGNhbiUyMHJ1biUyMHRoZSUyMGZvbGxvd2luZyUyMGNvbW1hbmRzJTNBJTBBJTI0JTIwa2VybmVsLWJ1aWxkZXIlMjBjcmVhdGUtcHlwcm9qZWN0JTBBJTI0JTIwY21ha2UlMjAtQiUyMGJ1aWxkLWV4dCUwQSUyNCUyMGNtYWtlJTIwLS1idWlsZCUyMGJ1aWxkLWV4dA==",highlighted:`$ kernel-builder devshell
<span class="hljs-comment"># A devshell is opened in which you can run the following commands:</span>
$ kernel-builder create-pyproject
$ cmake -B build-ext
$ cmake --build build-ext`,wrap:!1}}),R=new y({props:{code:"JTI0JTIwa2VybmVsLWJ1aWxkZXIlMjBkZXZzaGVsbCUwQSUyNCUyMGtlcm5lbC1idWlsZGVyJTIwY3JlYXRlLXB5cHJvamVjdCUwQSUyNCUyMHBpcCUyMGluc3RhbGwlMjAtLW5vLWJ1aWxkLWlzb2xhdGlvbiUyMC1lJTIwLg==",highlighted:`$ kernel-builder devshell
$ kernel-builder create-pyproject
$ pip install --no-build-isolation -e .`,wrap:!1}}),A=new y({props:{code:"JTI0JTIwcm0lMjAtcmYlMjAudmVudiUyMCUyMCUyMyUyMFJlbW92ZSUyMGV4aXN0aW5nJTIwdmVudiUyMGlmJTIwYW55LiUwQSUyNCUyMGtlcm5lbC1idWlsZGVyJTIwZGV2c2hlbGwlMjAtLXZhcmlhbnQlMjB0b3JjaDIxMS1jeHgxMS1yb2NtNzEteDg2XzY0LWxpbnV4",highlighted:`$ <span class="hljs-built_in">rm</span> -rf .venv  <span class="hljs-comment"># Remove existing venv if any.</span>
$ kernel-builder devshell --variant torch211-cxx11-rocm71-x86_64-linux`,wrap:!1}}),F=new y({props:{code:"JTI0JTIwa2VybmVsLWJ1aWxkZXIlMjBsaXN0LXZhcmlhbnRzJTBBdG9yY2gyOS1jeHgxMS1jdTEyOS14ODZfNjQtbGludXglMEF0b3JjaDIxMC1jeHgxMS1jdTEyNi14ODZfNjQtbGludXglMEF0b3JjaDIxMC1jeHgxMS1jdTEyOC14ODZfNjQtbGludXglMEF0b3JjaDIxMC1jeHgxMS1jdTEzMC14ODZfNjQtbGludXglMEF0b3JjaDIxMC1jeHgxMS1yb2NtNzAteDg2XzY0LWxpbnV4JTBBdG9yY2gyMTAtY3h4MTEtcm9jbTcxLXg4Nl82NC1saW51eCUwQXRvcmNoMjEwLWN4eDExLWNwdS14ODZfNjQtbGludXglMEF0b3JjaDIxMC1jeHgxMS14cHUyMDI1My14ODZfNjQtbGludXglMEF0b3JjaDIxMS1jeHgxMS1jcHUteDg2XzY0LWxpbnV4JTBBdG9yY2gyMTEtY3h4MTEtY3UxMjYteDg2XzY0LWxpbnV4JTBBdG9yY2gyMTEtY3h4MTEtY3UxMjgteDg2XzY0LWxpbnV4JTBBdG9yY2gyMTEtY3h4MTEtY3UxMzAteDg2XzY0LWxpbnV4JTBBdG9yY2gyMTEtY3h4MTEtcm9jbTcxLXg4Nl82NC1saW51eCUwQXRvcmNoMjExLWN4eDExLXJvY203Mi14ODZfNjQtbGludXglMEF0b3JjaDIxMS1jeHgxMS14cHUyMDI1My14ODZfNjQtbGludXg=",highlighted:`$ kernel-builder list-variants
torch29-cxx11-cu129-x86_64-linux
torch210-cxx11-cu126-x86_64-linux
torch210-cxx11-cu128-x86_64-linux
torch210-cxx11-cu130-x86_64-linux
torch210-cxx11-rocm70-x86_64-linux
torch210-cxx11-rocm71-x86_64-linux
torch210-cxx11-cpu-x86_64-linux
torch210-cxx11-xpu20253-x86_64-linux
torch211-cxx11-cpu-x86_64-linux
torch211-cxx11-cu126-x86_64-linux
torch211-cxx11-cu128-x86_64-linux
torch211-cxx11-cu130-x86_64-linux
torch211-cxx11-rocm71-x86_64-linux
torch211-cxx11-rocm72-x86_64-linux
torch211-cxx11-xpu20253-x86_64-linux`,wrap:!1}}),D=new m({props:{title:"Shell for testing a kernel",local:"shell-for-testing-a-kernel",headingTag:"h2"}}),O=new y({props:{code:"Y2QlMjBleGFtcGxlcyUyRnJlbHUlMEFrZXJuZWwtYnVpbGRlciUyMHRlc3RzaGVsbCUwQXB5dGhvbiUyMC1tJTIwcHl0ZXN0JTIwdGVzdHM=",highlighted:`<span class="hljs-built_in">cd</span> examples/relu
kernel-builder testshell
python -m pytest tests`,wrap:!1}}),q=new m({props:{title:"Adding test dependencies to development shells",local:"adding-test-dependencies-to-development-shells",headingTag:"h2"}}),ee=new y({props:{code:"JTdCJTBBJTIwJTIwZGVzY3JpcHRpb24lMjAlM0QlMjAlMjJGbGFrZSUyMGZvciUyMG15JTIwa2VybmVsJTIyJTNCJTBBJTBBJTIwJTIwaW5wdXRzJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwYnVpbGRlci51cmwlMjAlM0QlMjAlMjJnaXRodWIlM0FodWdnaW5nZmFjZSUyRmtlcm5lbHMlMjIlM0IlMEElMjAlMjAlN0QlM0IlMEElMEElMjAlMjBvdXRwdXRzJTIwJTNEJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwc2VsZiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMGJ1aWxkZXIlMkMlMEElMjAlMjAlMjAlMjAlN0QlM0ElMEElMjAlMjAlMjAlMjBidWlsZGVyLmxpYi5nZW5LZXJuZWxGbGFrZU91dHB1dHMlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjBpbmhlcml0JTIwc2VsZiUzQiUwQSUyMCUyMCUyMCUyMCUyMCUyMHBhdGglMjAlM0QlMjAuJTJGLiUzQiUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMFRoZSUyMGVpbm9wcyUyMGFuZCUyMG51bXB5JTIwdGVzdCUyMGRlcGVuZGVuY2llcyUyMGFyZSUyMGFkZGVkJTIwaGVyZSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMHB5dGhvbkNoZWNrSW5wdXRzJTIwJTNEJTIwcGtncyUzQSUyMHdpdGglMjBwa2dzJTNCJTIwJTVCJTIwbnVtcHklMjAlNUQlM0IlMEElMjAlMjAlMjAlMjAlN0QlM0IlMEElN0Q=",highlighted:`{
  <span class="hljs-attr">description</span> = <span class="hljs-string">&quot;Flake for my kernel&quot;</span>;

  <span class="hljs-attr">inputs</span> = {
    builder.<span class="hljs-attr">url</span> = <span class="hljs-string">&quot;github:huggingface/kernels&quot;</span>;
  };

  <span class="hljs-attr">outputs</span> =
    {
      self,
      builder,
    }:
    builder.lib.genKernelFlakeOutputs {
      <span class="hljs-keyword">inherit</span> self;
      <span class="hljs-attr">path</span> = ./.;

      <span class="hljs-comment"># The einops and numpy test dependencies are added here:</span>
      <span class="hljs-attr">pythonCheckInputs</span> = pkgs: <span class="hljs-keyword">with</span> pkgs; [ numpy ];
    };
}`,wrap:!1}}),ne=new m({props:{title:"Uploading your kernel to the Hub",local:"uploading-your-kernel-to-the-hub",headingTag:"h2"}}),se=new y({props:{code:"JTI0JTIwY2QlMjBteWtlcm5lbCUwQSUyNCUyMGtlcm5lbC1idWlsZGVyJTIwYnVpbGQtYW5kLXVwbG9hZA==",highlighted:`$ <span class="hljs-built_in">cd</span> mykernel
$ kernel-builder build-and-upload`,wrap:!1}}),de=new y({props:{code:"JTVCZ2VuZXJhbCU1RCUwQSUyMyUyMC4uLiUwQXZlcnNpb24lMjAlM0QlMjAxJTBBJTBBJTVCZ2VuZXJhbC5odWIlNUQlMEFyZXBvLWlkJTIwJTNEJTIwJTIya2VybmVscy1jb21tdW5pdHklMkZmbGFzaC1hdHRuNCUyMg==",highlighted:`<span class="hljs-section">[general]</span>
<span class="hljs-comment"># ...</span>
<span class="hljs-attr">version</span> = <span class="hljs-number">1</span>

<span class="hljs-section">[general.hub]</span>
<span class="hljs-attr">repo-id</span> = <span class="hljs-string">&quot;kernels-community/flash-attn4&quot;</span>`,wrap:!1}}),oe=new m({props:{title:"Updating the kernel build toolchain",local:"updating-the-kernel-build-toolchain",headingTag:"h2"}}),he=new y({props:{code:"JUUyJTlEJUFGJTIwbml4JTIwZmxha2UlMjB1cGRhdGUlMEElRTIlODAlQTIlMjBBZGRlZCUyMGlucHV0JTIwJ2tlcm5lbC1idWlsZGVyJyUzQSUwQSUyMCUyMCUyMCUyMCdnaXRodWIlM0FodWdnaW5nZmFjZSUyRmtlcm5lbHMlMkY4YWQ4YTUwOTRmMWIzYzQyNWY3MDkwMDY5OWVkNjkwZDY1ZDg3OGMzJTNGbmFySGFzaCUzRHNoYTI1Ni1tOHRCbnRDSWxIJTJGclk0QmNJdjVYNSUyNTJCZHRnU1MxeVFpODgzQ28lMjUyQmo1Y3VkSSUyNTNEJyUyMCgyMDI2LTA0LTA5KSUwQSVFMiU4MCVBMiUyMEFkZGVkJTIwaW5wdXQlMjAna2VybmVsLWJ1aWxkZXIlMkZmbGFrZS1jb21wYXQnJTNBJTBBJTIwJTIwJTIwJTIwJ2dpdGh1YiUzQWVkb2xzdHJhJTJGZmxha2UtY29tcGF0JTJGNWVkZjExYzQ0YmM3OGEwZDMzNGY2MzM0Y2RhZjdkNjBkNzMyZGFhYiUzRm5hckhhc2glM0RzaGEyNTYtdk5wVVNwRjVOdXc4eHZETGoyS0N3d2tzSWJqdWEyTFpDcWhWMUxOUkRucyUyNTNEJyUyMCgyMDI1LTEyLTI5KSUwQSVFMiU4MCVBMiUyMEFkZGVkJTIwaW5wdXQlMjAna2VybmVsLWJ1aWxkZXIlMkZmbGFrZS11dGlscyclM0ElMEElMjAlMjAlMjAlMjAnZ2l0aHViJTNBbnVtdGlkZSUyRmZsYWtlLXV0aWxzJTJGMTE3MDdkYzJmNjE4ZGQ1NGNhODczOWIzMDllYzRmYzAyNGRlNTc4YiUzRm5hckhhc2glM0RzaGEyNTYtbDBLRmc1SGpyc2ZzTyUyRkpwRyUyNTJCcjdmUnJxbTEya3pGSHlVSHFIQ1ZwTU1iSSUyNTNEJyUyMCgyMDI0LTExLTEzKSUwQSVFMiU4MCVBMiUyMEFkZGVkJTIwaW5wdXQlMjAna2VybmVsLWJ1aWxkZXIlMkZmbGFrZS11dGlscyUyRnN5c3RlbXMnJTNBJTBBJTIwJTIwJTIwJTIwJ2dpdGh1YiUzQW5peC1zeXN0ZW1zJTJGZGVmYXVsdCUyRmRhNjcwOTZhM2I5YmY1NmE5MWQxNjkwMTI5M2U1MWJhNWI0OWEyN2UlM0ZuYXJIYXNoJTNEc2hhMjU2LVZ5MXJxNUFhUnVMek94Y3Q4bno0VDZ3bGd5VVI3ekxVMzA5azltQkM3NjglMjUzRCclMjAoMjAyMy0wNC0wOSklMEElRTIlODAlQTIlMjBBZGRlZCUyMGlucHV0JTIwJ2tlcm5lbC1idWlsZGVyJTJGbml4cGtncyclM0ElMEElMjAlMjAlMjAlMjAnZ2l0aHViJTNBTml4T1MlMkZuaXhwa2dzJTJGMmY0ZmQ1ZTFhYmY5YmFjOGMxZDIyNzUwYzcwMWE3YTVlNmI1MjRjNiUzRm5hckhhc2glM0RzaGEyNTYtTWg2YkxjWUFjRU5CQVprM1JvTVBNRkNHR01abWZhR01FUkU0c2laT2dQNCUyNTNEJyUyMCgyMDI2LTAzLTMxKSUwQSVFMiU4MCVBMiUyMEFkZGVkJTIwaW5wdXQlMjAna2VybmVsLWJ1aWxkZXIlMkZydXN0LW92ZXJsYXknJTNBJTBBJTIwJTIwJTIwJTIwJ2dpdGh1YiUzQW94YWxpY2ElMkZydXN0LW92ZXJsYXklMkY5NjJhMDkzNGQwZTMyZjQyZDFiNWU0OTE4NmY5NTk1ZjliMTc4ZDJkJTNGbmFySGFzaCUzRHNoYTI1Ni1KTWREWW4wRiUyNTJCc3dZQklMbHBDZUhEYkNTeXpxa2VTR054WiUyRlE1SjU4NGpNJTI1M0QnJTIwKDIwMjYtMDMtMzEpJTBBJUUyJTgwJUEyJTIwQWRkZWQlMjBpbnB1dCUyMCdrZXJuZWwtYnVpbGRlciUyRnJ1c3Qtb3ZlcmxheSUyRm5peHBrZ3MnJTNBJTBBJTIwJTIwJTIwJTIwZm9sbG93cyUyMCdrZXJuZWwtYnVpbGRlciUyRm5peHBrZ3Mn",highlighted:`❯ nix flake update
• Added input <span class="hljs-string">&#x27;kernel-builder&#x27;</span>:
    <span class="hljs-string">&#x27;github:huggingface/kernels/8ad8a5094f1b3c425f70900699ed690d65d878c3?narHash=sha256-m8tBntCIlH/rY4BcIv5X5%2BdtgSS1yQi883Co%2Bj5cudI%3D&#x27;</span> (2026-04-09)
• Added input <span class="hljs-string">&#x27;kernel-builder/flake-compat&#x27;</span>:
    <span class="hljs-string">&#x27;github:edolstra/flake-compat/5edf11c44bc78a0d334f6334cdaf7d60d732daab?narHash=sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns%3D&#x27;</span> (2025-12-29)
• Added input <span class="hljs-string">&#x27;kernel-builder/flake-utils&#x27;</span>:
    <span class="hljs-string">&#x27;github:numtide/flake-utils/11707dc2f618dd54ca8739b309ec4fc024de578b?narHash=sha256-l0KFg5HjrsfsO/JpG%2Br7fRrqm12kzFHyUHqHCVpMMbI%3D&#x27;</span> (2024-11-13)
• Added input <span class="hljs-string">&#x27;kernel-builder/flake-utils/systems&#x27;</span>:
    <span class="hljs-string">&#x27;github:nix-systems/default/da67096a3b9bf56a91d16901293e51ba5b49a27e?narHash=sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768%3D&#x27;</span> (2023-04-09)
• Added input <span class="hljs-string">&#x27;kernel-builder/nixpkgs&#x27;</span>:
    <span class="hljs-string">&#x27;github:NixOS/nixpkgs/2f4fd5e1abf9bac8c1d22750c701a7a5e6b524c6?narHash=sha256-Mh6bLcYAcENBAZk3RoMPMFCGGMZmfaGMERE4siZOgP4%3D&#x27;</span> (2026-03-31)
• Added input <span class="hljs-string">&#x27;kernel-builder/rust-overlay&#x27;</span>:
    <span class="hljs-string">&#x27;github:oxalica/rust-overlay/962a0934d0e32f42d1b5e49186f9595f9b178d2d?narHash=sha256-JMdDYn0F%2BswYBILlpCeHDbCSyzqkeSGNxZ/Q5J584jM%3D&#x27;</span> (2026-03-31)
• Added input <span class="hljs-string">&#x27;kernel-builder/rust-overlay/nixpkgs&#x27;</span>:
    follows <span class="hljs-string">&#x27;kernel-builder/nixpkgs&#x27;</span>`,wrap:!1}}),ue=new m({props:{title:"Skipping the get_kernel check",local:"skipping-the-getkernel-check",headingTag:"h2"}}),me=new tl({props:{source:"https://github.com/huggingface/kernels/blob/main/docs/source/builder/build.md"}}),{c(){b=a("meta"),fe=i(),ye=a("p"),Te=i(),d(T.$$.fragment),xe=i(),d(x.$$.fragment),ge=i(),d(g.$$.fragment),we=i(),f=a("blockquote"),f.innerHTML=gt,ke=i(),d(w.$$.fragment),$e=i(),k=a("p"),k.textContent=wt,Je=i(),$=a("ul"),$.innerHTML=kt,Ue=i(),d(J.$$.fragment),je=i(),U=a("p"),U.textContent=$t,Ce=i(),j=a("p"),j.textContent=Jt,Ie=i(),d(C.$$.fragment),Ge=i(),I=a("p"),I.textContent=Ut,Ne=i(),d(G.$$.fragment),Ze=i(),d(N.$$.fragment),ve=i(),Z=a("p"),Z.innerHTML=jt,We=i(),d(v.$$.fragment),Ve=i(),W=a("p"),W.innerHTML=Ct,He=i(),d(V.$$.fragment),Be=i(),H=a("p"),H.innerHTML=It,Ye=i(),d(B.$$.fragment),Ee=i(),Y=a("p"),Y.innerHTML=Gt,Le=i(),d(E.$$.fragment),Se=i(),L=a("p"),L.innerHTML=Nt,ze=i(),d(S.$$.fragment),Re=i(),z=a("p"),z.innerHTML=Zt,Qe=i(),d(R.$$.fragment),Ae=i(),Q=a("p"),Q.textContent=vt,Xe=i(),d(A.$$.fragment),Fe=i(),X=a("p"),X.innerHTML=Wt,De=i(),d(F.$$.fragment),_e=i(),d(D.$$.fragment),Oe=i(),_=a("p"),_.textContent=Vt,Pe=i(),d(O.$$.fragment),qe=i(),P=a("p"),P.innerHTML=Ht,Ke=i(),d(q.$$.fragment),et=i(),K=a("p"),K.innerHTML=Bt,tt=i(),d(ee.$$.fragment),lt=i(),te=a("p"),te.innerHTML=Yt,nt=i(),le=a("p"),le.textContent=Et,it=i(),d(ne.$$.fragment),st=i(),ie=a("p"),ie.textContent=Lt,at=i(),d(se.$$.fragment),rt=i(),ae=a("p"),ae.innerHTML=St,dt=i(),re=a("p"),re.innerHTML=zt,pt=i(),d(de.$$.fragment),ot=i(),pe=a("p"),pe.innerHTML=Rt,ct=i(),d(oe.$$.fragment),ht=i(),ce=a("p"),ce.innerHTML=Qt,ut=i(),d(he.$$.fragment),Mt=i(),d(ue.$$.fragment),mt=i(),Me=a("p"),Me.innerHTML=At,yt=i(),d(me.$$.fragment),bt=i(),be=a("p"),this.h()},l(e){const t=qt("svelte-u9bgzb",document.head);b=r(t,"META",{name:!0,content:!0}),t.forEach(l),fe=s(e),ye=r(e,"P",{}),Xt(ye).forEach(l),Te=s(e),p(T.$$.fragment,e),xe=s(e),p(x.$$.fragment,e),ge=s(e),p(g.$$.fragment,e),we=s(e),f=r(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),M(f)!=="svelte-1sf6dmq"&&(f.innerHTML=gt),ke=s(e),p(w.$$.fragment,e),$e=s(e),k=r(e,"P",{"data-svelte-h":!0}),M(k)!=="svelte-5zbxl"&&(k.textContent=wt),Je=s(e),$=r(e,"UL",{"data-svelte-h":!0}),M($)!=="svelte-yt841z"&&($.innerHTML=kt),Ue=s(e),p(J.$$.fragment,e),je=s(e),U=r(e,"P",{"data-svelte-h":!0}),M(U)!=="svelte-1gt1gp0"&&(U.textContent=$t),Ce=s(e),j=r(e,"P",{"data-svelte-h":!0}),M(j)!=="svelte-ephjfc"&&(j.textContent=Jt),Ie=s(e),p(C.$$.fragment,e),Ge=s(e),I=r(e,"P",{"data-svelte-h":!0}),M(I)!=="svelte-vbvwso"&&(I.textContent=Ut),Ne=s(e),p(G.$$.fragment,e),Ze=s(e),p(N.$$.fragment,e),ve=s(e),Z=r(e,"P",{"data-svelte-h":!0}),M(Z)!=="svelte-1edfy9h"&&(Z.innerHTML=jt),We=s(e),p(v.$$.fragment,e),Ve=s(e),W=r(e,"P",{"data-svelte-h":!0}),M(W)!=="svelte-oshv1y"&&(W.innerHTML=Ct),He=s(e),p(V.$$.fragment,e),Be=s(e),H=r(e,"P",{"data-svelte-h":!0}),M(H)!=="svelte-106kaqs"&&(H.innerHTML=It),Ye=s(e),p(B.$$.fragment,e),Ee=s(e),Y=r(e,"P",{"data-svelte-h":!0}),M(Y)!=="svelte-mql59w"&&(Y.innerHTML=Gt),Le=s(e),p(E.$$.fragment,e),Se=s(e),L=r(e,"P",{"data-svelte-h":!0}),M(L)!=="svelte-z48w5c"&&(L.innerHTML=Nt),ze=s(e),p(S.$$.fragment,e),Re=s(e),z=r(e,"P",{"data-svelte-h":!0}),M(z)!=="svelte-mpebzc"&&(z.innerHTML=Zt),Qe=s(e),p(R.$$.fragment,e),Ae=s(e),Q=r(e,"P",{"data-svelte-h":!0}),M(Q)!=="svelte-n51o54"&&(Q.textContent=vt),Xe=s(e),p(A.$$.fragment,e),Fe=s(e),X=r(e,"P",{"data-svelte-h":!0}),M(X)!=="svelte-ewx7y5"&&(X.innerHTML=Wt),De=s(e),p(F.$$.fragment,e),_e=s(e),p(D.$$.fragment,e),Oe=s(e),_=r(e,"P",{"data-svelte-h":!0}),M(_)!=="svelte-1imq8kt"&&(_.textContent=Vt),Pe=s(e),p(O.$$.fragment,e),qe=s(e),P=r(e,"P",{"data-svelte-h":!0}),M(P)!=="svelte-m0u3an"&&(P.innerHTML=Ht),Ke=s(e),p(q.$$.fragment,e),et=s(e),K=r(e,"P",{"data-svelte-h":!0}),M(K)!=="svelte-1f12544"&&(K.innerHTML=Bt),tt=s(e),p(ee.$$.fragment,e),lt=s(e),te=r(e,"P",{"data-svelte-h":!0}),M(te)!=="svelte-1yhwali"&&(te.innerHTML=Yt),nt=s(e),le=r(e,"P",{"data-svelte-h":!0}),M(le)!=="svelte-1p7pfs6"&&(le.textContent=Et),it=s(e),p(ne.$$.fragment,e),st=s(e),ie=r(e,"P",{"data-svelte-h":!0}),M(ie)!=="svelte-1095wd7"&&(ie.textContent=Lt),at=s(e),p(se.$$.fragment,e),rt=s(e),ae=r(e,"P",{"data-svelte-h":!0}),M(ae)!=="svelte-12hsqds"&&(ae.innerHTML=St),dt=s(e),re=r(e,"P",{"data-svelte-h":!0}),M(re)!=="svelte-1qvgavi"&&(re.innerHTML=zt),pt=s(e),p(de.$$.fragment,e),ot=s(e),pe=r(e,"P",{"data-svelte-h":!0}),M(pe)!=="svelte-1bunmp3"&&(pe.innerHTML=Rt),ct=s(e),p(oe.$$.fragment,e),ht=s(e),ce=r(e,"P",{"data-svelte-h":!0}),M(ce)!=="svelte-1h1noce"&&(ce.innerHTML=Qt),ut=s(e),p(he.$$.fragment,e),Mt=s(e),p(ue.$$.fragment,e),mt=s(e),Me=r(e,"P",{"data-svelte-h":!0}),M(Me)!=="svelte-czbbir"&&(Me.innerHTML=At),yt=s(e),p(me.$$.fragment,e),bt=s(e),be=r(e,"P",{}),Xt(be).forEach(l),this.h()},h(){Tt(b,"name","hf:doc:metadata"),Tt(b,"content",nl),Tt(f,"class","note")},m(e,t){Kt(document.head,b),n(e,fe,t),n(e,ye,t),n(e,Te,t),o(T,e,t),n(e,xe,t),o(x,e,t),n(e,ge,t),o(g,e,t),n(e,we,t),n(e,f,t),n(e,ke,t),o(w,e,t),n(e,$e,t),n(e,k,t),n(e,Je,t),n(e,$,t),n(e,Ue,t),o(J,e,t),n(e,je,t),n(e,U,t),n(e,Ce,t),n(e,j,t),n(e,Ie,t),o(C,e,t),n(e,Ge,t),n(e,I,t),n(e,Ne,t),o(G,e,t),n(e,Ze,t),o(N,e,t),n(e,ve,t),n(e,Z,t),n(e,We,t),o(v,e,t),n(e,Ve,t),n(e,W,t),n(e,He,t),o(V,e,t),n(e,Be,t),n(e,H,t),n(e,Ye,t),o(B,e,t),n(e,Ee,t),n(e,Y,t),n(e,Le,t),o(E,e,t),n(e,Se,t),n(e,L,t),n(e,ze,t),o(S,e,t),n(e,Re,t),n(e,z,t),n(e,Qe,t),o(R,e,t),n(e,Ae,t),n(e,Q,t),n(e,Xe,t),o(A,e,t),n(e,Fe,t),n(e,X,t),n(e,De,t),o(F,e,t),n(e,_e,t),o(D,e,t),n(e,Oe,t),n(e,_,t),n(e,Pe,t),o(O,e,t),n(e,qe,t),n(e,P,t),n(e,Ke,t),o(q,e,t),n(e,et,t),n(e,K,t),n(e,tt,t),o(ee,e,t),n(e,lt,t),n(e,te,t),n(e,nt,t),n(e,le,t),n(e,it,t),o(ne,e,t),n(e,st,t),n(e,ie,t),n(e,at,t),o(se,e,t),n(e,rt,t),n(e,ae,t),n(e,dt,t),n(e,re,t),n(e,pt,t),o(de,e,t),n(e,ot,t),n(e,pe,t),n(e,ct,t),o(oe,e,t),n(e,ht,t),n(e,ce,t),n(e,ut,t),o(he,e,t),n(e,Mt,t),o(ue,e,t),n(e,mt,t),n(e,Me,t),n(e,yt,t),o(me,e,t),n(e,bt,t),n(e,be,t),ft=!0},p:Dt,i(e){ft||(c(T.$$.fragment,e),c(x.$$.fragment,e),c(g.$$.fragment,e),c(w.$$.fragment,e),c(J.$$.fragment,e),c(C.$$.fragment,e),c(G.$$.fragment,e),c(N.$$.fragment,e),c(v.$$.fragment,e),c(V.$$.fragment,e),c(B.$$.fragment,e),c(E.$$.fragment,e),c(S.$$.fragment,e),c(R.$$.fragment,e),c(A.$$.fragment,e),c(F.$$.fragment,e),c(D.$$.fragment,e),c(O.$$.fragment,e),c(q.$$.fragment,e),c(ee.$$.fragment,e),c(ne.$$.fragment,e),c(se.$$.fragment,e),c(de.$$.fragment,e),c(oe.$$.fragment,e),c(he.$$.fragment,e),c(ue.$$.fragment,e),c(me.$$.fragment,e),ft=!0)},o(e){h(T.$$.fragment,e),h(x.$$.fragment,e),h(g.$$.fragment,e),h(w.$$.fragment,e),h(J.$$.fragment,e),h(C.$$.fragment,e),h(G.$$.fragment,e),h(N.$$.fragment,e),h(v.$$.fragment,e),h(V.$$.fragment,e),h(B.$$.fragment,e),h(E.$$.fragment,e),h(S.$$.fragment,e),h(R.$$.fragment,e),h(A.$$.fragment,e),h(F.$$.fragment,e),h(D.$$.fragment,e),h(O.$$.fragment,e),h(q.$$.fragment,e),h(ee.$$.fragment,e),h(ne.$$.fragment,e),h(se.$$.fragment,e),h(de.$$.fragment,e),h(oe.$$.fragment,e),h(he.$$.fragment,e),h(ue.$$.fragment,e),h(me.$$.fragment,e),ft=!1},d(e){e&&(l(fe),l(ye),l(Te),l(xe),l(ge),l(we),l(f),l(ke),l($e),l(k),l(Je),l($),l(Ue),l(je),l(U),l(Ce),l(j),l(Ie),l(Ge),l(I),l(Ne),l(Ze),l(ve),l(Z),l(We),l(Ve),l(W),l(He),l(Be),l(H),l(Ye),l(Ee),l(Y),l(Le),l(Se),l(L),l(ze),l(Re),l(z),l(Qe),l(Ae),l(Q),l(Xe),l(Fe),l(X),l(De),l(_e),l(Oe),l(_),l(Pe),l(qe),l(P),l(Ke),l(et),l(K),l(tt),l(lt),l(te),l(nt),l(le),l(it),l(st),l(ie),l(at),l(rt),l(ae),l(dt),l(re),l(pt),l(ot),l(pe),l(ct),l(ht),l(ce),l(ut),l(Mt),l(mt),l(Me),l(yt),l(bt),l(be)),l(b),u(T,e),u(x,e),u(g,e),u(w,e),u(J,e),u(C,e),u(G,e),u(N,e),u(v,e),u(V,e),u(B,e),u(E,e),u(S,e),u(R,e),u(A,e),u(F,e),u(D,e),u(O,e),u(q,e),u(ee,e),u(ne,e),u(se,e),u(de,e),u(oe,e),u(he,e),u(ue,e),u(me,e)}}}const nl='{"title":"Using the kernel builder with Nix","local":"using-the-kernel-builder-with-nix","sections":[{"title":"Installation","local":"installation","sections":[{"title":"Installing Nix","local":"installing-nix","sections":[],"depth":3},{"title":"Using the Hugging Face binary cache","local":"using-the-hugging-face-binary-cache","sections":[],"depth":3},{"title":"GPU library configuration","local":"gpu-library-configuration","sections":[],"depth":3}],"depth":2},{"title":"Getting started","local":"getting-started","sections":[],"depth":2},{"title":"Building a kernel","local":"building-a-kernel","sections":[],"depth":2},{"title":"Shell for local development","local":"shell-for-local-development","sections":[],"depth":2},{"title":"Shell for testing a kernel","local":"shell-for-testing-a-kernel","sections":[],"depth":2},{"title":"Adding test dependencies to development shells","local":"adding-test-dependencies-to-development-shells","sections":[],"depth":2},{"title":"Uploading your kernel to the Hub","local":"uploading-your-kernel-to-the-hub","sections":[],"depth":2},{"title":"Updating the kernel build toolchain","local":"updating-the-kernel-build-toolchain","sections":[],"depth":2},{"title":"Skipping the get_kernel check","local":"skipping-the-getkernel-check","sections":[],"depth":2}],"depth":1}';function il(xt){return _t(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ol extends Ot{constructor(b){super(),Pt(this,b,il,ll,Ft,{})}}export{ol as component};
