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,23 @@ 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 Customized TVM Path
93
97
94
-
(install-method-1)=
98
+
If you already have a TVM codebase, 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
+
> **Note**: This will still rebuild the TVM-related libraries (stored in `TL_LIBS`). And this method often leads to some path issues. Check `env.py` to see some environment variables which are not set properly.
105
+
106
+
(install-using-docker)=
107
+
108
+
## Install Using Docker
97
109
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.
110
+
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
111
100
112
**Prerequisites:**
101
113
- Docker installed on your system
@@ -142,82 +154,17 @@ docker run -itd \
142
154
-`--name tilelang_b200`: Assigns a name to the container for easy management
143
155
-`/bin/zsh`: Uses zsh as the default shell
144
156
145
-
4.**Access the Container**:
157
+
4.**Access the Container and Verify Installation**:
146
158
147
159
```bash
148
160
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:
@@ -252,24 +199,28 @@ Set `NO_TOOLCHAIN_VERSION=ON` to disable this.
252
199
253
200
### Run-time environment variables
254
201
255
-
<!-- TODO: tvm -->
202
+
Please refer to the `env.py` file for a full list of supported run-time environment variables.
203
+
204
+
## Other Tips
256
205
257
-
## IDE Configs
206
+
###IDE Configs
258
207
259
-
Building tilelang locally will automatically `compile_commands.json` file in `build` dir.
208
+
Building tilelang locally will automatically generate a `compile_commands.json` file in `build` dir.
260
209
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
210
262
-
## Compile cache
211
+
###Compile Cache
263
212
264
-
`ccache` will be automatically used if found.
213
+
The default path of the compile cache is `~/.tilelang/cache`. `ccache` will be automatically used if found.
265
214
266
-
## Repairing wheels
215
+
###Repairing Wheels
267
216
268
217
If you plan to use your wheel in other environment,
269
-
it's recommend to use auditwheel (on Linux) or delocate (on Darwin)
218
+
it's recommended to use auditwheel (on Linux) or delocate (on Darwin)
270
219
to repair them.
271
220
272
-
## Faster rebuild for developers
221
+
(faster-rebuild-for-developers)=
222
+
223
+
### Faster Rebuild for Developers
273
224
274
225
`pip install` introduces extra [un]packaging and takes ~30 sec to complete,
0 commit comments