Install TileLang on Ascend NPU and NVIDIA CUDA

Install & Get StartedPublished 2026-10-01Author: DeepSeek Plugin Market
TileLangAscend NPUtilelang installtilelang-ascendCANNNVIDIA CUDAtorch-npu
Install TileLang on Ascend NPU or NVIDIA CUDA: prerequisites (CANN 8.3.RC1, torch-npu 2.6.0.RC1, Python 3.10, glibc 2.28), pip steps and verification.

TileLang has two install routes: NVIDIA GPUs use pip install tilelang, and Ascend NPUs use pip install tilelang-ascend. Line up the prerequisites first — on NVIDIA that means Python 3.10+, glibc 2.28, and CUDA 10.0+ (or the pip-provided cu13 toolchain); on Ascend it means CANN 8.3.RC1+, torch-npu 2.6.0.RC1+, with set_env.sh sourced.

This article covers getting TileLang into an environment and running, in the order prerequisites → routes → verification. Where the package comes from is in Download TileLang, and the day-to-day commands are in TileLang command cheatsheet.

What are the TileLang prerequisites? Ascend vs NVIDIA

TileLang requires different things per route: on NVIDIA, Python 3.10+, glibc 2.28 and a usable CUDA toolchain (10.0+, or the pip-provided cu13 build); on Ascend, CANN 8.3.RC1+, torch-npu 2.6.0.RC1+ and an active ASCEND_HOME_PATH (source, source). Check each item:

  1. Python version (both routes). Run python -V and confirm 3.10 or later. Expect Python 3.10.x or higher; if it is lower, upgrade the interpreter before any pip step.
  2. C runtime (NVIDIA). Run ldd --version to read the glibc version, which the official guide requires to be 2.28 or later (source). Expect 2.28 or higher.
  3. CUDA toolchain (NVIDIA). Confirm CUDA 10.0 or later locally, or switch to the pip-provided CUDA toolchain. Expect nvcc --version to report a version compatible with your driver; without a local toolchain, use the official pip cu13 build rather than installing nvcc yourself.
  4. CANN and torch-npu (Ascend). Confirm CANN 8.3.RC1+ and torch-npu 2.6.0.RC1+, then run source /usr/local/Ascend/ascend-toolkit/set_env.sh. Expect echo $ASCEND_HOME_PATH to print the Ascend toolkit path (source).

Use a dedicated virtual environment. On either route, install TileLang into a venv or conda environment so it does not trade blows with an existing torch version in the system Python.

How do I install TileLang on each route?

NVIDIA is a single command, pip install tilelang; Ascend installs the separate tilelang-ascend package, falling back to the official wheel or a build_wheel_ascend.sh build when offline (source, source).

  1. NVIDIA, pip install. Run pip install tilelang. Expect pip to select a matching wheel and finish with no local compilation (source).
  2. NVIDIA, source build. git clone --recursive https://github.com/tile-ai/tilelang, enter the directory, set build switches such as USE_CUDA=ON and TVM_ROOT as needed, then compile and install. Expect a build matched exactly to your local toolchain, at the cost of a longer compile and more dependencies.
  3. Ascend, pip install. Source set_env.sh to load CANN, then run pip install tilelang-ascend. Expect pip to pull the package from PyPI (source).
  4. Ascend, offline wheel or self-build. Offline, set export ASCEND_HOME_PATH=/usr/local/Ascend/ascend-toolkit/latest and run pip install tilelang-*.whl; to build it yourself, git clone --recursive https://github.com/tile-ai/tilelang-ascend, run ./build_wheel_ascend.sh [--enable-llvm], then install the artifact under dist/ (source).

The Ascend route is currently officially validated on the A2 and A3 NPU families with other models best-effort, and its backend supports both the Ascend C & PTO and AscendNPU IR routes (source).

How do I verify a TileLang install? Import, version and a GEMM example

Verify in two steps: import to see whether the interpreter finds it, then run a real GEMM to prove it compiles a kernel and computes the right result (source).

  1. Confirm import and version. Run python -c "import tilelang; print(tilelang.__version__)". Expect a printed version; ModuleNotFoundError means it landed in another interpreter, so align which python with pip -V and reinstall.
  2. Run the GEMM example. Run cd examples/gemm && python example_gemm.py. Expect the terminal to print Kernel Output Match!, proving TileLang compiles a kernel whose result matches the reference implementation (source).
  3. Confirm the hardware backend is really used. In the example script, set the tilelang.compile target to the matching backend (cuda on NVIDIA, the Ascend target on Ascend) and run it again. Expect compilation not to fall back to CPU or a pure-Python path, with the target backend named in the log.

