Skip to main content

NineToothed

NineToothed Logo

Document PyPI Version License star

NineToothed is a Triton-based domain-specific language (DSL). By introducing tensor-oriented meta-programming (TOM), it makes writing high-performance GPU kernels easier.

Installation

We can use pip to install ninetoothed.

pip install ninetoothed

After successfully running the above command, ninetoothed will be installed. However, to fully utilize its capabilities, you also need to install a deep learning framework supported by ninetoothed. For trial purposes, we recommend installing torch.

Usage

Thanks to tensor-oriented meta-programming, NineToothed can be written using the arrange-and-apply paradigm, which involves separately defining arrangement, application, and tensors, and then integrating them using ninetoothed.make to generate the kernel.

Matrix Multiplication

Here is the code we need for matrix multiplication:

import ninetoothed
import ninetoothed.language as ntl
from ninetoothed import Tensor, block_size

BLOCK_SIZE_M = block_size()
BLOCK_SIZE_N = block_size()
BLOCK_SIZE_K = block_size()


def arrangement(input, other, output):
    output_arranged = output.tile((BLOCK_SIZE_M, BLOCK_SIZE_N))

    input_arranged = input.tile((BLOCK_SIZE_M, BLOCK_SIZE_K))
    input_arranged = input_arranged.tile((1, -1))
    input_arranged = input_arranged.expand((-1, output_arranged.shape[1]))
    input_arranged.dtype = input_arranged.dtype.squeeze(0)

    other_arranged = other.tile((BLOCK_SIZE_K, BLOCK_SIZE_N))
    other_arranged = other_arranged.tile((-1, 1))
    other_arranged = other_arranged.expand((output_arranged.shape[0], -1))
    other_arranged.dtype = other_arranged.dtype.squeeze(1)

    return input_arranged, other_arranged, output_arranged


def application(input, other, output):
    accumulator = ntl.zeros(output.shape, dtype=ntl.float32)

    for k in range(input.shape[0]):
        accumulator += ntl.dot(input[k], other[k])

    output = accumulator


tensors = (Tensor(2), Tensor(2), Tensor(2))

kernel = ninetoothed.make(arrangement, application, tensors)

License

This project is distributed under the Apache-2.0 license. See the included LICENSE file for details.

Metadata

Release files for ninetoothed 0.26.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 ninetoothed 0.26.0
File Size Uploaded
ninetoothed-0.26.0.tar.gz 70.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ninetoothed 0.26.0
File Interpreter ABI Platform
ninetoothed-0.26.0-py3-none-any.whl Python 3 none any Details

Total release size: 117.8 kB

Release files / ninetoothed-0.26.0.tar.gz

Download URL ninetoothed-0.26.0.tar.gz
Size 70.5 kB
Tags Source
SHA-256 checksum
How to use checksums
bb01c9ed2fc8f541ecde187f9976a62bd0370d3cbad6bc91ba6390927aa28321
BLAKE2b-256 checksum
How to use checksums
32175b0fa96254e1859be76e4a720b1449f922e2c5fab06bfafb1282124aa55b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 30, 2026.

Transparency log

Release files / ninetoothed-0.26.0-py3-none-any.whl

Download URL ninetoothed-0.26.0-py3-none-any.whl
Size 47.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7f15a35b308f00659c63508ff14f964f431234397e5dc97f73e2e4008ab51f08
BLAKE2b-256 checksum
How to use checksums
22813f083e7dc3138ac56d1fa289d5ff3e5233792693796a691c8f2c53c1a398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 30, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.26.0 This release

2 release files

0.25.0

2 release files

0.24.0

2 release files

0.23.0

2 release files

0.22.0

2 release files

0.20.0

2 release files

0.19.0

2 release files

0.16.0

2 release files

0.15.1

2 release files

0.14.0

2 release files

0.13.0

2 release files

0.10.0

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

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