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 direct fused
operators (projected_attention, ffn, linear_projections, conv3d) 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, PyTorch 2.15 or newer, and Triton 3.9.
pip install piper-kernels
The package includes all quantized weight formats (ConvRot INT8, ConvRot Trellis, and storage-only GGUF) and requires Triton unconditionally:
- Linux: install the CUDA or ROCm PyTorch build and its matching Triton 3.9
package first (
tritonon CUDA orpytorch-triton-rocmon ROCm). - 64-bit Windows:
pip install piper-kernelsinstalls Triton 3.9 automatically throughtriton-windows. 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-windowsbundles 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.
Quantized compute operators (piper_kernels.attention, piper_kernels.ops,
in-place weight updates) and GPU-driven Triton collectives
(piper_kernels.collectives) require a supported CUDA or ROCm GPU and raise
ValueError on CPU or unsupported GPUs before mutating caller-owned outputs,
KV pools, or state. Top-level piper_kernels exports the primary forward-pass
operators alongside the four domain namespaces (attention, ops, weights,
collectives); weight formats, storage/sharding protocols, and format codecs
live under piper_kernels.weights (weights.trellis, weights.gguf). CPU
support is retained for weight construction/storage/offload (from_hp,
from_quantized, from_storage, as_storage, dequantize, sharding,
row-slice planning, pinning), TrellisKVPagePool / trellis_kv_storage_specs
host staging, merge_attention_lse, sparse_piper_coarse_residual, row-only
quantized F.embedding lookups (including mmap host tables), plain dense
torch.Tensor linear/FFN/Conv3D calls, and meta/FakeTensorMode tracing.
Quick start
This runs dense Piper Attention on a supported GPU (NVIDIA SM8x/SM12x or AMD
RDNA4). Inputs use [batch, heads, sequence, head_dim] layout:
import torch
from piper_kernels import piper_attention
device = "cuda"
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])
Quantized attention approximates floating-point attention, and fused
projection/attention operators can change rounding. CPU and unsupported GPUs
raise ValueError (meta and CUDA FakeTensorMode shape tracing remain
supported). Measure numerical quality and full-operator latency on your
workload; see attention for input and backend support.
Guides
| Task | Read |
|---|---|
| Choose and use dense, KV-decode, or sparse Piper attention | Attention |
| Construct, load, run, update, or shard quantized weights; run fused operators | 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.9.0rc5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| piper_kernels-0.9.0rc5.tar.gz | 721.1 kB | With provenance | Details for piper_kernels-0.9.0rc5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| piper_kernels-0.9.0rc5-py3-none-any.whl | Python 3 | none | any | Details for piper_kernels-0.9.0rc5-py3-none-any.whl |
Total release size: 1.6 MB
Release files / piper_kernels-0.9.0rc5.tar.gz
| Download URL | piper_kernels-0.9.0rc5.tar.gz |
|---|---|
| Size | 721.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
81051cbb8b9d3c2336f64e5e180d217765662d02e937c188cf90c71a7d50dff8
|
|
BLAKE2b-256 checksum How to use checksums |
e25a05a53f925daa2ee2bc4295e55369db2e1836562133ede952a7fd9005877d
|
| 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 Dec 4, 2026.
Transparency logRelease files / piper_kernels-0.9.0rc5-py3-none-any.whl
| Download URL | piper_kernels-0.9.0rc5-py3-none-any.whl |
|---|---|
| Size | 862.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
64d2c24c014e443520a3b7d18c0470aaaa91e58c6b33a1c3175cd0d92b104198
|
|
BLAKE2b-256 checksum How to use checksums |
5bb9df97129afd884c6a8d28dfc535a4c50bd5acb2fd461757ff452b6898f51d
|
| 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 Dec 4, 2026.
Transparency logSecurity for piper-kernels 0.9.0rc5
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.
Attestation for piper_kernels-0.9.0rc5.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 Dec 4, 2026.
Transparency logA 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.