Skip to main content

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

piper_kernels-0.1.0.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

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

piper_kernels-0.1.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

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

Hashes for piper_kernels-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ed7eb738869353fa08c2e67637000fd5419895f1c2e9b10d21b2d245f68fcd83
MD5 e4c47880b60b88b3d866c450a1aac877
BLAKE2b-256 f1624cfbff5778ed2939eea0955f54e1b1c4ac2585ebd1465e4756f3c6af4046

See more details on using hashes here.

Provenance

The following attestation bundles were made for piper_kernels-0.1.0.tar.gz:

Publisher: release.yml on Boffee/piper-kernels

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

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

Hashes for piper_kernels-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b785a28cc23e0dc2083c27f5b0c43035e82e88a7b7cefda25581232bdd6f35e6
MD5 5f2a796e16e1fca29b8d2cd886e29525
BLAKE2b-256 431a864c319922556b98f3eff007f182fa506d181575a646da3e0ec75c2b4ef0

See more details on using hashes here.

Provenance

The following attestation bundles were made for piper_kernels-0.1.0-py3-none-any.whl:

Publisher: release.yml on Boffee/piper-kernels

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

Release history Release notifications | RSS feed

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

This release

0.1.0 This release

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