A place to store reusable transformer components found around the interwebs
Project description
transformer_nuggets
A grab-bag of experimental transformer kernels and utilities (mostly PyTorch + Triton).
What’s in here
transformer_nuggets/flash: Triton FlashAttention experiments + masking/bias utilities.transformer_nuggets/quant: NF4 tensor subclass + QLoRA building blocks (pure PyTorch).transformer_nuggets/fp8: FP8 casting / scaled-quantization kernels (Triton). Try helion :)transformer_nuggets/cute: CUTE DSL experiments and tooling (includes an intra-kernel profiler).transformer_nuggets/misc: Odds and ends (e.g. attention wrappers, utilities).transformer_nuggets/llama: LLaMA-ish model + training/finetune scripts (research-grade).
This repository is research code: APIs are not stable and may change.
Install
You’ll need a working PyTorch install first (CPU or CUDA). Follow the official PyTorch install instructions.
To install from PyPI:
pip install transformer_nuggets
To hack on the code locally:
git clone https://github.com/drisspg/transformer_nuggets.git
cd transformer_nuggets
pip install -e .
Optional extras:
pip install "transformer_nuggets[flash]" # triton
pip install "transformer_nuggets[qlora]" # bitsandbytes (optional comparisons)
pip install "transformer_nuggets[llama]" # llama training utilities
Quick examples
Use torchao :)
FlashAttention (requires CUDA + Triton; API is experimental):
Use flex-attention :)
CUTE intra-kernel profiling (writes a Perfetto trace):
python -m transformer_nuggets.cute.profiler.example
Repo layout
transformer_nuggets/: Python package.benchmarks/: Microbenchmarks and profiling scripts.examples/: Small runnable examples.scripts/: One-off utilities.test/: PyTest suite.
Development
pip install -e ".[dev]"
pre-commit install
pytest
Project details
Release history Release notifications | RSS feed
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 transformer_nuggets-0.0.3.tar.gz.
File metadata
- Download URL: transformer_nuggets-0.0.3.tar.gz
- Upload date:
- Size: 168.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38c567defa151a158d7ea49981b005a6590a9de27e0623b25d86bbc67b43e6db
|
|
| MD5 |
1706b4b89719388ecd6abd516ee6a398
|
|
| BLAKE2b-256 |
55c36bfe31c3e8827e6a9eb48b21f9e991cdf594ad8c1eedb89d2f183c10c567
|
Provenance
The following attestation bundles were made for transformer_nuggets-0.0.3.tar.gz:
Publisher:
publish-to-pypi.yml on drisspg/transformer_nuggets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transformer_nuggets-0.0.3.tar.gz -
Subject digest:
38c567defa151a158d7ea49981b005a6590a9de27e0623b25d86bbc67b43e6db - Sigstore transparency entry: 1187064814
- Sigstore integration time:
-
Permalink:
drisspg/transformer_nuggets@6b1c32092bc1728840c31a58f0646a9ca328f62d -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/drisspg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6b1c32092bc1728840c31a58f0646a9ca328f62d -
Trigger Event:
push
-
Statement type:
File details
Details for the file transformer_nuggets-0.0.3-py3-none-any.whl.
File metadata
- Download URL: transformer_nuggets-0.0.3-py3-none-any.whl
- Upload date:
- Size: 147.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c52717236acf1ee54da8f83ff09858000aa1f441bb801484085a7ce214b57cb7
|
|
| MD5 |
ae5595a8a4bad6432a36f854492215fe
|
|
| BLAKE2b-256 |
0a8e81319757464ff2cfac8245aec0d2980cb94bb4a154997bb72cc03435e8a0
|
Provenance
The following attestation bundles were made for transformer_nuggets-0.0.3-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on drisspg/transformer_nuggets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
transformer_nuggets-0.0.3-py3-none-any.whl -
Subject digest:
c52717236acf1ee54da8f83ff09858000aa1f441bb801484085a7ce214b57cb7 - Sigstore transparency entry: 1187064840
- Sigstore integration time:
-
Permalink:
drisspg/transformer_nuggets@6b1c32092bc1728840c31a58f0646a9ca328f62d -
Branch / Tag:
refs/tags/v0.0.3 - Owner: https://github.com/drisspg
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@6b1c32092bc1728840c31a58f0646a9ca328f62d -
Trigger Event:
push
-
Statement type: