Download compute kernels
Project description
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kernels-0.12.1.tar.gz.
File metadata
- Download URL: kernels-0.12.1.tar.gz
- Upload date:
- Size: 56.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
41e31ef167add0062cdc302a943ce287194c13b5af12b82a5fa76e7353ca0042
|
|
| MD5 |
0799e3e557a6edb6db771e5df6d2d2c8
|
|
| BLAKE2b-256 |
5dc5d9bd5f3332b288bf3e771a42b7c3c9d2af8daa58c682a84c4e0c83058d62
|
Provenance
The following attestation bundles were made for kernels-0.12.1.tar.gz:
Publisher:
publish_kernels.yml on huggingface/kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kernels-0.12.1.tar.gz -
Subject digest:
41e31ef167add0062cdc302a943ce287194c13b5af12b82a5fa76e7353ca0042 - Sigstore transparency entry: 855385812
- Sigstore integration time:
-
Permalink:
huggingface/kernels@30685a79203ed855b328cee874698d13e82fb3ae -
Branch / Tag:
refs/tags/v0.12.1 - Owner: https://github.com/huggingface
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_kernels.yml@30685a79203ed855b328cee874698d13e82fb3ae -
Trigger Event:
push
-
Statement type:
File details
Details for the file kernels-0.12.1-py3-none-any.whl.
File metadata
- Download URL: kernels-0.12.1-py3-none-any.whl
- Upload date:
- Size: 55.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4569fe00bc6a2b0f2cccff81841d7917af143c786ade152c3b2a78f61097c757
|
|
| MD5 |
7f62bcd7a961cfb24938863ec7ab16a9
|
|
| BLAKE2b-256 |
4bab6d1453b2a1b0a473e107745ef4d4f79241f6ef0ed8a371d62e93b4100bee
|
Provenance
The following attestation bundles were made for kernels-0.12.1-py3-none-any.whl:
Publisher:
publish_kernels.yml on huggingface/kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kernels-0.12.1-py3-none-any.whl -
Subject digest:
4569fe00bc6a2b0f2cccff81841d7917af143c786ade152c3b2a78f61097c757 - Sigstore transparency entry: 855385817
- Sigstore integration time:
-
Permalink:
huggingface/kernels@30685a79203ed855b328cee874698d13e82fb3ae -
Branch / Tag:
refs/tags/v0.12.1 - Owner: https://github.com/huggingface
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish_kernels.yml@30685a79203ed855b328cee874698d13e82fb3ae -
Trigger Event:
push
-
Statement type: