Download compute kernels
Project Links
Meta
Author: OlivierDehaene, Daniel de Kok, David Holtz, Nicolas Patry
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.
๐ 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")
# 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
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.0
Aug 01, 2025
0.8.1
Jul 23, 2025
0.8.0
Jul 15, 2025
0.7.0
Jul 07, 2025
0.6.2
Jun 25, 2025
0.6.1
Jun 20, 2025
0.6.0
Jun 20, 2025
0.5.0
May 06, 2025
0.5.0.dev0
May 06, 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