2026-10-06 · 29 min · kernels · gpu · inference · attention
Why read this
Essentialtop 10%Reads TileLang's layout and pipeline passes, lowers its GEMM for sm_86, sm_90a and gfx942, and times num_stages against cuBLAS on a 3090.
- Runs on a consumer GPU
- Interactive explanations
- Original analysis
GPUs, kernels & systemsMITPractitioner tool
How this was scored
- Is it new?
- 2 of 3: A real new idea, method or capability
- Can I trust it?
- 2 of 3: Measures key facts from files, code or configs
- Can I run it?
- 3 of 3: Open, permissive, runs on reader hardware with instructions
- Will I understand it?
- 3 of 3: Mechanism carried by interactives built from real code or data
- Can I act on it?
- 2 of 3: A concrete recipe, numbers or comparison
- Will it last?
- 2 of 3: A reference for a year or more
- Does it affect many?
- 2 of 3: A widely used model, tool or lab release
- Only here?
- 2 of 3: A teardown or measurement few others did
Score 78 of 100, ranked 37 of 740 rated articles. Each question is answered 0–3 by hand, and a 3 is rare. How articles are scored
Everyone who optimizes models knows this loop. A paper lands with a new attention variant. To make it fast you write a fused kernel. You spend a week on indexing, shared-memory staging and pipeline depth, you finally get it correct and fast, and then someone asks for it on an AMD card, or a customer wants it on a domestic NPU, and you start over.
TileLang is an attempt to make that work reusable. It is a small language embedded in Python, built on TVM, in which you describe a kernel at the granularity of tiles: this tile of A goes to shared memory, that accumulator lives in registers, this loop is pipelined three deep. The compiler handles the rest, from layout, thread binding, vectorization, swizzling and synchronization to the instruction selection that turns your T.gemm into WGMMA or MFMA or an Ascend Cube instruction.
I first wrote this in October from the source alone: I cloned the repo at v0.1.15, read the examples and the two compiler passes that do the interesting work, and checked the paper's claims against the code. In November I went back with a GPU. I installed tilelang==0.1.15 from PyPI with uv on an RTX 3090 (driver 580, CUDA 12.8 nvcc, PyTorch 2.15), compiled the article's GEMM, read the CUDA it generated, lowered the same program for Hopper and two AMD targets without running it, and timed num_stages from 0 to 4 against cuBLAS. Those runs are mine. Every other performance number below is the paper's or the repository's, and the sentence says which.
- license
- MIT
- branch
- main
- tests
- 537 files
- source
- 19.6 MB
- commit date
- 2026-10-05
by size of tracked source at this commit, file counts in brackets; docs, data and vendored trees excluded
local clone, 2026-10-06 at 0e687c1 — branch, commit, commitDate, fileCount, hasTests, languages, license, licenseFile, shallow, testFileCount
shallow clone: counts describe the pinned tree, not the history
Why a fused attention kernel is hard to write by hand
Start from the hardware, because that is where the difficulty comes from.
A GPU gives you three places to put a number, and they differ by orders of magnitude in both size and latency: global memory (HBM, tens of gigabytes, hundreds of cycles away), shared memory (SRAM on the SM, a couple of hundred kilobytes at most, tens of cycles), and registers (fast, tiny, privately owned by one thread). A fast kernel is mostly a plan for moving tiles between those three levels so the tensor cores never wait. The paper's Figure 3 draws exactly that pyramid next to the TileLang program that expresses it:

