Download compute kernels
Project Links
Meta
Author: Daniel de Kok, David Holtz
Requires Python: >=3.9
Classifiers
kernels
The Kernel Hub allows Python libraries and applications to load compute kernels directly from the Hub. To support this kind of dynamic loading, Hub kernels differ from traditional Python kernel packages in that they are made to be:
- Portable: a kernel can be loaded from paths outside
PYTHONPATH. - Unique: multiple versions of the same kernel can be loaded in the same Python process.
- Compatible: kernels must support all recent versions of Python and the different PyTorch build configurations (various CUDA versions and C++ ABIs). Furthermore, older C library versions must be supported.
The kernels Python package is used to load kernels from the Hub.
๐ Quick Start
Install the kernels package with pip (requires torch>=2.5 and CUDA):
pip install kernels
Here is how you would use the activation kernels from the Hugging Face Hub:
import torch
from kernels import get_kernel
# Download optimized kernels from the Hugging Face hub
activation = get_kernel("kernels-community/activation", version=1)
# Random tensor
x = torch.randn((10, 10), dtype=torch.float16, device="cuda")
# Run the kernel
y = torch.empty_like(x)
activation.gelu_fast(y, x)
print(y)
You can search for kernels on the Hub.
๐ Documentation
Read the documentation of kernels.
0.12.3
Mar 20, 2026
0.12.2
Mar 04, 2026
0.12.1
Jan 26, 2026
0.12.0
Jan 24, 2026
0.11.7
Jan 08, 2026
0.11.6
Jan 08, 2026
0.11.5
Dec 17, 2025
0.11.4
Dec 16, 2025
0.11.3
Dec 05, 2025
0.11.2
Dec 04, 2025
0.11.1
Nov 21, 2025
0.11.0
Oct 31, 2025
0.10.5
Dec 04, 2025
0.10.4
Oct 16, 2025
0.10.3
Oct 13, 2025
0.10.2
Sep 22, 2025
0.10.1
Sep 10, 2025
0.10.0
Sep 05, 2025
0.9.1
Dec 04, 2025
0.9.0
Aug 01, 2025
0.8.2
Dec 04, 2025
0.8.1
Jul 23, 2025
0.8.0
Jul 15, 2025
0.7.1
Dec 04, 2025
0.7.0
Jul 07, 2025
0.6.3
Dec 04, 2025
0.6.2
Jun 25, 2025
0.6.1
Jun 20, 2025
0.6.0
Jun 20, 2025
0.5.1
Dec 04, 2025
0.5.0
May 06, 2025
0.5.0.dev0
May 06, 2025
0.4.5
Dec 04, 2025
0.4.4
Apr 11, 2025
0.4.3
Apr 10, 2025
0.4.2
Mar 27, 2025
0.4.1
Mar 24, 2025
0.4.0
Mar 21, 2025
0.3.3
Mar 20, 2025
0.3.2
Mar 20, 2025
0.3.1
Mar 19, 2025
0.3.0
Mar 19, 2025
0.2.1
Mar 10, 2025
0.2.0
Mar 10, 2025
0.1.7
Feb 25, 2025