Piper Kernels
Reusable PyTorch inference operators and optimized kernels for the Piper ecosystem and other consumers.
Piper Kernels requires Python 3.14 or newer.
The package owns operator semantics, portable PyTorch references, tensor subclasses, and optimized backends. It deliberately does not know about model repositories, checkpoint metadata, pipeline frameworks, or device-offloading policy.
Planned operators
| Package | Role |
|---|---|
piper_kernels.convrot |
ConvRot quantized tensors and linear operators; INT8 today, INT4 planned |
piper_kernels.attention |
Attention operators, including a future SageAttention backend |
ConvRot INT8
Quantize a dense weight, or wrap existing checkpoint storage without dequantizing it, then use the resulting tensor as a normal linear weight:
import torch
from piper_kernels.convrot import ConvRotInt8Tensor
weight = ConvRotInt8Tensor.from_hp(dense_weight, group_size=64)
checkpoint_weight = ConvRotInt8Tensor.from_packed(qdata, scale, group_size=64)
output = torch.nn.functional.linear(activation, weight, bias)
# In-place low-rank update with the standard Tensor.addmm_ contract.
weight.addmm_(lora_b, lora_a, alpha=lora_strength)
addmm_ computes weight = beta * weight + alpha * (mat1 @ mat2) and requantizes
the result. It preserves the ConvRot tensor and packed storage identities, allowing
offload integrations to keep their existing buffers. Repeated updates are lossy, so
reload a pristine base weight before changing or removing a previously merged adapter.
This is an inference operation and does not support autograd.
The operator selects its Triton implementation on supported CUDA devices and otherwise
uses the portable PyTorch reference. Install the tensor format and optimized backend with
piper-kernels[convrot,triton]. The base package does not require TorchAO or Triton, so
future attention-only consumers do not inherit quantization-specific dependencies.
Dependency direction
Applications such as Piper consume this package. Integrations such as torch-offload may
optionally recognize its tensor types, but piper-kernels does not depend on either
project.
Development
uv sync --dev
uv run pytest
uv run ruff check .
uv run pyright
uv build
GPU tests use the gpu pytest marker. The pre-commit test hook hides CUDA so commits run
the portable suite; run uv run pytest directly to exercise installed GPU backends.
Releases
Releases follow the compatibility and release policy in VERSIONING.md. Distribution artifacts are built from version tags and published to PyPI by GitHub Actions using Trusted Publishing; maintainers do not upload releases from local environments.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file piper_kernels-0.1.0.tar.gz.
File metadata
- Download URL: piper_kernels-0.1.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ed7eb738869353fa08c2e67637000fd5419895f1c2e9b10d21b2d245f68fcd83
|
|
| MD5 |
e4c47880b60b88b3d866c450a1aac877
|
|
| BLAKE2b-256 |
f1624cfbff5778ed2939eea0955f54e1b1c4ac2585ebd1465e4756f3c6af4046
|
Provenance
The following attestation bundles were made for piper_kernels-0.1.0.tar.gz:
Publisher:
release.yml on Boffee/piper-kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
piper_kernels-0.1.0.tar.gz -
Subject digest:
ed7eb738869353fa08c2e67637000fd5419895f1c2e9b10d21b2d245f68fcd83 - Sigstore transparency entry: 2338178561
- Sigstore integration time:
-
Permalink:
Boffee/piper-kernels@3354a000c5089e4aa39a0840aa8d81dba546acf1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Boffee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3354a000c5089e4aa39a0840aa8d81dba546acf1 -
Trigger Event:
push
-
Statement type:
File details
Details for the file piper_kernels-0.1.0-py3-none-any.whl.
File metadata
- Download URL: piper_kernels-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b785a28cc23e0dc2083c27f5b0c43035e82e88a7b7cefda25581232bdd6f35e6
|
|
| MD5 |
5f2a796e16e1fca29b8d2cd886e29525
|
|
| BLAKE2b-256 |
431a864c319922556b98f3eff007f182fa506d181575a646da3e0ec75c2b4ef0
|
Provenance
The following attestation bundles were made for piper_kernels-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Boffee/piper-kernels
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
piper_kernels-0.1.0-py3-none-any.whl -
Subject digest:
b785a28cc23e0dc2083c27f5b0c43035e82e88a7b7cefda25581232bdd6f35e6 - Sigstore transparency entry: 2338178565
- Sigstore integration time:
-
Permalink:
Boffee/piper-kernels@3354a000c5089e4aa39a0840aa8d81dba546acf1 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Boffee
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3354a000c5089e4aa39a0840aa8d81dba546acf1 -
Trigger Event:
push
-
Statement type: