Skip to content

Commit 2c7a639

Browse files
authored
[docs] Include MLIR debugging by default in development.md (#4104)
- the use-case for this doc leans more toward "development" rather than "release" - ergo, debugging flags should be assumed rather than suggested
1 parent 0c29ccf commit 2c7a639

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

docs/development.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ This will build `libtorch` / `PyTorch` wheels from source and requires [the enab
107107
```shell
108108
cmake -GNinja -Bbuild \
109109
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 \
111112
-DLLVM_ENABLE_ASSERTIONS=ON \
112113
-DPython3_FIND_VIRTUALENV=ONLY \
113114
-DLLVM_ENABLE_PROJECTS=mlir \
@@ -140,7 +141,9 @@ If you're running into issues with the above build command, consider using the f
140141
141142
```shell
142143
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 \
144147
-DPython3_FIND_VIRTUALENV=ONLY \
145148
-DLLVM_ENABLE_PROJECTS=mlir \
146149
-DLLVM_EXTERNAL_PROJECTS="torch-mlir" \
@@ -156,7 +159,9 @@ cmake -GNinja -Bbuild \
156159
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:
157160
```shell
158161
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 \
160165
-DPython3_FIND_VIRTUALENV=ONLY \
161166
-DMLIR_DIR="$LLVM_INSTALL_DIR/lib/cmake/mlir/" \
162167
-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
168173
169174
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.
170175
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
174-
```shell
175-
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ # or =Debug
176-
-DLLVM_ENABLE_ASSERTIONS=ON \
177-
```
176+
###### [About MLIR debugging](https://mlir.llvm.org/getting_started/Debugging/)
178177
179178
##### Options to run end-to-end tests
180179

0 commit comments

Comments
 (0)