You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
46
44
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:
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).
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.
63
63
64
64
```bash
65
65
pip install -e . -v
66
66
```
67
67
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
+
68
74
If you prefer to work directly from the source tree via `PYTHONPATH`, make sure the native extension is built first:
69
75
70
76
```bash
@@ -85,17 +91,21 @@ Some useful CMake options you can toggle while configuring:
85
91
- `-DUSE_ROCM=ON` selects ROCm support when building on AMD GPUs.
86
92
- `-DNO_VERSION_LABEL=ON` disables the backend/git suffix in `tilelang.__version__`.
87
93
88
-
We currently provide four methods to install **tile-lang**:
94
+
(using-existing-tvm)=
89
95
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
93
97
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:
95
99
96
-
### Method 1: Install Using Docker (Recommended)
100
+
```bash
101
+
TVM_ROOT=<your-tvm-repo> pip install . -v
102
+
```
103
+
104
+
(install-using-docker)=
97
105
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.
99
109
100
110
**Prerequisites:**
101
111
- Docker installed on your system
@@ -142,82 +152,17 @@ docker run -itd \
142
152
- `--name tilelang_b200`: Assigns a name to the container for easy management
143
153
- `/bin/zsh`: Uses zsh as the default shell
144
154
145
-
4. **Access the Container**:
155
+
4. **Access the Container and Verify Installation**:
146
156
147
157
```bash
148
158
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:
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:
@@ -253,23 +198,28 @@ Set `NO_TOOLCHAIN_VERSION=ON` to disable this.
253
198
### Run-time environment variables
254
199
255
200
<!-- TODO: tvm -->
201
+
TODO
202
+
203
+
## Other Tips
256
204
257
-
## IDE Configs
205
+
### IDE Configs
258
206
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.
260
208
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.
261
209
262
-
## Compile cache
210
+
### Compile Cache
263
211
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.
265
213
266
-
## Repairing wheels
214
+
### Repairing Wheels
267
215
268
216
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)
270
218
to repair them.
271
219
272
-
## Faster rebuild for developers
220
+
(faster-rebuild-for-developers)=
221
+
222
+
### Faster Rebuild for Developers
273
223
274
224
`pip install` introduces extra [un]packaging and takes ~30 sec to complete,
0 commit comments