Documentation | Kernel Explorer
About
Popcorn 🍿 is a development and dispatch library for high-performance machine learning kernels. It unifies 96 kernels and more than 100 optimized implementations behind a single API, then selects among eligible backends using hardware-specific benchmark records. Each implementation is checked against a PyTorch reference; failed and unmeasured cases remain visible evidence rather than being presented as successful validation. Popcorn also ships a growing collection of first-party kernels, along with the environment and harness to build, test, benchmark, and deploy new kernels and backends. Contributions are welcome.
Installation
Install Popcorn from PyPI using uv:
uv pip install popcorn # first-party only
uv pip install "popcorn[liger]" # + Liger-Kernel backends
uv pip install "popcorn[fla]" # + FLA backends
uv pip install "popcorn[cudnn]" # + cuDNN attention
uv pip install "popcorn[transformer_engine]" # + Transformer Engine softmax
[!NOTE] Add
--torch-backend=autoto letuvselect a PyTorch build for your hardware.
[!WARNING]
pip install popcornmay work but is not generally supported. Install the desired PyTorch build for your hardware first, then install Popcorn with pip.
Add one extra per backend you want. There is no "everything" extra: the backends pin mutually exclusive requirements, so installing them together does not resolve.
Installing also fetches the benchmark cache that dispatch selects implementations with, from the popcorn-reports dataset at the revision this version pins. Set POPCORN_SKIP_REPORTS=1 to install without it; popcorn then falls back to the reference for every call and says so. Refresh it at any time with:
popcorn bench pull
A backend is eligible only when its package is installed at a declared supported version: auto-dispatch skips unavailable ones, and forcing one raises with the install hint or version error. First-party kernels (the popcorn backend) are always included.
Installing Backends
To install the prerequisites for an additional backend:
uv pip install "popcorn[<new_extra>]"
Updating
Upgrade Popcorn and refresh its pinned report cache with:
uv pip install --upgrade popcorn
Limitations
Correctness
Popcorn validates implementations across a broad grid of inputs and does its best to warn when an exact case has not been validated. This reduces the risk of numerical errors but does not guarantee correctness for every possible input. Every comparison also assumes that the registered reference is correct: Popcorn measures agreement with that reference, not correctness in the abstract, therefore "correctness" here is the measure of similarity to the reference. Validate representative production inputs, particularly unusual shapes, dtypes, and optional arguments.
Performance
Popcorn benchmarks kernels in isolation. This is useful for comparing implementations in an apples-to-apples fashion, but these results do not necessarily predict end-to-end model performance. PyTorch and torch.compile may fuse or rewrite surrounding native operations, while a backend call or custom-op boundary can limit those optimizations. Tensor layouts, memory traffic, synchronization, and compilation overhead can also change the result in a real workload.
It's important to keep in mind that dispatch currently optimizes recorded execution time, not peak memory. For some workloads, we may prefer a slower implementation with a smaller memory footprint. Benchmark representative model code and explicitly tune or select a backend when latency and memory requirements are both important.
Contributing
New kernels and backends follow a guided flow: CONTRIBUTING.md. Benchmarks come from contributors' machines; run the grid on your hardware and include its matrix rows for review. Maintainers publish accepted report evidence to the pinned dataset.
Acknowledgement
Popcorn stands on the shoulders of the open-source kernel ecosystem. The optimized backends it dispatches to are built and maintained by their authors:
- flash-linear-attention
- Liger-Kernel
- quack
- flash-attention
- NVIDIA cuDNN Frontend
- NVIDIA Transformer Engine
- Unsloth
The agent optimization loop (popcorn loop) is inspired by AutoKernel's edit–evaluate–keep/revert cycle for autonomous kernel search.
Citation
@software{popcorn,
author = {Timor Averbuch},
title = {Popcorn: kernel dispatch for PyTorch},
url = {https://github.com/tilde-research/popcorn},
year = {2026}
}
License
Metadata
Release files for popcorn 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| popcorn-0.1.1.tar.gz | 19.1 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| popcorn-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 MB
Release files / popcorn-0.1.1.tar.gz
| Download URL | popcorn-0.1.1.tar.gz |
|---|---|
| Size | 19.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8d3199ea7d201edec5e153f0df4b888850d0b2b76bc09668612c7c40731ec292
|
|
BLAKE2b-256 checksum How to use checksums |
62bac706127a7fc567f44ef7860a9369e508c31cd2ee08b0ec6608ac4fa47b14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency logRelease files / popcorn-0.1.1-py3-none-any.whl
| Download URL | popcorn-0.1.1-py3-none-any.whl |
|---|---|
| Size | 19.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f22e6bd288faf7f3bc10d5b76faf34d7b1c2c42a994dee8cbc0fef57d3515718
|
|
BLAKE2b-256 checksum How to use checksums |
30e09eb60c620a3947807e0fb8f09ba5fe2b88e5b20551a8212bddc280fe89ff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency log