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
Copy file name to clipboardExpand all lines: docs/development.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,8 @@ This will build `libtorch` / `PyTorch` wheels from source and requires [the enab
107
107
```shell
108
108
cmake -GNinja -Bbuild \
109
109
externals/llvm-project/llvm \
110
-
-DCMAKE_BUILD_TYPE=Release \
110
+
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
111
+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
111
112
-DLLVM_ENABLE_ASSERTIONS=ON \
112
113
-DPython3_FIND_VIRTUALENV=ONLY \
113
114
-DLLVM_ENABLE_PROJECTS=mlir \
@@ -140,7 +141,9 @@ If you're running into issues with the above build command, consider using the f
140
141
141
142
```shell
142
143
cmake -GNinja -Bbuild \
143
-
-DCMAKE_BUILD_TYPE=Release \
144
+
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
145
+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
146
+
-DLLVM_ENABLE_ASSERTIONS=ON \
144
147
-DPython3_FIND_VIRTUALENV=ONLY \
145
148
-DLLVM_ENABLE_PROJECTS=mlir \
146
149
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
@@ -156,7 +159,9 @@ cmake -GNinja -Bbuild \
156
159
If you have built llvm-project separately in the directory `$LLVM_INSTALL_DIR`, you can also build the project *out-of-tree* using the following command as template:
157
160
```shell
158
161
cmake -GNinja -Bbuild \
159
-
-DCMAKE_BUILD_TYPE=Release \
162
+
`# Enables "--debug" and "--debug-only" flags for the "torch-mlir-opt" tool` \
163
+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
164
+
-DLLVM_ENABLE_ASSERTIONS=ON \
160
165
-DPython3_FIND_VIRTUALENV=ONLY \
161
166
-DMLIR_DIR="$LLVM_INSTALL_DIR/lib/cmake/mlir/" \
162
167
-DLLVM_DIR="$LLVM_INSTALL_DIR/lib/cmake/llvm/" \
@@ -168,13 +173,7 @@ The same QoL CMake flags can be used to enable clang, ccache, and lld. Be sure t
168
173
169
174
Be aware that the installed version of LLVM needs in general to match the committed version in `externals/llvm-project`. Using a different version may or may not work.
170
175
171
-
##### Options to enable MLIR debugging
172
-
173
-
* Enabling `--debug` and `--debug-only` flags (see [MLIR docs](https://mlir.llvm.org/getting_started/Debugging/)) for the `torch-mlir-opt` tool
0 commit comments