Write GPU and CPU cores using Python syntax
TileLang is a domain-specific language built on the TVM compiler that lets you write high-performance compute kernels in readable, Python-like code without worrying about complex hardware optimization. It is designed to let developers focus on productivity, enabling the implementation of complex operations like GEMM or FlashAttention with state-of-the-art performance without low-level tuning.
Recent updates: Ascend 950 support and LSP release
This enables native code generation, automatic scheduling, and SIMD/SIMT vector programming. On August 4 of the same month, the Language Server Protocol (LSP) implementation was open-sourced, providing inline hints for buffer shapes and data types, as well as precise diagnostics. The latest version, v0.1.13, includes source location information in multi-backend language variants and compiler diagnostics; some legacy APIs have been removed, so you should check the compatibility notes before upgrading.
Hardware optimization with Python syntax
TileLang uses Pythonic syntax but operates internally on the TVM compiler infrastructure. Developers define kernels using the @tilelang.jit decorator and express hardware operations with functions like T.Pipelined or T.gemm. The compiler transforms this code into optimized code for specific hardware. For example, when writing an FP16 GEMM kernel, developers only need to specify block sizes and pipeline stages. The compiler handles the remaining optimizations, allowing developers to focus solely on the logical structure.
Supported hardware and backends
TileLang supports NVIDIA CUDA as its primary backend, covering architectures from SM70 to SM120. AMD ROCm/HIP, Apple Metal, and Huawei Ascend 950 are also officially supported. CPU operations are experimentally supported via the LLVM backend, while WebGPU and NVIDIA CuTe DSL are in experimental stages. Other hardware, such as MetaX, Moore Threads, HYGON, and Sunrise-AI, is being developed in separate repositories as ecosystem adapters.
Installation and getting started
The latest stable version from PyPI can be installed with the pip install tilelang command. If you are using an AMD GPU, you must install the ROCm version of PyTorch before installing TileLang. Refer to the installation guide for more details on building from source, using Docker, or configuring ROCm. Nightly wheels provide the latest features but may be less stable than official releases.
Before choosing this tool
TileLang is specialized for GPU/CPU/NPU core development and is not suitable for general Python scripting or data processing tasks. You can write high-performance code without deep knowledge of hardware optimization, but using specific architecture features (such as TMA or WGMMA) requires the corresponding GPU architecture. Using Ascend 950 requires CANN and torch_npu, while the LLVM CPU backend requires LLVM 15 or higher. The project is evolving rapidly, so you may encounter compatibility issues when using specific versions. Performance benchmarks are available in the tilelang-benchmark repository, showing strong performance on various hardware including H100, A100, and MI300X.