All projects
Tensor mark

Tensor

Portable kernels. Small runtime.

A GPU toolkit that does not assume PyTorch or CUDA. Compile TileLang kernels into portable .tbin artifacts, then execute them with a small runtime and your hardware driver.

Version
0.1.0 (pre-1.0)
License
MIT
Language
Python 3.12
Providers
CUDA · WebGPU · CPU
How it works

Compilation and execution are separate concerns.

  1. 01

    Write

    A TileLang PrimFunc — a declarative kernel with symbolic shape ASTs and inline quant codecs.

  2. 02

    Compile

    The Tensor compiler runs CUDA and WGSL passes, searches schedules behind a numerical gate, and bundles NVRTC 12.9.

  3. 03

    Ship

    A .tbin artifact holds a verified .cubin or .wgsl plus its dependency closure, in wheels with no compiler inside.

  4. 04

    Run

    The Tensor runtime is an 8-struct C ABI with a NumPy-only Python surface across three hardware providers.

What it drops

Three assumptions other stacks make.

These are not benchmarks. They are what the code actually depends on.

No PyTorch

Tensor's core dependency is numpy==2.5.3. torch appears in exactly one optional extra, for comparison against a reference implementation. Zero import torch in either source tree.

No compiler in production

TileLang and TVM-FFI live in the compiler extra, on the build machine. What ships is data: .tbin artifacts and a tensor.lock closure.

Three providers, one contract

CUDA, WebGPU and a scoped CPU provider share one buffer and executable contract. WebGPU negotiates its own capability limits instead of extending the CUDA path.

Search, then prove

A candidate schedule only wins if assert_allclose passes against the reference. Numerical accuracy is the gate, not a heuristic or a race.

Measured

The numbers, and what they do not establish.

prepared host launch
4.20 µs

129-element pointwise · NVIDIA A10G, 30 Sep 2026

vs matched TileLang
1.92×

on the identical cubin

vs a warmed Triton JIT
4.75×

same kernel, direct C ABI path

vs a fixed TileLang schedule
0.97–1.96×

17 CUDA cases · NVIDIA L4, 24 Oct 2026

What these numbers are not

  • 4.20 µs is the direct C ABI path — host submission overhead, not model throughput. Complete calls through torch.compile measured 2.66× slower than direct TileLang.
  • Kernel latencies exclude compilation, tuning, allocation, transfers and host submission. Tuned Triton and PyTorch CUDA BLAS remain faster in several individual cases.
  • Tensor is pre-1.0. Check the compatibility notes before transferring artifacts between projects.

Every figure here comes from a study in the repository, with hardware, protocol, retained samples and limitations recorded. Read the method, not just the headline.

Quickstart

Run it locally.

The installer manages Python 3.12 and installs the runtime under ~/.tensor, without a system Python or Git.

Linux / macOS
curl -fsSL https://raw.githubusercontent.com/kreasof-ai/tensor/main/tools/install/install.sh | bash
Windows
powershell -ExecutionPolicy Bypass -c "irm https://raw.githubusercontent.com/kreasof-ai/tensor/main/tools/install/install.ps1 | iex"
First kernel
tensor build examples/elementwise.py --out build/elementwise.tbin