TileLang (tile-lang) is a concise domain-specific language designed to streamline the development of high-performance GPU/CPU/accelerator kernels, such as GEMM, Dequant GEMM, and FlashAttention. It provides a Pythonic syntax with an underlying compiler infrastructure built on Apache TVM, allowing developers to focus on productivity while achieving state-of-the-art performance. The library is actively developed, with frequent updates and nightly builds, currently at version 0.1.8.
pip install tilelangVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to define and execute a matrix multiplication (GEMM) kernel using TileLang, integrating with PyTorch for tensor management and validation. It showcases decorators like `@tilelang.jit` and `@T.prim_func`, memory allocation with `T.alloc_shared`, data movement with `T.copy`, matrix multiplication with `T.gemm`, and loop pipelining with `T.Pipelined`.
Update calls from `tilelang.lower(...)` to `tilelang.compile(...)`.
Review the auto-tuning parameters, kernel definition, and target hardware environment. Ensure dependencies like `nvidia-cuda-nvcc` are correctly installed and meet version requirements (e.g., `>=13.0`).
Thoroughly validate kernels across various inputs and environments, including production-like setups. Monitor GitHub issues for updates and potential hotfixes related to compiler determinism.
Carefully review and test kernels that use shared buffers across multiple GEMM operations with varying transpose configurations. Consider explicit layout annotations if automatic inference proves problematic.
Migrate any usage of modules or functions from the `primitives` folder to their equivalents in the `tileop` module. Consult the latest GitHub repository for the correct paths.