Skip to content

Conversation

@MekkCyber
Copy link
Collaborator

@MekkCyber MekkCyber commented Dec 16, 2025

This should init a kernel project with default templates to simplify a bit the copy/pasting.

Example:

/dev/kernels$ kernels init example-kernel

✅ Kernel project 'example-kernel' initialized successfully at: /dev/kernels/example-kernel

Project structure:
├── example_kernel_cuda
├── example_kernel_metal
├── example_kernel_rocm
├── example_kernel_xpu
├── torch-ext
│   ├── example_kernel
│   │   └── __init__.py
│   ├── torch_binding.cpp
│   └── torch_binding.h
├── .gitattributes
├── README.md
├── build.toml
└── flake.nix

Next steps:
  1. cd /dev/kernels/example-kernel
  2. Add your kernel implementation in example_kernel/
  3. Update torch-ext/example_kernel/__init__.py to export your functions
  4. Build with: nix run .#build-and-copy 
  5. Upload with: kernels upload . --repo-id your-username/example-kernel

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants