--- id: kernels version: "0.16.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # kernels — Download compute kernels License: permissive · Maintenance: active · Downloads: 3.1M/mo ## What it is and what it does kernels is a Python package that downloads and loads compute kernels from Hugging Face Hub directly into your application at runtime. Rather than bundling kernels statically, it treats them as portable, versioned artifacts that can be loaded from outside the standard Python path, allowing multiple versions of the same kernel to coexist in a single process. The package is built to handle the complexity of varied build configurations across environments. The typical workflow is to call `get_kernel()` with a Hub repository identifier and optional version number, then invoke kernel functions. This is most useful for performance-critical operations where hand-optimized kernels can provide significant speedup. The package depends on huggingface-hub for Hub communication, packaging and pyyaml for metadata handling, and sigstore for verification. Use it for: - Load optimized kernels from the Hub to accelerate compute-intensive operations in applications. - Use multiple versions of the same kernel in a single process for testing or gradual migration. - Deploy applications that rely on optimized kernels without pre-installing them in the container. - Access community-contributed kernels for specialized operations without vendoring custom code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Loads optimized compute kernels from Hugging Face Hub into Python applications at runtime, enabling dynamic kernel loading without modifying PYTHONPATH. Yes, if you are building applications that benefit from optimized kernels and want to manage them as versioned Hub artifacts. The package is actively maintained, has no known vulnerabilities, and low install friction. However, it requires Python 3.10+ and a working compute environment; without those, it will not function. The Hub kernel ecosystem is still young, so verify that the kernels you need are available and compatible before committing to this approach. ## Install pip install kernels uv add kernels poetry add kernels ## Installing kernels Before you install: Low friction installation with a pure-Python wheel. Active maintenance as of 49 days ago. Requires external CUDA and compute dependencies not managed by pip. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; attribution required. Quickstart: pip install kernels from kernels import get_kernel activation = get_kernel("kernels-community/activation", version=1) Requires Python 3.10+. Kernels are designed for GPU compute and require a compatible CUDA environment to function. Verify before relying: - Whether all kernel implementations in the Hub are compatible with your installed compute environment. - Performance characteristics and overhead of dynamic kernel loading compared to static imports. - Specific PyTorch version requirements beyond what the description excerpt states. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags load compute kernels from hub, dynamic kernel loading, huggingface kernel management, optimized cuda kernels, portable kernel loading, kernel-loading, gpu-compute, hub-integration [View on SkillFed](https://skillfed.io/packages/kernels) · [View on PyPI](https://pypi.org/project/kernels/)