Writing that by hand in CUDA means doing five separate jobs at once:
- Staging. Copy a tile of A and a tile of B from global into shared memory, with enough buffers in flight that the copy for iteration
k+1is already running while iterationkcomputes. On Ampere that iscp.asyncwithcommitandwaitgroups; on Hopper it is the TMA unit andmbarrierarrive/wait. - Warp specialization. On Hopper the fast kernels split the thread block into producer warps that only issue TMA loads and consumer warps that only issue
wgmma.mma_async. Now you own a hand-written producer-consumer protocol inside a kernel. - Swizzling. Shared memory has 32 banks. A naive row-major tile makes 32 threads hit the same bank and serializes the access, so you XOR the column index with a function of the row to scatter it. Get the swizzle wrong and the kernel is correct and three times too slow.
- Fragment layouts. A tensor-core instruction does not read a matrix; it reads a very specific distribution of elements across the 32 lanes of a warp. Every operand you produce has to land in registers in exactly the layout the instruction expects.
- Vectorization and thread binding. Which thread copies which bytes, and in loads of what width, so the accesses coalesce.
None of that is your algorithm. All of it has to be redone when the block size changes, the dtype changes, or the vendor changes.
The tile program
Here is the GEMM from examples/gemm/example_gemm.py, verbatim. The kernel is 22 lines, lines 5 to 26 of that file:
@tilelang.jit
def matmul(A, B, block_M, block_N, block_K, dtype=T.float16, accum_dtype=T.float32):
M, N, K = T.const("M, N, K")
A: T.Tensor((M, K), dtype)
B: T.Tensor((K, N), dtype)
C = T.empty((M, N), dtype)
with T.Kernel(T.ceildiv(N, block_N), T.ceildiv(M, block_M), threads=128) as (bx, by):
A_shared = T.alloc_shared((block_M, block_K), dtype)
B_shared = T.alloc_shared((block_K, block_N), dtype)
C_local = T.alloc_fragment((block_M, block_N), accum_dtype)
T.clear(C_local)
for k in T.Pipelined(T.ceildiv(K, block_K), num_stages=3):
T.copy(A[by * block_M, k * block_K], A_shared)
T.copy(B[k * block_K, bx * block_N], B_shared)
T.gemm(A_shared, B_shared, C_local)
T.copy(C_local, C[by * block_M, bx * block_N])
return CFive constructs carry the whole model.
T.Kernel(gridX, gridY, threads=…) opens the execution context and hands back the block indices. T.alloc_shared puts a buffer in shared memory; T.alloc_fragment puts one in the register file. Both are declared at block level: C_local is a 128x128 FP32 accumulator owned by the thread block, not by a thread, and how it is split across the 128 threads is the compiler's problem, not yours. T.copy moves a region between levels. T.gemm is a tile-level matrix multiply that the backend lowers to CUTLASS/CuTe, hand-written HIP, or an NPU Cube instruction. T.Pipelined(n, num_stages=3) says: overlap the copies with the compute, three deep.
That is the whole trick. The dataflow is explicit and the schedule is annotation.
What a tile costs, exactly
The compiler infers a great deal, but it cannot shrink your tile. num_stages multiplies the shared-memory footprint directly, because the pipeline pass versions each staged buffer. The arithmetic is simple enough to do in your head and important enough that getting it wrong is a compile error on one GPU and a silent occupancy collapse on another:
where is bytes per element (2 for FP16). For the example's defaults, block_M=128, block_N=128, block_K=32 and num_stages=3, that is 16 KB per stage and 48 KB in total. The generated kernel agrees to the byte: on the 3090 it places B_shared at offset 24,576 of the dynamic shared buffer, three 8 KB copies of the A tile after the start. The accumulator is separate and lives in registers: 128 x 128 x 4 bytes = 64 KB per block, which across 128 threads is 128 32-bit registers per thread, half the 255 a CUDA thread may hold. ptxas reports 224 registers per thread for the compiled kernel, so the fragments, addresses and loop state take the rest.
The ceiling depends on the chip. NVIDIA's tuning guides give the per-thread-block maximum as 227 KB on H100 (of 228 KB per SM), 163 KB on A100 (of 164 KB), and 99 KB on Ampere's GA102 and on Ada, so on an RTX 3090 or 4090 (of 100 KB). CUDA reserves 1 KB per block in each case. AMD's CDNA3 compute unit has 64 KB of LDS. The repository has started to hit the consumer-Blackwell version of the same wall: two commits on main (2 and 7 November) resize attention examples to "fit the sm_12x shared-memory budget".
The FlashAttention example makes the squeeze concrete. examples/flash_attention/example_mha_fwd_bshd.py runs by default with block_M=128, block_N=128, dim=128 and four shared buffers (Q, K, V and the output staging tile) at 32 KB each: 128 KB of shared memory before you count a single fragment, by my arithmetic on the declarations in that file. That fits H100 and A100 and does not fit a 4090 or an MI300X, which is why the autotune config list in the same file sweeps block_M=64, block_N=64 instead. The tile size is a portability decision, and it is the one decision TileLang deliberately leaves with you.
Layout inference: why T.gemm wins the argument
The interesting half of the compiler is the pass that decides, for every buffer, how its elements are distributed over threads.
The abstraction is a Layout: an algebraic map from logical indices to memory locations, built from TVM IterVars so that layouts compose and the arithmetic analyzer can bound them. A Fragment is a layout whose output is a pair: which thread holds the element, and where in that thread's private registers it sits. C_local in the GEMM above has no meaning until a Fragment is attached to it.
Inferring those layouts is not a local decision, because operators share buffers and they do not care equally. T.gemm cares enormously: the tensor-core instruction dictates the fragment layout of its accumulator and the swizzle of its shared inputs. An elementwise T.Parallel loop over the same buffer cares not at all. So the pass runs in priority order, and the code says so plainly. src/op/operator.h defines three levels, kFree, kCommon and kStrict, and src/transform/layout_inference/layout_inference.cc runs strict first, then a breadth-first pass at common, then relaxes to free and re-runs, then propagates layouts across aliased buffers. Strict operators pin what they need; everything downstream has to agree.
The free level is not a coin toss either. Since the paper, the pass has grown layout_cost_model.cc (present at v0.1.15, 1,201 lines on main): for each connected group of buffers it enumerates a free-mode attempt per candidate root and keeps the cheapest complete assignment. The default RegisterCountCostModel scores an attempt by total fragment register slots; an IOAwareCostModel that charges global-memory traffic is opt-in through tl.layout_cost_model="io-aware". That is a cost model for layouts, not for tiles. Nothing in the repository picks your block sizes; the autotuner still brute-forces those.
The paper's Figure 8 shows the result on the simplest possible program, a T.copy into shared memory, as it goes from block-level intent to vectorized, thread-bound, swizzled access:

