nano-triton
A from-scratch nano-Triton (newt) and nano-Helion (deuteron): the modern
GPU-kernel DSL stack, rebuilt in ~4,000 lines of readable Python, reaching
memory-bandwidth parity with real Triton and 80%+ of its tensor-core matmul
throughput. No dependencies beyond torch.
- newt is a nano-Triton:
@newt.jitkernels compile Python AST to CUDA C++ to NVRTC to a cubin, launched through the raw CUDA driver API via ctypes. No MLIR, no LLVM, no nvcc. - deuteron is a nano-Helion: write PyTorch-like tile code with no kernel details; it generates a newt kernel and autotunes it against an eager-PyTorch correctness oracle.
Install
pip install nano-triton
Requires torch and an NVIDIA GPU with the CUDA toolkit (newt uses NVRTC to
compile kernels at runtime). Installing the package gives you both import newt
and import deuteron.
Quick start
import torch
import newt
import newt.language as nl
@newt.jit
def add_kernel(x_ptr, y_ptr, out_ptr, n, BLOCK: nl.constexpr):
pid = nl.program_id(0)
offs = pid * BLOCK + nl.arange(0, BLOCK)
mask = offs < n
x = nl.load(x_ptr + offs, mask=mask)
y = nl.load(y_ptr + offs, mask=mask)
nl.store(out_ptr + offs, x + y, mask=mask)
x, y = torch.randn(2, 1_000_000, device="cuda")
out = torch.empty_like(x)
add_kernel[lambda m: (newt.cdiv(1_000_000, m["BLOCK"]),)](
x, y, out, 1_000_000, BLOCK=1024)
Benchmarks
RTX PRO 5000 Blackwell laptop GPU, same kernel source and tuning sweep for newt and real Triton. fp16 tensor-core matmul, sustained same-run medians:
| TFLOP/s | 1024 | 2048 | 4096 | 8192 |
|---|---|---|---|---|
| nano-triton | 67 | 83 | 82 | 77 |
| triton | 81 | 101 | 119 | 101 |
That is 76 to 83 percent of Triton sustained, and about 92 percent cold. Memory-bound kernels (softmax, layernorm, elementwise) match Triton at the memory-bandwidth ceiling.
Docs and source
- Full writeup, from-zero explainer, benchmarks, glossary: https://arpitsinghgautam.me/nano-triton/
- Source and issues: https://github.com/arpitsinghgautam/nano-triton
MIT licensed.
Metadata
Release files for nano-triton 0.1.0
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 |
|---|---|---|---|---|
| nano_triton-0.1.0.tar.gz | 71.1 kB | With provenance | Details for nano_triton-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nano_triton-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nano_triton-0.1.0-py3-none-any.whl |
Total release size: 127.4 kB
Release files / nano_triton-0.1.0.tar.gz
| Download URL | nano_triton-0.1.0.tar.gz |
|---|---|
| Size | 71.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f280ac980b2c04924f5d205bf56f11937df43c827b6feffd760402a657e376e3
|
|
BLAKE2b-256 checksum How to use checksums |
d3ba51f72af85d7e7f1a569e66eeec3d5d9d39267abda712f47ed0d5e7d7ea65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 25, 2026.
Transparency logRelease files / nano_triton-0.1.0-py3-none-any.whl
| Download URL | nano_triton-0.1.0-py3-none-any.whl |
|---|---|
| Size | 56.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f30a8735024324a989adbb403692732898c9bae8120234c1c958626018a54d05
|
|
BLAKE2b-256 checksum How to use checksums |
00f128dab8e8218205da74967eac204d4030109800231ea6cd91336c29376340
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
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 Jul 25, 2026.
Transparency logSecurity for nano-triton 0.1.0
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 nano_triton-0.1.0.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 Jul 25, 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.