All three passing is what a finished TileLang install means; stopping at the pip exit code just defers the problem to the first real kernel.

TileLang install notes

  1. Keep the two routes apart. tilelang and tilelang-ascend target different hardware; install only the one matching the machine, since installing both invites a module-name clash at import time.
  2. Do not skip set_env.sh on Ascend. Without an active ASCEND_HOME_PATH, pip succeeds but kernel compilation fails — the most common "installed but will not run" case on Ascend.
  3. Do not force an install on missing prerequisites. Environments below Python 3.10 or glibc 2.28 will not compile even after a successful install; fixing prerequisites first saves the later diagnosis.
  4. Do not jump to nightly for a newer version. The full upgrade, nightly and rollback procedure is in Update TileLang.

Once installed, the compile commands, performance tooling and build-time environment variables are collected in TileLang command cheatsheet; if an install goes wrong and you need to back out, start clean with Uninstall TileLang.

Sources: TileLang Installation Guide, tilelang-ascend · PyPI, tile-ai/tilelang-ascend GitHub repository

FAQ

What are the TileLang install prerequisites on Ascend NPU and NVIDIA CUDA?

TileLang needs Python 3.10 or later and glibc 2.28 or later on the NVIDIA side, plus a local CUDA toolchain at 10.0 or above (or the pip-provided cu13 toolchain). On the Ascend side it needs CANN 8.3.RC1 or later and torch-npu 2.6.0.RC1 or later, with set_env.sh sourced so ASCEND_HOME_PATH is active. When prerequisites are missing, pip still installs but kernel compilation fails.

How do I install TileLang on an NVIDIA GPU? Is pip install tilelang enough?

TileLang on NVIDIA is usually a one-liner: pip install tilelang, where pip selects a wheel matching your Python and CUDA versions. You only install from source or a wheel manually when you need to track the main branch, distribute offline, or set build switches such as USE_CUDA — and only then do local CUDA toolchain and TVM_ROOT matter.

Which TileLang package do I install for Ascend NPU, and in what order?

TileLang on Ascend NPU installs as the separate tilelang-ascend package. First confirm CANN 8.3.RC1 or later and torch-npu 2.6.0.RC1 or later, then source /usr/local/Ascend/ascend-toolkit/set_env.sh, then run pip install tilelang-ascend; air-gapped hosts use the official wheel or build_wheel_ascend.sh instead. This backend supports both the Ascend C & PTO and AscendNPU IR routes.

How do I verify a TileLang install succeeded?

The simplest TileLang check is python -c "import tilelang; print(tilelang.__version__)", which prints a version when the interpreter can find it. To prove it compiles and runs a kernel, cd into examples/gemm and run python example_gemm.py, which prints Kernel Output Match! on Ascend.

TileLang fails to install or import errors out; what should I check first?

When TileLang installs badly or import fails, check three things first: whether the interpreter is the one you think (align which python with pip -V), whether Python is below 3.10, and on Ascend whether set_env.sh was sourced. These three account for most failures and each can be ruled out in a single command.

Related Terms

TileLang
TileLang is a tile-level domain-specific language built on the TVM compiler stack and started by a Peking University team, generating high-performance GPU and NPU kernels from Python-like syntax. DeepSeek announced its Ascend edition on 2026-09-30.— TileLang Installation Guide
tilelang-ascend
tilelang-ascend is the TileLang distribution for Huawei Ascend NPUs. It requires CANN 8.3.RC1 or later and torch-npu 2.6.0.RC1 or later, and its compiler backend supports both Ascend C & PTO and AscendNPU IR.— tilelang-ascend · PyPI
CANN
CANN is Huawei's heterogeneous computing architecture for Ascend, providing the runtime and operator libraries above the NPU driver. Installing tilelang-ascend requires CANN 8.3.RC1 or later with its set_env.sh sourced.— tilelang-ascend · PyPI
ASCEND_HOME_PATH
ASCEND_HOME_PATH is the environment variable pointing at the Ascend toolkit root, typically /usr/local/Ascend/ascend-toolkit/latest, set by CANN's set_env.sh and used by the compiler to locate Ascend libraries.— tilelang-ascend · PyPI

Sources