You can see the swizzle in the code the 3090 actually ran. Every shared-memory store index carries terms like (((threadIdx.x & 31) >> 4) + ((threadIdx.x & 3) >> 1)) & 1) * 16. Adding two bits and keeping the low bit is an XOR, so that term flips a 16-element column group depending on the lane, which is the scatter across banks from panel (d).
This is the part that is hard to reproduce by hand, and it is also the part Triton does not let you reach into. Triton gives you block-level primitives and generates the layouts itself; TileLang exposes the layout objects, lets T.annotate_layout override the default, and still infers everything you did not specify. The paper's framing is that this is the point of the project: keep Triton's simplicity, give the expert a door.
Software pipelining, from the annotation to the ring
num_stages=3 is one integer. Turning it into a schedule is src/transform/pipeline_planning.cc and src/transform/inject_pipeline.cc, 1,360 and 4,237 lines on main today.
The planner reads the loop body as a list of statements and works out which ones are copies and which consume them. Then it assigns each statement an order (its position within an iteration) and a stage (how many iterations behind the first stage it runs). The first pass is mechanical: every non-copy statement gets the next order and stage num_stages, and the copies it consumes are placed right after it at stage 0. For our loop that gives gemm (order 0, stage 3), copy A (1, 0), copy B (2, 0). Then comes a rewrite. If every copy ends up after every compute in the order, and num_stages is at least 2, the pass rotates the copies to the front and decrements the stage of everything else: copy A (0, 0), copy B (1, 0), gemm (2, 2). Same overlap, one stage shallower. The paper's Figure 11 is the idea in pictures:

