kernels 0.17.1


pip install kernels

  Latest version

Released: Sep 16, 2026

Project Links

Meta
Author: Daniel de Kok, David Holtz
Requires Python: >=3.10

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.

Test coverage

To reproduce the coverage number reported on PRs locally:

uv run pytest --cov=kernels --cov-report=term-missing tests

CI measures coverage on a single canonical matrix cell (Python 3.10 / Torch 2.12.0) and posts a sticky comment on the PR; the threshold is 80% (warn-only โ€” the check stays green either way).

Wheel compatibility matrix

Platform CPython >=3.8 (abi3) CPython (additional flags: t) 3.14
macosx_10_12_x86_64
macosx_11_0_arm64
manylinux1_i686
manylinux2014_aarch64
manylinux2014_armv7l
manylinux2014_ppc64le
manylinux2014_s390x
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_armv7l
manylinux_2_17_ppc64le
manylinux_2_17_s390x
manylinux_2_17_x86_64
manylinux_2_5_i686
musllinux_1_2_aarch64
musllinux_1_2_armv7l
musllinux_1_2_i686
musllinux_1_2_x86_64
win32
win_amd64
win_arm64

Files in release

kernels-0.17.1-cp314-cp314t-macosx_10_12_x86_64.whl (1.7MiB)
kernels-0.17.1-cp314-cp314t-macosx_11_0_arm64.whl (1.6MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.8MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.9MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8MiB)
kernels-0.17.1-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl (1.9MiB)
kernels-0.17.1-cp314-cp314t-musllinux_1_2_aarch64.whl (2.0MiB)
kernels-0.17.1-cp314-cp314t-musllinux_1_2_armv7l.whl (2.0MiB)
kernels-0.17.1-cp314-cp314t-musllinux_1_2_i686.whl (2.1MiB)
kernels-0.17.1-cp314-cp314t-musllinux_1_2_x86_64.whl (2.1MiB)
kernels-0.17.1-cp314-cp314t-win32.whl (1.4MiB)
kernels-0.17.1-cp314-cp314t-win_amd64.whl (1.6MiB)
kernels-0.17.1-cp38-abi3-macosx_10_12_x86_64.whl (1.7MiB)
kernels-0.17.1-cp38-abi3-macosx_11_0_arm64.whl (1.6MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.8MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (1.8MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (2.1MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (1.9MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.8MiB)
kernels-0.17.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl (1.9MiB)
kernels-0.17.1-cp38-abi3-musllinux_1_2_aarch64.whl (2.0MiB)
kernels-0.17.1-cp38-abi3-musllinux_1_2_armv7l.whl (2.0MiB)
kernels-0.17.1-cp38-abi3-musllinux_1_2_i686.whl (2.1MiB)
kernels-0.17.1-cp38-abi3-musllinux_1_2_x86_64.whl (2.1MiB)
kernels-0.17.1-cp38-abi3-win32.whl (1.4MiB)
kernels-0.17.1-cp38-abi3-win_amd64.whl (1.6MiB)
kernels-0.17.1-cp38-abi3-win_arm64.whl (1.4MiB)
kernels-0.17.1.tar.gz (325.5KiB)
Extras:
Dependencies:
huggingface-hub (>=1.10.0)
packaging (>=20.0)
pyyaml (>=6)
sigstore (<5,>=4)
tomli (>=2.0)
typing-extensions (>=4.0)
tomlkit (>=0.13.3)