Roadmap

Kernels

Scope

The GPU kernels the project proves things about: the ones in the corpus (tests/corpus) and the ones it means to add. A card is one kernel family, one source definition with all the specializations the corpus has of it, and names the TorchLean operation the kernel computes. Each card says whether what is proved covers one kernel or the family. Kernel cards climb the kernel ladder of roadmap/README.md: L1 a GPU run (a conformance test, not a proof), L2 the kernel theorem, L3 TorchLean over the reals, L4 an IEEE bound or the exact bits.

Reference: the Modular repository at commit bbc13a71 for the kernels from Modular (each card's ref names the file and line, and its quote is that line), and this repository for vector_multiply.

Cards

Open

A kernel passes L0 only with a tracked record of a GPU run of it (L1), a conformance test of the evaluator against the GPU and not a proof; STATUS.md lists the cards that have one. vadd, vmul and vsub have their L2, L3 and L4 evidence. The next kernel theorems need the block checker to take loops (the naive matmul), barriers (the reduction, the tiled matmul) and shuffles (layer norm).

Status of the cards

From roadmap/status.yaml, which the roadmap script writes from the code.

CardKindLevelEvidence above the levelNextCorpus kernels
gemv: gemv_kernel, a matrix-vector product (TorchLean.Tensor.matVecLoop)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)2
layernorm: layer_norm_gpu, the 34 row-wise layer norm specializations (TorchLean.Tensor.layerNorm)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)34
layout-mma: the layout tensor-core tests, mma_layout_tc, matmul_naive and c_fragment_kernel (TorchLean.Tensor.matmul)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)13
multistage-gemm: multistage_gemm, the tiled tensor-core GEMM with asynchronous copies (TorchLean.Tensor.matmul)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)24
naive-matmul: matmul_kernel_naive, one thread per output cell of C = A B (TorchLean.Tensor.matmul)kernelL4-top level24
reduction: sum_kernel, a block sum in shared memory with one atomic add per block (TorchLean.Tensor.sum)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)1
rms-norm: rms_norm_gpu, root mean square normalization (TorchLean.Tensor.rmsNorm)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)0
softmax: softmax_kernel, the row-wise softmax (TorchLean.Tensor.softmax)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)0
split-k-reduce: matmul split-k reduce, the sum of the partial products of a split GEMM (TorchLean.Tensor.sum)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)12
tiled-matmul: tiled_matmul_kernel, a matmul by shared-memory tiles (TorchLean.Tensor.matmul)kernelL0-L1 needs a recorded GPU run (a conformance test, not a proof)1
vadd: vector_addition, the elementwise sum of two float32 vectors (TorchLean.Tensor.add)kernelL4-top level1
vmul: vector_multiply, the elementwise product of two float32 vectors (TorchLean.Tensor.mul)kernelL4-top level1
vsub: vector_subtraction, the tutorial's elementwise difference of two float32 vectors (TorchLean.Tensor.sub)kernelL4-top level1