tnzr.org

A textbook, blogs, and apps for high-performance tensor computing.

agents
tnzr.agents
Coding agents building a tensor contraction compiler

Coding agents build a tensor contraction compiler. The workflow splits the work into scoped tasks, each judged by reviews with hidden tests. The resulting compiler runs without a language model. It is benchmarked against three baselines on GPUs and CPUs from NVIDIA, AMD, and Apple.

coding agentscompilertensorsGPUbenchmarking
compile
tnzr.compile
A bottom-up textbook on writing a tensor compiler from scratch

An online textbook guiding readers from AArch64 assembly all the way to a primitive-based tensor compiler. Covers Arm Neon and the Scalable Matrix Extension, just-in-time code generation, and real hardware.

tensorscompilerJITAArch64textbook
sme
Hello SME
Benchmarking Apple M4 using the Scalable Matrix Extension

Documents SME microbenchmarks on Apple M4 — the first publicly available silicon with SME support. Achieves 1833 GFLOPS for an FP32 GEMM, and covers JIT primitive generation and upstreaming into LIBXSMM.

SMEGEMMJITApple M4HPC
teir
TEIR
A Tiled Execution IR for tensor contractions

Describes tensor contractions through axes, tile operations, and a schedule. A deterministic optimizer transforms TEIR programs for AVX-512, Neon, and SME CPUs. The generated code is benchmarked against six baselines.

TEIRIRMLIRcompilerHPC
trn
Trainium2 Contractions
Tensor contractions on AWS Trainium2

A compiler that maps tensor contractions onto the systolic arrays of AWS Trainium2. It lowers contractions to TEIR, tiles them, and parallelizes them across NeuronCores. The generated NKI kernels are benchmarked against neuronx-cc and torch.einsum.

Trainium2NKIsystolic arraysTEIRAI
xdna
Hello XDNA
High-performance tensor kernels on AMD's XDNA NPU

Explores AMD XDNA1 and XDNA2 NPU microarchitectures and demonstrates writing tensor contraction kernels for them. Covers the VLIW ISA, BF16/BFP16 matrix instructions, and kernels reaching up to 1760 BFP16 GFLOPS.

XDNANPUVLIWHPCAI