Buffer versioning follows from the schedule rather than from the annotation. ComputeBufferVersions in inject_pipeline.cc starts from use - def + 1 (the reader's stage minus the writer's, plus one) as an upper bound. It then decrements that bound when no writer runs earlier than a reader of the same buffer in both order and stage. Work it through and the two cases come apart. With num_stages >= 2 the copies sit at order 0 and 1, stage 0, and the GEMM at order 2, stage n - 1, so the condition holds and every buffer gets n versions. With num_stages = 1 the rotation does not fire, the GEMM keeps order 0 while the copies sit at 1 and 2, the bound of 2 is decremented, and you get one buffer: the next tile's copy is issued after the current tile's GEMM, with nothing to overlap. The widget plays both out:
The timeline in the widget is a single-block toy: one GEMM step is one unit, a copy takes L units to land, and a copy may start only once the slot it overwrites has been read. Under those rules the loop settles at one iteration every max(1, (L + 1) / versions) units, so the tensor cores stop waiting once you have at least L + 1 versions. The schedule table above it is not a toy; it is what the pass emits for this loop.
Now the part the README does not advertise. The same planner contains an explicit early-out: on ROCm targets other than gfx950, a loop annotated with num_stages has the annotation stripped and runs as a plain sequential loop. The comment is unusually candid: gfx942, which is MI300X, has async-copy hardware, but the software pipeline for it "has not been validated yet", and RDNA has no async copy at all. That early-out is still on main today, 204 commits after the release.
What the compiler emitted
Reading the pass tells you what it intends. Lowering the program tells you what you get. I compiled the GEMM above on the 3090 at M = N = K = 4096 and lowered the identical tile program for three other targets with tilelang.lower, which generates device source without needing that device. Five lowerings, one source file:
| Target | num_stages | Shared-buffer layout | Copy mechanism | Math instruction | Threads |
|---|---|---|---|---|---|
sm_86 (RTX 3090) | 3 | 3 slots of A, 3 of B, 48 KB | cp.async, wait<2> | ldmatrix + mma.sync m16n8k16 | 128 |
sm_86 | 1 | 1 slot each, 16 KB | cp.async for k + 1 issued after GEMM k, wait<0> | same | 128 |
sm_90a (Hopper) | 3 | 3 slots each, 48 KB, 6 mbarriers | TMA, producer warpgroup | wgmma 64x128x16 | 256 |
gfx942 (MI300X) | 3 | 1 slot each, 16 KB | plain 16-byte loads, no async | MFMA 16x16x16 | 128 |
gfx950 (MI350) | 3 | 3 slots each, 48 KB | async copy, wait<2> | MFMA 16x16x16 | 128 |
Here is the 3090 kernel, abridged: I replaced the index arithmetic with comments and collapsed the repeated loops, and kept every synchronization call and every offset as generated.
// generated by TileLang 0.1.15 for sm_86, num_stages=3, M=N=K=4096 (abridged)
extern "C" __global__ void __launch_bounds__(128, 1) matmul_kernel(
const half_t* __restrict__ A, const half_t* __restrict__ B, half_t* __restrict__ C) {
extern __shared__ __align__(1024) uchar buf_dyn_shmem[];
void* A_shared = ((void*)((char*)buf_dyn_shmem + 0));
void* B_shared = ((void*)((char*)buf_dyn_shmem + 24576)); // after 3 x 8 KB of A
float C_local[128]; // 64 KB of FP32 over 128 threads
// ... zero C_local ...
// prologue: tiles 0 and 1 go in flight
for (int i_1 = 0; i_1 < 4; ++i_1) tl::cp_async_gs<16>(/* A_shared, swizzled */, /* A */);
for (int i_2 = 0; i_2 < 4; ++i_2) tl::cp_async_gs<16>(/* B_shared, swizzled */, /* B */);
tl::cp_async_commit();
// ... the same for tile 1 at slot offset 4096 ...
tl::cp_async_commit();
for (int k = 0; k < 126; ++k) {
__syncthreads();
// issue tile k + 2 into slot (k + 2) % 3
// ... tl::cp_async_gs<16>(&A_shared[((k + 2) % 3) * 4096 + ...], ...) x 4, same for B ...
tl::cp_async_commit();
tl::cp_async_wait<2>(); // tile k has landed; k + 1 and k + 2 may still be in flight
__syncthreads();
// compute on slot k % 3
for (int ki = 0; ki < 2; ++ki) {
// ... tl::ptx_ldmatrix_x4(&A_shared[(k % 3) * 4096 + ...]) x 4
// ... tl::ptx_ldmatrix_x4_trans(&B_shared[(k % 3) * 4096 + ...]) x 4
// ... 32 x tl::mma_sync<kFloat16, kFloat16, kFloat32, 16, 8, 16, false, true>(...)
}
}
tl::cp_async_wait<1>(); // ... compute tile 126 ...
tl::cp_async_wait<0>(); // ... compute tile 127 ...
// ... convert C_local to half and store 64 x 4 bytes per thread ...
}That is a textbook multistage Ampere GEMM: 128 tiles along K, a prologue of two, a steady state of 126 that issues k + 2 while computing k, and an epilogue of two that drains the ring with wait<1> and wait<0>. Nothing in the 22-line source mentions any of it.
The Hopper lowering is the surprise. The source says threads=128; the kernel comes back with __launch_bounds__(256, 1). The compiler added a whole producer warpgroup, gave it 24 registers per thread with warpgroup_reg_dealloc<24>, and handed the consumers 240 with warpgroup_reg_alloc<240>:
// generated by TileLang 0.1.15 for sm_90a, num_stages=3 (abridged)
__shared__ __align__(16) uint64_t mbarrier_mem[6]; // 3 "tile landed", 3 "slot free"
if (((int)threadIdx.x) < 128) { // producer warpgroup, added by the compiler
tl::warpgroup_reg_dealloc<24>();
for (int k = 0; k < 128; ++k) {
mbarrier[((k % 3) + 3)].wait((((k % 6) / 3) ^ 1)); // wait until slot k % 3 is free
if (tl::tl_shuffle_elect<128>()) {
mbarrier[(k % 3)].expect_transaction(8192);
tl::tma_load(A_desc, mbarrier[(k % 3)], /* A_shared slot k % 3 */, (k * 32), (blockIdx.y * 128));
// ... arrive_and_expect_tx, then two TMA loads for the B tile ...
}
}
} else { // the 128 threads the source asked for
tl::warpgroup_reg_alloc<240>();
for (int k_1 = 0; k_1 < 128; ++k_1) {
mbarrier[(k_1 % 3)].wait(((k_1 % 6) / 3)); // wait for tile k_1
// ... 4 x tl::wgmma_ss<kFloat16, kFloat16, kFloat32, 64, 128, 16, ...>(desc_a, desc_b, C_local, 1)
mbarrier[((k_1 % 3) + 3)].arrive(); // release the slot to the producer
}
}That is the producer-consumer protocol from the list at the top of this article, generated from the same num_stages=3. The release notes describe a newer opt-in, TL_ENABLE_AUTO_WARP_SPECIALIZATION: "role_based", that assigns TMA loads, MMA, TMA stores and worker ops to warp groups for more complex kernels; for a plain GEMM, the default path already splits the block.
And the MI300X lowering confirms the early-out from the outside. With num_stages=3 in the source, the gfx942 kernel has one 8 KB slot per operand, a single for (int k = 0; k < 128; ++k) whose body does __syncthreads(), then 16-byte loads straight from global into shared, then MFMA. No prefetch, no ring. The same program for gfx950 gets the three-slot async ring back. If you benchmark TileLang on MI300X today, you are benchmarking it without software pipelining, whatever your kernel says.
Does num_stages matter on a 3090?
I timed the GEMM with num_stages from 0 to 4 against torch.matmul (cuBLAS) at two sizes on the 3090, FP16 inputs and FP32 accumulation, 128x128x32 tiles. Each number is the median of seven trials of 20 back-to-back launches, with the variants interleaved inside each trial so that clock and thermal drift hit all of them alike. The GPU was otherwise idle when the run started. Every output was finite and bit-identical to cuBLAS's: the largest absolute difference over the 67 million entries of the 8192-cubed product was zero, with a mean magnitude of 72.2.
| Kernel | 4096³ (ms) | TFLOP/s | 8192³ (ms) | TFLOP/s |
|---|---|---|---|---|
cuBLAS (torch.matmul) | 1.976 | 69.6 | 15.268 | 72.0 |
TileLang, num_stages=0 | 2.121 | 64.8 | 17.178 | 64.0 |
TileLang, num_stages=1 | 1.902 | 72.3 | 15.298 | 71.9 |
TileLang, num_stages=2 | 1.895 | 72.5 | 15.389 | 71.4 |
TileLang, num_stages=3 | 1.921 | 71.5 | 15.301 | 71.9 |
TileLang, num_stages=4 | 2.134 | 64.4 | 16.760 | 65.6 |
A 22-line kernel matches cuBLAS on this card: 1.03x at 4096 cubed and 1.00x at 8192 cubed for the default three stages. The paper reports 1.10x over cuBLAS on an RTX 4090, so on a 3090 I see parity, not a win.
One, two and three stages are within 1.5% of each other, which the single-block widget would not predict. My best explanation is occupancy, from the compiled kernels' own numbers. ptxas reports 214 to 224 registers per thread, so 128 threads take about 28,000 of the SM's 65,536 registers and two blocks fit. Two blocks also fit in shared memory up to three stages (2 x 49 KB, counting CUDA's reserved kilobyte, is under GA102's 100 KB). With two resident blocks, one block's copies can hide behind the other block's math whether or not the block pipelines itself.
num_stages=0 lowers to synchronous loads with no cp.async at all and costs about 10%. num_stages=4 needs 64 KB per block, so only one block fits per SM, and it loses a similar 10%. I tried to isolate that by shrinking block_K to 16, which halves the tile so that four stages take 32 KB and two blocks fit again. It did not separate the causes: at 8192 cubed the 16-deep tile ran at 66.8 to 67.1 TFLOP/s with 2, 4 or 6 stages alike, against 71.1 for the default tile in the same run, so the thinner tile costs about 6% on its own. Occupancy fits the data; I have not proved it. What the table does show is that deeper is not better: the right depth is the shallowest one that covers your copy latency at the occupancy you can afford, and on a card with 100 KB of shared memory that is a small number.
FlashAttention, in tiles
The attention kernel is where the abstraction earns its keep, because the inner loop is not one matrix multiply but two with an online softmax between them. This is the body of example_mha_fwd_bshd.py, lightly trimmed:
for k in T.Pipelined(loop_range, num_stages=num_stages):
T.copy(K[bz, k * block_N : (k + 1) * block_N, by, :], K_shared)
T.gemm(Q_shared, K_shared, acc_s, transpose_B=True, policy=T.GemmWarpPolicy.FullRow)
T.copy(scores_max, scores_max_prev)
T.fill(scores_max, -T.infinity(accum_dtype))
T.reduce_max(acc_s, scores_max, dim=1, clear=False)
for i in T.Parallel(block_M):
scores_scale[i] = T.exp2(scores_max_prev[i] * scale - scores_max[i] * scale)
for i, j in T.Parallel(block_M, block_N):
acc_s[i, j] = T.exp2(acc_s[i, j] * scale - scores_max[i] * scale)
T.reduce_sum(acc_s, scores_sum, dim=1)
for i in T.Parallel(block_M):
logsum[i] = logsum[i] * scores_scale[i] + scores_sum[i]
for i, j in T.Parallel(block_M, dim):
acc_o[i, j] *= scores_scale[i]
T.copy(V[bz, k * block_N : (k + 1) * block_N, by, :], V_shared)
T.gemm(acc_s_cast, V_shared, acc_o, policy=T.GemmWarpPolicy.FullRow)Read it as the algorithm and nothing else: score the query block against this key block, track the running row maximum, rescale the accumulator by the ratio between the old and new maxima, accumulate the exponentials, multiply by V. The scale constant folds log2(e) into the softmax so the kernel can use exp2, which maps to a single hardware instruction. There is no cp.async, no mbarrier, no swizzle, no fragment layout, no producer-consumer split in this listing, and the GEMM lowering above shows where each of them comes from. The one knob that changes the pipeline is num_stages.
Compare with FlashAttention-3, where that same asynchrony is hand-built in CUTLASS templates. The trade is the usual one: the template library is faster at the shapes it was tuned for and harder to move.
The paper's numbers, and the repository's newer ones
The paper (arXiv 2504.17577v2, April 2025) measures on H100 with CUDA 12.4, A100, and MI300X with ROCm 6.1.0. None of the following is mine.

