Buckets:
kernels init
Use kernels init to initialize a new kernel project.
Usage
kernels init / [--backends ] [--overwrite]
This creates a new directory in the current working directory with the (normalized) repo name.
What It Does
- Downloads a project template and replaces placeholders in file names, paths, and file contents
- Optionally restricts enabled backends (updates
build.tomland removes unused backend folders) - Initializes a Git repo and stages the files (
git init,git add .) - Initializes a templated system card for the kernel which is meant for the kernel developer to further modify
Examples
Initialize a new kernel project (defaults to metal on macOS, cuda on Linux/Windows):
kernels init my-user/my-kernel
Enable multiple backends:
kernels init my-user/my-kernel --backends cuda cpu
Enable all supported backends:
kernels init my-user/my-kernel --backends all
Overwrite an existing directory if it exists:
kernels init my-user/my-kernel --overwrite
Next Steps
kernels init prints suggested next steps after creating the project. A typical flow looks like:
cd my-kernel
cachix use huggingface
nix run -L --max-jobs 1 --cores 8 .#build-and-copy
uv run example.py
Notes
- The `` part is normalized to lowercase with dashes preferred. For example,
my-user/My_Kernelbecomes a directory namedmy-kerneland a repo idmy-user/my-kernel. - Python package names use underscores (e.g.,
my_kernel) since dashes are not valid in Python identifiers. --backendscan be one of:cpu,cuda,metal,rocm,xpu,npu, orall.- If the target directory already exists and is not empty,
kernels initexits with an error unless--overwriteis set. - The project is initialized as a Git repo (via
git init) because Nix flakes require it.
Xet Storage Details
- Size:
- 1.88 kB
- Xet hash:
- f8cb11ed141f63cb0df94742ec85775a1d8f8f0d11ae79de68a9dfb3060858ba
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.