Skip to main content
Pre-release

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

Piper Kernels

Quantized attention, linear, and convolution operators for PyTorch inference. Piper Kernels combines compact weight formats and GPU kernels with optional compiler fusions that avoid intermediate tensors and repeated preparation. Portable PyTorch references define the corresponding numerical operations.

Use the operators directly or install quantized weights in PyTorch modules. Applications own model loading, checkpoint naming, and device placement; Piper Offload uses these weight formats for its model runtime.

Installation

Requires Python 3.14 or newer and PyTorch 2.15 or newer.

pip install piper-kernels

The base package requires only PyTorch. Optional extras provide weight-format and accelerator dependencies:

Extra Use
convrot ConvRot INT8 and Trellis weights
nvfp4 Ordinary and ConvRot NVFP4 weights
triton Optimized GPU backends

For example, install "piper-kernels[convrot,triton]" for ConvRot INT8 GPU execution. On Linux, install the CUDA or ROCm PyTorch build and its matching Triton first; the extra does not install Linux Triton.

On 64-bit Windows, the triton extra selects Triton 3.9 through triton-windows. Optimized execution needs Windows 10 or 11, a supported GPU with a current driver, and the Visual C++ Redistributable for Visual Studio 2015–2022. For NVIDIA, triton-windows bundles the CUDA toolchain and TinyCC; no separate CUDA toolkit or Visual Studio installation is needed. For AMD, use TheRock's ROCm PyTorch build and its matching GPU device packages; see AMD validation coverage.

Quick start

This runs dense Piper Attention on CUDA when available and on CPU otherwise. Inputs use [batch, heads, sequence, head_dim] layout:

import torch
from piper_kernels import piper_attention

device = "cuda" if torch.cuda.is_available() else "cpu"
query, key, value = (
    torch.randn(1, 2, 128, 64, device=device, dtype=torch.bfloat16) for _ in range(3)
)

with torch.inference_mode():
    output = piper_attention(query, key, value, is_causal=False)

print(output.shape)  # torch.Size([1, 2, 128, 64])

Supported GPUs with the required backend installed use an optimized path; other configurations use the slower reference for the same quantized algorithm. Both approximate floating-point attention, and compiler fusions can change rounding. Measure numerical quality and full-operator latency on your workload; see attention for input and backend support.

Guides

Task Read
Choose and use dense, sparse, or SageAttention2++ attention Attention
Construct, load, run, update, or shard quantized weights; enable compiler fusions Weights and quantized operators
Understand implementation boundaries, extend kernels, or run checks Development
Set up CUDA/ROCm environments, caches, and regressions Environments
Measure performance and quality, tune, or inspect generated kernels Benchmarks

These docs describe the checked-out revision. Use the matching Git tag for an installed release. AGENTS.md gives repository instructions for coding agents; VERSIONING.md covers compatibility and releases, and CHANGELOG.md records changes between releases.

Licensed under the Apache License, Version 2.0.

Metadata

Release files for piper-kernels 0.8.0rc8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for piper-kernels 0.8.0rc8
File Size Uploaded Provenance Actions
piper_kernels-0.8.0rc8.tar.gz 562.8 kB With provenance Details for piper_kernels-0.8.0rc8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for piper-kernels 0.8.0rc8
File Interpreter ABI Platform Actions
piper_kernels-0.8.0rc8-py3-none-any.whl Python 3 none any Details for piper_kernels-0.8.0rc8-py3-none-any.whl

Total release size: 1.3 MB

Release files / piper_kernels-0.8.0rc8.tar.gz

Download URL piper_kernels-0.8.0rc8.tar.gz
Size 562.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a0c678c1979ee4a9906dd9bc51d430e5bafd327ce58fd80f47ce57c85ab522a7
BLAKE2b-256 checksum
How to use checksums
74ec10348aadef6fab469993211969c67f5f7bd0cdf7f5ab73dc9ab786b2e32a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Release files / piper_kernels-0.8.0rc8-py3-none-any.whl

Download URL piper_kernels-0.8.0rc8-py3-none-any.whl
Size 701.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25577fe0abcf36d624233a39a88314b309d08be9e6b5d6de42a3da88915d4b2d
BLAKE2b-256 checksum
How to use checksums
379904469977ec28cca8ab281528f3047dd9729844634545449bb0ac8bbba2d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 25, 2026.

Transparency log

Security for piper-kernels 0.8.0rc8

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for piper_kernels-0.8.0rc8.tar.gz

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 Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
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