On multi-head attention the paper reports speedups of 1.36x over FlashAttention-3, 1.41x over Triton and 1.70x over PyTorch, with the caveat attached: FlashAttention-3's fixed tile sizes hurt it at short sequences, and at 8k the two are close. On the Mamba-2 chunk-scan and chunk-state kernels it reports 1.77x and 2.10x over Triton.
On plain FP16 GEMM, TileLang lands on top of the vendor libraries rather than beating them: 1.10x, 0.97x, 1.00x and 1.04x versus cuBLAS/rocBLAS on RTX 4090, A100, H100 and MI300X, and 1.08x, 1.03x, 1.13x, 1.25x versus Triton on the same four. My 3090 run sits in the same place. Matching cuBLAS from a 22-line Python kernel is the claim, not beating it. The MI300X figure deserves a footnote now: whatever the paper's kernels did in April 2025, the v0.1.15 compiler does not pipeline on that chip.
The headline is multi-head latent attention, plotted against lines of code:

1075.9x over Torch on H100 in about 70 lines of Python, reaching 98% of hand-written FlashMLA (480 lines); on MI300X, 129.2x over Torch and 95% of AITER. Torch at 1.0x is an unfused reference, so the four-digit number is a statement about fusion, not about TileLang versus a serious baseline. The comparisons that matter are the 98% and the 95%. For dequantized GEMM the paper reports a maximum 7.65x over cuBLAS FP16 (at INT2 weights with INT8 activations), 1.04x average over Marlin at INT4 weights with FP16 activations, and 1.62x over BitsandBytes at NF4.
The paper's shapes are listed in its appendix (batch 1, 32 heads, head dim 128, sequence 512 to 4096 for attention), narrow enough that "state of the art" means "on these shapes". The repository has since added its own benchmark pages with newer baselines. benchmark/matmul/README.md records FP16 GEMM at M = N = 8192 on an H800 SXM, rising from 386 TFLOP/s at K = 256 to 766 TFLOP/s at K = 16384. benchmark/mamba2/README.md records the chunk-scan kernel at 126.5 to 135.7 TFLOP/s for sequence lengths from 1,024 to 32,768, and compares it with Triton 3.5.0 and Helion 0.2.1:

