Skip to main content

nbxtensor — the torch-free tensor library for inference

Run AI models without PyTorch, on any GPU Triton supports: tensors, Triton kernels, planned memory and certified tuning.

Inference first; training is not in this release.

version 0.0.9

pip install nbxtensor

On a Mac (Apple silicon, macOS 15+, Python 3.12), then install Triton for the Apple GPU (NeuroBrix's build, triton-ext):

python -m nbxtensor install-metal

Licence: Apache 2.0

GitHubGitLabPyPIDocumentation

What it is

An inference-first tensor library, torch-free. The graph and the shapes are known before the first run, so memory is planned rather than discovered, every Triton kernel declares its cost, and a repeated sequence of launches is captured and replayed. nbxtensor never imports torch; exchange goes through DLPack. NeuroBrix's Triton engine is its first client.

Backends: NVIDIA CUDA and Apple Metal (through triton-ext). Python 3.10 or later.

Fast: tensor cores back on the V100

Still running V100s? Triton leaves their tensor cores idle; nbxtensor turns them back on. On sm_70 Triton compilestl.dotto plain FMA, with no matrix instruction in the PTX. nbxtensor ships its own mma.m8n8k4 kernels for matrix products, convolution and the fused mixture-of-experts GEMM, and a kernel runs on the matrix unit only where its certificate measured it faster.

V100 kernelFMAMatrix unit
GEMM 80 x 4096 x 4096, fp160.404 ms0.191 ms (x2.1)
Fused MoE, DeepSeek-Coder-V2-Lite, 20-token gate2.49 ms0.96 ms
Fused MoE, Qwen3-30B-A3B, 512-token gate7.24 ms1.40 ms
1 x 1 convolution, fp32, video VAE shapes—x1.26 to x1.95

Kernel timings on a V100, FMA against the matrix unit inside nbxtensor, as recorded in the 0.0.1 changelog. These timings compare nbxtensor's own kernels with each other.

Faster than PyTorch on many models.

Lightweight

Lightweight: nbxtensor itself is 1 MB; the whole install, Triton included, is about 1 GB — PyTorch's is 5.6 GB.

Measured on a fresh container, Python 3.10.

Devices

Runs wherever Triton runs — NVIDIA, AMD, Intel and Apple Silicon GPUs, on Linux, Windows and macOS.

Found a bug on your hardware? Open an issue— we fix fast.

There is no CPU kernel backend in this version; host work (loading, conversions) runs on every core with numpy.

Certified tuning

Kernel settings measured once per GPU class and shipped — no autotuning at run time for the shapes we cover. We are certifying every model we can, so you never have to autotune.

Certified your GPU? Share your certificates.

Example

from nbxtensor.dtype import itemsize as I

assert I.itemsize("bfloat16") == 2
assert I.itemsize("complex64") == 8
assert I.kind("bfloat16") == "float" and I.kind("uint8") == "uint"
assert I.from_safetensors("BF16") == "bfloat16"
try:
    I.itemsize("fp8_unknown")     # a name the table does not carry is refused by name
except ValueError as e:
    assert "unknown dtype" in str(e)

From the README; every README example is run by the library's test suite.

Known limits

  • Inference only: no autograd.
  • Slicing has step 1; a strided slice is refused by name.
  • No array namespace (__array_namespace__) yet.
  • conv_transpose2d runs on the FMA kernel only (no matrix-unit path).
  • On Apple silicon, mochi-1-preview and Allegro / Allegro-TI2V do not complete on the M4 Pro yet.

Latest version Feed

v0.0.9 · 2026-11-09

All versions