Skip to main content

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.

nano-triton

  • newt is a nano-Triton: @newt.jit kernels 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

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)

Source distribution for nano-triton 0.1.0
File Size Uploaded
nano_triton-0.1.0.tar.gz 71.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nano-triton 0.1.0
File Interpreter ABI Platform
nano_triton-0.1.0-py3-none-any.whl Python 3 none any Details

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 log

Release 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 log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release 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