Skip to content

Commit e30f764

Browse files
Update docs
1 parent 3497bda commit e30f764

File tree

5 files changed

+97
-185
lines changed

5 files changed

+97
-185
lines changed

_sources/get_started/Installation.md.txt

Lines changed: 42 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,25 @@
88
- **Python Version**: >= 3.8
99
- **CUDA Version**: 12.0 <= CUDA < 13
1010

11-
The easiest way to install **tile-lang** is directly from PyPI using pip. To install the latest version, run the following command in your terminal:
11+
The easiest way to install tilelang is directly from PyPI using pip. To install the latest version, run the following command in your terminal:
1212

1313
```bash
1414
pip install tilelang
1515
```
1616

17-
Alternatively, you may choose to install **tile-lang** using prebuilt packages available on the Release Page:
17+
Alternatively, you may choose to install tilelang using prebuilt packages available on the Release Page:
1818

1919
```bash
2020
pip install tilelang-0.0.0.dev0+ubuntu.20.4.cu120-py3-none-any.whl
2121
```
2222

23-
To install the latest version of **tile-lang** from the GitHub repository, you can run the following command:
23+
To install the latest version of tilelang from the GitHub repository, you can run the following command:
2424

2525
```bash
2626
pip install git+https://github.com/tile-ai/tilelang.git
2727
```
2828

29-
After installing **tile-lang**, you can verify the installation by running:
29+
After installing tilelang, you can verify the installation by running:
3030

3131
```bash
3232
python -c "import tilelang; print(tilelang.__version__)"
@@ -40,31 +40,37 @@ python -c "import tilelang; print(tilelang.__version__)"
4040
- **Python Version**: >= 3.8
4141
- **CUDA Version**: >= 10.0
4242

43-
```bash
44-
docker run -it --rm --ipc=host nvcr.io/nvidia/pytorch:23.01-py3
45-
```
43+
If you prefer Docker, please skip to the [Install Using Docker](#install-using-docker) section. This section focuses on building from source on a native Linux environment.
4644

47-
To build and install **tile-lang** directly from source, follow these steps. This process requires certain pre-requisites from Apache TVM, which can be installed on Ubuntu/Debian-based systems using the following commands:
45+
First, install the OS-level prerequisites on Ubuntu/Debian-based systems using the following commands:
4846

4947
```bash
5048
apt-get update
5149
apt-get install -y python3 python3-dev python3-setuptools gcc zlib1g-dev build-essential cmake libedit-dev
5250
```
5351

54-
After installing the prerequisites, you can clone the **tile-lang** repository and install it using pip:
52+
Then, clone the tilelang repository and install it using pip. The `-v` flag enables verbose output during the build process.
53+
54+
> **Note**: Use the `--recursive` flag to include necessary submodules. Tilelang currently depends on a customized version of TVM, which is included as a submodule. If you prefer [Building with Existing TVM Installation](#using-existing-tvm), you can skip cloning the TVM submodule (but still need other dependencies).
5555

5656
```bash
5757
git clone --recursive https://github.com/tile-ai/tilelang.git
5858
cd tilelang
5959
pip install . -v
6060
```
6161

62-
If you want to install **tile-lang** in development mode, you can run the following command:
62+
If you want to install tilelang in development mode, you can use the `-e` flag so that any changes to the Python files will be reflected immediately without reinstallation.
6363

6464
```bash
6565
pip install -e . -v
6666
```
6767

68+
> **Note**: changes to C++ files require rebuilding the tilelang C++ library. See [Faster Rebuild for Developers](#faster-rebuild-for-developers) below. A default `build` directory will be created if you use `pip install`, so you can also directly run `make` in the `build` directory to rebuild it as [Working from Source via PYTHONPATH](#working-from-source-via-pythonpath) suggested below.
69+
70+
(working-from-source-via-pythonpath)=
71+
72+
### Working from Source via `PYTHONPATH`
73+
6874
If you prefer to work directly from the source tree via `PYTHONPATH`, make sure the native extension is built first:
6975

7076
```bash
@@ -85,17 +91,21 @@ Some useful CMake options you can toggle while configuring:
8591
- `-DUSE_ROCM=ON` selects ROCm support when building on AMD GPUs.
8692
- `-DNO_VERSION_LABEL=ON` disables the backend/git suffix in `tilelang.__version__`.
8793

88-
We currently provide four methods to install **tile-lang**:
94+
(using-existing-tvm)=
8995

