Uninstall TileLang: pip removal, cache and leftovers
Uninstalling TileLang takes three steps: run pip uninstall tilelang (or pip uninstall tilelang-ascend on Ascend), clear the ~/.tilelang/cache compile cache and any build/ directory from a source build, then confirm with a failing import and an empty pip show — all while leaving CANN and torch-npu untouched.
This article follows remove → clean leftovers → verify. If you are only changing versions rather than removing TileLang, read Update TileLang first.
How do I uninstall TileLang?
Uninstalling TileLang is a single pip uninstall with the package name for your route: pip uninstall tilelang on NVIDIA, pip uninstall tilelang-ascend on Ascend (source).
- Confirm which package is installed. Run
pip show tilelangandpip show tilelang-ascend. Expect output from only one of them — that is the one to remove (source). - Read the removal list before confirming. Run
pip uninstall tilelang(ortilelang-ascend); pip lists the files it will remove before asking. Expect a list containing only TileLang's own files, with no dependencies such as torch-npu. - Confirm the removal. Type
yat the prompt, or pass-yto skip the prompt. Expect the terminal to printSuccessfully uninstalled. - Delete the environment if you installed into one. If TileLang went into a venv or conda environment that is no longer needed, deleting the whole environment is cleaner than removing packages one by one. Expect the environment directory to disappear with the system Python untouched.
What leftovers does TileLang leave, and how do I clean them?
TileLang leftovers sit in three places: the compile cache at ~/.tilelang/cache, a build/ directory from a source build, and the shell variables set_env.sh exported on Ascend (source).
- Clear the compile cache. Run
rm -rf ~/.tilelang/cache. Expect the cache directory gone, so a later install does not reuse artifacts from before the uninstall (source). - Clear source build output. If you built from a
git clone, delete thebuild/anddist/directories in that tree. Expect both the disk space and the chance of a stale artifact to be gone. - Clear shell variables. On Ascend, if you ran
export ASCEND_HOME_PATH=...manually or addedsource set_env.shto~/.bashrc, remove the extra line. Expect a new shell to reflect only what you intend — but note that CANN's own set_env.sh belongs to the Ascend toolkit, so do not delete it just because you removed TileLang. - Clear the pip cache (optional). Run
pip cache purgeto drop pip's downloaded wheel cache. Expect the download cache tied to this package to be released.
How do I confirm TileLang is fully uninstalled?
Two commands verify it: python -c "import tilelang" should raise ModuleNotFoundError, and pip show tilelang should print nothing; on Ascend repeat with tilelang-ascend (source).
- Verify it no longer imports. Run
python -c "import tilelang". ExpectModuleNotFoundError: No module named 'tilelang'; if it still imports, the package lives in another interpreter or environment. - Verify the package record is gone. Run
pip show tilelang(orpip show tilelang-ascend). Expect no output, or a message that the package is not found. - Confirm dependencies were spared. Run
python -c "import torch_npu; print(torch_npu.__version__)"and check the CANN version. Expect both to be healthy, showing the uninstall touched only what it should (source).
TileLang uninstall notes
- Do not treat CANN as a leftover. CANN is system-level and pip does not manage it; uninstalling TileLang neither needs nor should touch it, and removing CANN breaks the operator environment for the whole Ascend host.
- Judge torch-npu separately. It is a pip package, so pip may offer to remove it during an upgrade or reinstall; keep it unless you actually mean to replace it.
- Uninstalling is not the same as rolling back. To change versions, use Update TileLang; uninstalling is for a full removal or a clean restart.
- Clear the cache before reinstalling. After a clean uninstall, clear
~/.tilelang/cacheso the reinstall pays one rebuild for deterministic results.
The full path back to a working install is in Install TileLang, and the everyday commands are in TileLang command cheatsheet.
Sources: TileLang Installation Guide, tilelang-ascend · PyPI, tile-ai/tilelang-ascend GitHub repository
FAQ
Uninstalling TileLang uses pip uninstall with the package name for your route: pip uninstall tilelang on NVIDIA, or pip uninstall tilelang-ascend on Ascend. The two routes install separate packages, so removing one leaves the other in place. To wipe everything at once, uninstall inside a virtual environment and then delete the whole environment.
Uninstalling TileLang never removes CANN, because CANN is a system-level install that pip does not manage. torch-npu is a pip package though, so if you installed or upgraded it, pip may offer to remove it alongside; read the list pip prints, keep only the package you meant to drop, and leave both CANN and torch-npu in place.
TileLang leftovers live in three places: the compile cache at ~/.tilelang/cache, a build/ directory left in the source tree you built from, and the environment variables set_env.sh exported into your shell on Ascend. Delete the first two as directories, and remove the source line from your shell profile such as ~/.bashrc for the third.
Two checks confirm a clean TileLang uninstall: python -c "import tilelang" should raise ModuleNotFoundError, and pip show tilelang should print nothing. On Ascend repeat with tilelang-ascend, and confirm CANN and torch-npu kept their versions, which shows the uninstall touched only what it should have.
Uninstalling TileLang while keeping ~/.tilelang/cache will not block a reinstall, but the cached artifacts may come from the version you just removed, and a reinstall or version change that still hits them can produce unexpected results. Clear that directory before reinstalling, trading one rebuild for deterministic output.
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 separate TileLang distribution for Huawei Ascend NPUs, removed with pip uninstall tilelang-ascend; it is a different package from tilelang on the NVIDIA side.— tilelang-ascend · PyPI
- compile cache
- TileLang's compile cache lives at ~/.tilelang/cache and stores compiled kernel artifacts; delete it after an uninstall or version change so old artifacts are not reused in a new environment.— TileLang Installation Guide
- ASCEND_HOME_PATH
- ASCEND_HOME_PATH is the Ascend toolkit root variable, normally written into the shell by CANN's set_env.sh; uninstalling tilelang-ascend does not require removing it, and CANN itself stays.— tilelang-ascend · PyPI
Sources
- TileLang Installation Guide· TileLang (tile-ai)
- tilelang-ascend · PyPI· PyPI
- tile-ai/tilelang-ascend GitHub repository· GitHub