Skip to content

Commit ec8cb09

Browse files
authored
[DOC] Update README.md (#7368)
# Purpose Improve readability and fix minor issues in README. # New contributor declaration - [x] I am not making a trivial change, such as fixing a typo in a comment. - [x] I have written a PR description following these [rules](https://cbea.ms/git-commit/#why-not-how). - [ ] I have run `pre-commit run --from-ref origin/main --to-ref HEAD`. - Select one of the following. - [ ] I have added tests. - `/test` for `lit` tests - `/unittest` for C++ tests - `/python/test` for end-to-end tests - [x] This PR does not need a test because `FILL THIS IN`. - Select one of the following. - [x] I have not added any `lit` tests. - [ ] The `lit` tests I have added follow these [best practices](https://mlir.llvm.org/getting_started/TestingGuide/#filecheck-best-practices), including the "tests should be minimal" section. (Usually running Python code and using the instructions it generates is not minimal.)
1 parent a762215 commit ec8cb09

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pip install -e .
5050
# Building with a custom LLVM
5151

5252
Triton uses LLVM to generate code for GPUs and CPUs. Normally, the Triton build
53-
downloads a prebuilt LLVM, but you can also build LLVM from source and use that.
53+
downloads a prebuilt LLVM, but you can also build and use LLVM from source.
5454

5555
LLVM does not have a stable API, so the Triton build will not work at an
5656
arbitrary LLVM version.
@@ -68,15 +68,15 @@ Alternatively, follow these steps to build LLVM from source manually.
6868

6969
1. Find the version of LLVM that Triton builds against. Check
7070
`cmake/llvm-hash.txt` to see the current version. For example, if it says:
71-
49af6502c6dcb4a7f7520178bd14df396f78240c
71+
49af6502c6dcb4a7f7520178bd14df396f78240c.
7272

7373
This means that the version of Triton you have builds against
7474
[LLVM](https://github.com/llvm/llvm-project) 49af6502.
7575

7676
2. `git checkout` LLVM at this revision. Optionally, make additional
7777
modifications to LLVM.
7878

79-
3. [Build LLVM](https://llvm.org/docs/CMake.html). For example, you might run
79+
3. [Build LLVM](https://llvm.org/docs/CMake.html). For example, you might run:
8080

8181
$ cd $HOME/llvm-project # your clone of LLVM.
8282
$ mkdir build
@@ -86,7 +86,7 @@ Alternatively, follow these steps to build LLVM from source manually.
8686

8787
4. Grab a snack, this will take a while.
8888

89-
5. Build Triton as above, but set the following environment variables.
89+
5. Build Triton as above, but set the following environment variables:
9090

9191
# Modify as appropriate to point to your LLVM build.
9292
$ export LLVM_BUILD_DIR=$HOME/llvm-project/build
@@ -125,10 +125,10 @@ Alternatively, follow these steps to build LLVM from source manually.
125125

126126
If IntelliSense does not work, you can try the following steps:
127127

128-
- Do a local build. Run command `pip install -e .`
128+
- Do a local build. Run command `pip install -e .`.
129129
- Get the full path to the `compile_commands.json` file produced by the build:
130130
`find ./build -name 'compile_commands.json' | xargs readlink -f`.
131-
You might get a full path similar to `/Users/{username}/triton/build/cmake.macosx-11.1-arm64-cpython-3.12/compile_commands.json`
131+
You might get a full path similar to `/Users/{username}/triton/build/cmake.macosx-11.1-arm64-cpython-3.12/compile_commands.json`.
132132
- In VSCode, install the
133133
[C/C++
134134
extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools),
@@ -140,7 +140,7 @@ Alternatively, follow these steps to build LLVM from source manually.
140140
# Running tests
141141

142142
There currently isn't a turnkey way to run all the Triton tests, but you can
143-
follow the following recipe.
143+
follow the following recipe:
144144

145145
```shell
146146
# One-time setup. Note this will reinstall local Triton because torch
@@ -164,7 +164,7 @@ See [`python/triton/knobs.py`](python/triton/knobs.py) for the full list of conf
164164

165165
- `MLIR_ENABLE_DUMP=1` dumps the IR before every MLIR pass Triton runs, for all
166166
kernels. Use `MLIR_ENABLE_DUMP=kernelName` to dump for a specific kernel only.
167-
- Triton cache can interfere with the dump. In cases where `MLIR_ENABLE_DUMP=1` does not work, try cleaning your triton cache: `rm -r ~/.triton/cache/*`
167+
- Triton cache can interfere with the dump. In cases where `MLIR_ENABLE_DUMP=1` does not work, try cleaning your triton cache: `rm -r ~/.triton/cache/*`.
168168
- `MLIR_DUMP_PATH` specifies where `MLIR_ENABLE_DUMP` will dump to. If unset will dump to stderr.
169169
- `LLVM_IR_ENABLE_DUMP=1` dumps the IR before every pass run over the LLVM IR.
170170
- `TRITON_REPRODUCER_PATH=<reproducer_path>` will generate an MLIR reproducer file
@@ -175,11 +175,11 @@ See [`python/triton/knobs.py`](python/triton/knobs.py) for the full list of conf
175175
- `TRITON_ENABLE_LLVM_DEBUG=1` passes `-debug` to LLVM, printing a lot of
176176
debugging information to stdout. If this is too noisy, run with just
177177
`TRITON_LLVM_DEBUG_ONLY` instead to limit the output.
178-
179-
An alternative way to reduce output noisiness is running with
178+
- An alternative way to reduce output noisiness is running with
180179
`LLVM_IR_ENABLE_DUMP=1`, extract the IR before the LLVM pass of interest, and
181180
then run LLVM's `opt` standalone, perhaps passing `-debug-only=foo` on the
182181
command line.
182+
183183
- `TRITON_LLVM_DEBUG_ONLY=<comma-separated>` is the equivalent of LLVM's
184184
`-debug-only` command-line option. This limits the LLVM debug output to
185185
specific pass or component names (which are specified using `#define
@@ -191,8 +191,7 @@ See [`python/triton/knobs.py`](python/triton/knobs.py) for the full list of conf
191191
- `TRITON_ENABLE_ASAN=1` invokes the LLVM address sanitizer for
192192
memory leak and out of bounds access detection. Currently only supported on the AMD
193193
backend. This must be run using the ASAN libraries documented [here](https://rocm.docs.amd.com/projects/llvm-project/en/latest/conceptual/using-gpu-sanitizer.html).
194-
195-
When enabling the address sanitizer it is recommended to disable various memory caching strategies
194+
- When enabling the address sanitizer it is recommended to disable various memory caching strategies
196195
both within the ROCm stack and PyTorch. This will give the address sanitizer the best chance at finding the
197196
memory fault where it originates. See this [test](https://github.com/triton-lang/triton/blob/main/third_party/amd/python/test/test_address_sanitizer.py) for more details.
198197

@@ -227,9 +226,10 @@ See [`python/triton/knobs.py`](python/triton/knobs.py) for the full list of conf
227226
- `TRITON_OVERRIDE_DIR` specifies the directory from which to load the IR/ptx/amdgcn files when `TRITON_KERNEL_OVERRIDE` is set to 1.
228227
- `TRITON_F32_DEFAULT` sets the default input precision of `tl.dot` when using 32-bit floats, which can be either `ieee`, `tf32`, or `tf32x3`.
229228
- `TRITON_FRONT_END_DEBUGGING=1` disables exception wrapping when an error occurs in the compiler frontend, allowing the full stack trace to be seen.
230-
- `TRITON_DISABLE_LINE_INFO=1` removes all line information from the module
229+
- `TRITON_DISABLE_LINE_INFO=1` removes all line information from the module.
231230

232-
N.B. Some of these environment variables don't have a knob in `knobs.py`-- those are only relevant to the C++ layer(s), hence they don't exist in the python layer.
231+
> [!NOTE]
232+
> Some of these environment variables don't have a knob in `knobs.py`-- those are only relevant to the C++ layer(s), hence they don't exist in the python layer.
233233
234234
**Kernel Override Steps**
235235

@@ -274,7 +274,7 @@ Supported Hardware:
274274
# Development Container (Dev Container)
275275

276276
**Dev Containers** for the Triton project are available from
277-
the [triton-dev-containers repository](https://github.com/redhat-et/triton-dev-containers)
277+
the [triton-dev-containers repository](https://github.com/redhat-et/triton-dev-containers).
278278

279279
### Key Benefits:
280280
- **Consistency**: All developers can work with the same development
@@ -286,5 +286,5 @@ the [triton-dev-containers repository](https://github.com/redhat-et/triton-dev-c
286286

287287
### How to Use the Dev Container:
288288

289-
For detailed instructions on how to use the dev containers please see
290-
the [dev container user guide](https://github.com/redhat-et/triton-dev-containers/blob/main/.devcontainer/devcontainer.md)
289+
For detailed instructions on how to use the dev containers, please see
290+
the [dev container user guide](https://github.com/redhat-et/triton-dev-containers/blob/main/.devcontainer/devcontainer.md).

0 commit comments

Comments
 (0)