Those pages are the project measuring itself, on one machine, at pinned commits (17bd0a6 for the GEMM, 8a5eb56 for Mamba-2). They are useful as a floor for what the current compiler produces, and they say nothing about cuBLAS or FlashAttention on the same box.
Triton, CuTe, and where this sits
Against Triton, the paper's argument is specific rather than rhetorical: Triton hides thread behaviour, memory layout and address-space annotations behind generated strategies. That is fine until you want a quantized GEMM that needs inline PTX for vectorized dtype conversion and a custom shared-memory layout. Triton exposes num_stages but not the pipeline itself. TileLang exposes both, plus T.annotate_layout and T.ptx.
Against CuTe the relationship is stranger, because TileLang both uses it and routes around it. The default T.gemm lowers through CUTLASS/CuTe-style templates, which is how new hardware instructions get supported quickly; you can see it in the generated code above, where the math is tl::mma_sync<…> and tl::wgmma_ss<…> from TileLang's own tl_templates headers. The cost is measured in the paper with NVCC 12.8's trace tool: template expansion is roughly 90% of compile time for the CUDA that TileLang generates. On the 3090 each GEMM variant took two to four seconds to compile. So the project also supports implementing instructions in TileLang itself, which avoids the layout opacity and the compile time but means reimplementing an instruction set per target. Both paths ship; the template path is the default. CuTe DSL is meanwhile also a TileLang backend (target="cutedsl", experimental).
Multi-backend, and the Ascend 950 release
The thing the X post was reacting to is v0.1.15, released 30 September 2026, whose headline is a native Huawei Ascend 950 backend: a target ascend with its own dialect, native code generation, automatic Cube/Vector scheduling, pipelining and multi-buffering, and automatic synchronization, which is the line that matters for anyone who has written Ascend C. The backend README's division of labour is blunt about it: under "Synchronization" the column for what you write says "None (Just write operations in order!)", while the compiler infers Cube/Vector dependencies and inserts paired set/wait flags.

