Building a GPU compiler from scratch: lowering PyTorch to CUDA via six IRs

NoVibeCoding · reddit · 2026-10-13

The author open-sources emmy, a GPU compiler built from scratch, with a GPUMODE lecture and article explaining concepts shared by TVM, Modular, and PyTorch Inductor. Kernel generation is broken into six passes (Torch IR → Tensor IR → Loop IR → Tile IR → Kernel IR → CUDA), each optimized for tasks like fusion or schedule enumeration. Every example is reproducible via a single compile command showing code at any IR level. On benchmarked workloads many kernels outperform Torch Inductor and cuBLAS, using tensor cores and TMA, and the compiler integrates with vLLM for end-to-end serving.

Original post →

More from Infra

Infra channel →