Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

kernels

kernel-builder logo

PyPI - Version GitHub tag Test 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kernels-0.5.0.dev0.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kernels-0.5.0.dev0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file kernels-0.5.0.dev0.tar.gz.

File metadata

  • Download URL: kernels-0.5.0.dev0.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kernels-0.5.0.dev0.tar.gz
Algorithm Hash digest
SHA256 bb03b068250ef47f17993cf4734c0a8e2a92476403e6e39bd372152e80512817
MD5 099dfc0501be3e5d2424ee88e7412f82
BLAKE2b-256 3cfa2a32586534d761db05990c862f8a91e732b6815ac5aae81ef4d7147a4db3

See more details on using hashes here.

Provenance

The following attestation bundles were made for kernels-0.5.0.dev0.tar.gz:

Publisher: publish.yml on huggingface/kernels

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kernels-0.5.0.dev0-py3-none-any.whl.

File metadata

  • Download URL: kernels-0.5.0.dev0-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kernels-0.5.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 45ed6f08010b10a4af3657a0644e05f724edae892d656404c75c75b26bd32cc0
MD5 b9543beb25de338ac33c92c927f9fcaf
BLAKE2b-256 f4c5ef9adff6786d3156979ee0517d8c24f764606af9cb01dd0351e599838c90

See more details on using hashes here.

Provenance

The following attestation bundles were made for kernels-0.5.0.dev0-py3-none-any.whl:

Publisher: publish.yml on huggingface/kernels

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.16.1

2 files

0.16.0

2 files

0.15.2

2 files

0.15.1

2 files

0.14.1

2 files

0.14.0

2 files

0.13.0

2 files

0.12.3

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.7

2 files

0.11.6

2 files

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.5

2 files

0.10.4

2 files

0.10.3

2 files

0.10.2

2 files

0.10.1

2 files

0.10.0

2 files

0.9.1

2 files

0.9.0

2 files

0.8.2

2 files

0.8.1

2 files

0.8.0

2 files

0.7.1

2 files

0.7.0

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.1

2 files

0.5.0

2 files

This release

0.5.0.dev0 This release

2 files

0.4.5

1 file

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.3

2 files

0.3.2

1 file

0.3.1

1 file

0.3.0

1 file

0.2.1

1 file

0.2.0

1 file

0.1.7

2 files

0.0.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page