On compute-bound GEMM the two are close (425.8 against 413.0 TFLOP/s at 4K cubed; 431.4 against 426.3 at 8K cubed), and on GQA backward too (420.0 against 397.4 TFLOP/s). The gap opens on the memory-bound FP8 cast, where the README's chart has TileLang at 3041.8 GB/s against Torch NPU's 637.4 at 4K x 4K: a fused, well-pipelined copy against a library op that is not.
The same release adds the role-based warp specialization above, unified T.gemm_blockscaled semantics across backends, and Python compile-time comprehensions in the frontend. The backend table now runs CUDA (primary), ROCm, Ascend 950 and Metal (supported), LLVM CPU, CuTe DSL and WebGPU (experimental), plus five ecosystem adapters maintained in separate repos. About a quarter of the 204 commits on main since the release (52, going by their titles) are Ascend or PTO work. That breadth is the project's real bet, and it is the same bet DeepSeek made when it ported its own kernels in DeepGEMM-Ascend, except that TileLang is trying to make the port a backend rather than a rewrite.
What it costs
A few things to know before you adopt it.
The licence is MIT with an unusual addendum: the file states that from 1 December 2024 to 14 March 2025 the project was subject to additional collaboration terms with Microsoft. GitHub's licence detector therefore reports it as "Other" rather than MIT, and still did when I queried the API on 13 November. It is almost certainly fine; it is also not a plain MIT badge, and if your legal review greps for one, it will not find it.
The project moves fast and the surface is wide: 8,955 stars, 985 forks and 588 open issues on 13 November 2026, by the GitHub API, up from 8,434, 853 and 438 when I first wrote this five weeks earlier. There is no v0.1.16 yet. A monthly release cadence that removes legacy APIs (v0.1.13's notes say so explicitly) is a maintenance cost you inherit. The install itself is easy; uv pip install tilelang==0.1.15 pulled a prebuilt wheel and compiled kernels against the system's CUDA 12.8 nvcc without complaint.
The automation has holes, and they are documented in the source rather than the README: no pipelining on MI300X, T.gemm leaning on templates for its default path, and a cost model that ranks layouts but not tiles. Nothing chooses your tile sizes for you; that is what the autotuner brute-forces, and the 3090 table shows why you want it to: the best depth was not the default.
And the thing I like most about it is not in the benchmarks. A language server shipped in August with inlay hints for buffer shapes, dtypes, scopes and inferred layouts. When the compiler is making the decisions, being able to see the decision it made, in the editor, on the line where you allocated the buffer, is the difference between a tool you can debug and a black box you can only benchmark. Reading the generated kernels for this update was the same lesson at a larger scale: the 22 lines are pleasant, and the 136 lines they turn into are where you find out what your target actually does. Related reading on the same theme: CUDA kernels in Rust and the linear attention state roundup, which uses TileLang kernels as its reference points.
What I ran and what I read
Ran, on an RTX 3090 with tilelang==0.1.15: the GEMM compiled and timed at 4096 and 8192 cubed for num_stages 0 to 4 against torch.matmul, and a second run at 8192 cubed with block_K=16 at 2, 4 and 6 stages (another job held about 9 GB of the card's memory during that one); tilelang.lower for sm_90a, gfx942 and gfx950 (source only, nothing executed on those targets); ptxas --resource-usage on the sm_86 kernels. Read: pipeline_planning.cc, inject_pipeline.cc, layout_inference.cc and layout_cost_model.cc at v0.1.15 and on main (commit d2dbf20), the examples, the benchmark READMEs, the release notes and the paper. Not checked: anything on Hopper, AMD or Ascend hardware, and the FlashAttention and MLA numbers.