Skip to main content

Popcorn

PyPI release kernels backends implementations grid rows


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=auto to let uv select a PyTorch build for your hardware.

[!WARNING] pip install popcorn may 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:

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

Apache-2.0.

Download files

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

Source Distribution

popcorn-0.1.1.tar.gz (19.1 MB view details)

Uploaded Source

Built Distribution

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

popcorn-0.1.1-py3-none-any.whl (19.2 MB view details)

Uploaded Python 3

File details

Details for the file popcorn-0.1.1.tar.gz.

File metadata

  • Download URL: popcorn-0.1.1.tar.gz
  • Upload date:
  • Size: 19.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for popcorn-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8d3199ea7d201edec5e153f0df4b888850d0b2b76bc09668612c7c40731ec292
MD5 245ccf910db85665969664041643bf58
BLAKE2b-256 62bac706127a7fc567f44ef7860a9369e508c31cd2ee08b0ec6608ac4fa47b14

See more details on using hashes here.

Provenance

The following attestation bundles were made for popcorn-0.1.1.tar.gz:

Publisher: pypi.yml on tilde-research/popcorn

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

File details

Details for the file popcorn-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: popcorn-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 19.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for popcorn-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f22e6bd288faf7f3bc10d5b76faf34d7b1c2c42a994dee8cbc0fef57d3515718
MD5 578077123a721ca53bf64b8c6de9f295
BLAKE2b-256 30e09eb60c620a3947807e0fb8f09ba5fe2b88e5b20551a8212bddc280fe89ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for popcorn-0.1.1-py3-none-any.whl:

Publisher: pypi.yml on tilde-research/popcorn

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

Release history Release notifications | RSS feed

3.0

1 file

This release

0.1.1 This release

2 files

0.1.0

2 files

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