90-
1. [Install Using Docker](#install-method-1) (Recommended)
91-
2. [Install from Source (using the bundled TVM submodule)](#install-method-2)
92-
3. [Install from Source (using your own TVM installation)](#install-method-3)
96+
### Building with Existing TVM Installation
9397

94-
(install-method-1)=
98+
If you already have a compatible TVM installation, use the `TVM_ROOT` environment variable to specify the location of your existing TVM repository when building tilelang:
9599

96-
### Method 1: Install Using Docker (Recommended)
100+
```bash
101+
TVM_ROOT=<your-tvm-repo> pip install . -v
102+
```
103+
104+
(install-using-docker)=
97105

98-
For users who prefer a containerized environment with all dependencies pre-configured, **tile-lang** provides Docker images for different CUDA versions. This method is particularly useful for ensuring consistent environments across different systems and is the **recommended approach** for most users.
106+
## Install Using Docker
107+
108+
For users who prefer a containerized environment with all dependencies pre-configured, tilelang provides Docker images for different CUDA versions. This method is particularly useful for ensuring consistent environments across different systems.
99109

100110
**Prerequisites:**
101111
- Docker installed on your system
@@ -142,82 +152,17 @@ docker run -itd \
142152
- `--name tilelang_b200`: Assigns a name to the container for easy management
143153
- `/bin/zsh`: Uses zsh as the default shell
144154

145-
4. **Access the Container**:
155+
4. **Access the Container and Verify Installation**:
146156

147157
```bash
148158
docker exec -it tilelang_b200 /bin/zsh
149-
```
150-
151-
5. **Verify Installation**:
152-
153-
Once inside the container, verify that **tile-lang** is working correctly:
154-
155-
```bash
159+
# Inside the container:
156160
python -c "import tilelang; print(tilelang.__version__)"
157161
```
158162

159-
You can now run TileLang examples and develop your applications within the containerized environment. The Docker image comes with all necessary dependencies pre-installed, including CUDA toolkit, TVM, and TileLang itself.
160-
161-
**Example Usage:**
162-
163-
After accessing the container, you can run TileLang examples:
164-
165-
```bash
166-
cd /home/tilelang/examples
167-
python elementwise/test_example_elementwise.py
168-
```
169-
170-
This Docker-based installation method provides a complete, isolated environment that works seamlessly on systems with compatible NVIDIA GPUs like the B200, ensuring optimal performance for TileLang applications.
171-
172-
(install-method-2)=
173-
174-
### Method 2: Install from Source (Using the Bundled TVM Submodule)
175-
176-
If you already have a compatible TVM installation, follow these steps:
177-
178-
1. **Clone the Repository**:
179-
180-
```bash
181-
git clone --recursive https://github.com/tile-ai/tilelang
182-
cd tilelang
183-
```
184-
185-
**Note**: Use the `--recursive` flag to include necessary submodules.
186-
187-
2. **Configure Build Options**:
188-
189-
Create a build directory and specify your existing TVM path:
190-
191-
```bash
192-
pip install . -v
193-
```
194-
195-
(install-method-3)=
196-
197-
### Method 3: Install from Source (Using Your Own TVM Installation)
198-
199-
If you prefer to use the built-in TVM version, follow these instructions:
200-
201-
1. **Clone the Repository**:
202-
203-
```bash
204-
git clone --recursive https://github.com/tile-ai/tilelang
205-
cd tilelang
206-
```
207-
208-
**Note**: Ensure the `--recursive` flag is included to fetch submodules.
209-
210-
2. **Configure Build Options**:
211-
212-
Copy the configuration file and enable the desired backends (e.g., LLVM and CUDA):
213-
214-
```bash
215-
TVM_ROOT=<your-tvm-repo> pip install . -v
216-
```
217-
218163
## Install with Nightly Version
219164

220-
For users who want access to the latest features and improvements before official releases, we provide nightly builds of **tile-lang**.
165+
For users who want access to the latest features and improvements before official releases, we provide nightly builds of tilelang.
221166

222167
```bash
223168
pip install tilelang -f https://tile-ai.github.io/whl/nightly/cu121/
@@ -253,23 +198,28 @@ Set `NO_TOOLCHAIN_VERSION=ON` to disable this.
253198
### Run-time environment variables
254199

255200
<!-- TODO: tvm -->
201+
TODO
202+
203+
## Other Tips
256204

257-
## IDE Configs
205+
### IDE Configs
258206

259-
Building tilelang locally will automatically `compile_commands.json` file in `build` dir.
207+
Building tilelang locally will automatically generate a `compile_commands.json` file in `build` dir.
260208
VSCode with clangd and [clangd extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.vscode-clangd) should be able to index that without extra configuration.
261209

262-
## Compile cache
210+
### Compile Cache
263211

264-
`ccache` will be automatically used if found.
212+
The default path of the compile cache is `~/.tilelang/cache`. `ccache` will be automatically used if found.
265213

266-
## Repairing wheels
214+
### Repairing Wheels
267215

268216
If you plan to use your wheel in other environment,
269-
it's recommend to use auditwheel (on Linux) or delocate (on Darwin)
217+
it's recommended to use auditwheel (on Linux) or delocate (on Darwin)
270218
to repair them.
271219

272-
## Faster rebuild for developers
220+
(faster-rebuild-for-developers)=
221+
222+
### Faster Rebuild for Developers
273223

274224
`pip install` introduces extra [un]packaging and takes ~30 sec to complete,
275225
even if no source change.

0 commit comments

Comments
 (0)