Sankur Kundu

tessel · a tile language and compiler

one kernel, three chips.

Kernels are written against tiles, small blocks of values, and the compiler decides which thread holds which element. The same kernel compiles to CUDA for NVIDIA tensor cores, to Metal for Apple GPUs and to Pallas for TPUs, and is fast enough to run an LLM at vLLM's speed.

An 8×8 tile, colour = shared-memory bank after XOR swizzling (row ⊕ column): no two threads in a row collide.
1.00×cuBLAS on fp16 GEMM at 1024³ and 2048³; 1.04× at 4096³ (0.71× before swizzling shared memory)
1.05×vLLM 0.30's throughput serving TinyLlama-1.1B, 32 requests on a T4; generations identical
1.3–1.9×Faster than PyTorch's scaled_dot_product_attention on causal attention, sequence 512–4096
3 targetsCUDA (tested on a T4); Metal and Pallas compiled and checked in CI
01 · How it works

Layouts decide everything

Every tile gets a linear layout, as in Triton, and the code generator lowers it to the instructions each chip wants.

CUDA for tensor cores

ldmatrix, mma.sync, XOR-swizzled shared memory and software-pipelined loads, tuned on the GPU it runs on and compiled at run time with NVRTC.

Metal and Pallas

The same kernels compile to the Metal Shading Language and to Pallas, where range analysis must prove every block access in bounds or the kernel is refused.

Checked four ways

CI runs every kernel against a reference interpreter on an emulator of the CUDA execution model, compiles it with NVRTC, runs Pallas's TPU interpret mode and compiles with Apple's Metal compiler.

02 · An LLM on tessel

Token for token with vLLM

An LLM engine whose every GPU operation is a tessel kernel: fused QKV projection, rotary embeddings, a paged KV cache, grouped-query attention, SwiGLU, continuous batching, packed prefill and CUDA graphs.

TinyLlama-1.1B, 32 requests at once on a Tesla T4 (session 2; session 1: 1858 vs 1764). With 8 requests tessel reaches 0.94–0.99× vLLM. Generations identical to vLLM's.

03 · Kernels

At the speed of the vendor library

A Kaggle Tesla T4, 4 rounds of 100 launches each; every output checked against a float64 reference.

CasetesselFastest othertessel's speed
GEMM 2048³ fp160.985 mscuBLAS 0.941 ms1.00×
GEMM 4096³ fp167.381 mscuBLAS 7.357 ms1.04×
Causal attention, S = 5120.146 msSDPA 0.276 ms1.90×
Causal attention, S = 40964.416 msSDPA 6.362 ms1.44×

tessel's speed is the median, over 4 rounds, of its speed relative to the fastest other engine timed in the same round (above 1 is faster). Times are medians of each round's medians, so the columns need not divide exactly: the T4 throttles as it heats. cuBLAS is torch.matmul with fp32 accumulation, as tessel.

What tessel adds

A compiler, not a wrapper

The ideas behind Triton, rebuilt from the language up and taken to three kinds of hardware.

  1. Linear layouts, from scratch

    A typed tile IR where every tile has a linear layout, lowered to tensor-core instructions.

  2. Vendor-level GEMM

    Matches cuBLAS on fp16 GEMM after XOR swizzling and software pipelining.

  3. Portable by construction

    One kernel compiled to CUDA, Metal and Pallas, with bounds proved for TPUs.

  4. An LLM engine on top

    Serves TinyLlama at 1.05× vLLM's throughput, with identical generations.

Where it falls short

tessel has not yet been timed on a TPU or an Apple GPU: Metal and Pallas output is compiled and checked in CI, but not benchmarked. With 8 concurrent requests the LLM engine reaches 0.94–0.99× vLLM.

@software{kundu2026tessel,
  author  = {Kundu, Sankur},
  title   = {tessel: a tile language and compiler for CUDA, Metal and Pallas},
  year    = {2026},
  url     = {https://github.com/Shakhtar-Sankur/tessel},
  license = {Apache-2.0}
}
Sankur Kundu

Sankur Kundu

ML systems engineer & independent researcher · Bhubaneswar, India · sankur.kundu.tw@gmail.com

Builds the systems that train and serve language models. Also the author of lipi, a tokenizer that needs fewer tokens than GPT-4o's and Gemini's in 23 of 24 Indian languages; Babelguard, an open early-warning system for scams across languages; ratchet, RL post-training from scratch; kessler, an independent space-traffic audit that runs every day. Fixes merged into Apple's MLX, Meta's ExecuTorch, Hugging Face's OpenEnv and Oxford's PyZX, and pull requests in review at Google's JAX, NVIDIA, MIT, Carnegie Mellon and ETH Zurich.