Skip to content

Commit 29095ff

Browse files
authored
Update triton to 784b550 (#273)
Changes required to update to triton-lang/triton@784b550. - build directory moved from `triton/python` to `triton/` - setup.py treats all contents of backend `tools/` and `language/` as packages, so move `tools/CMakeLists.txt` and `tools/RegisterTritonSharedDialects.h`. - driver's interface for `load_binary` changed; must be a large enough integer to not fail the irrelevant check - `!(self.metadata.num_warps * warp_size > self.n_max_threads)` in `triton/compiler/compiler.py`
1 parent 77e188d commit 29095ff

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

.github/workflows/test-plugin.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
python3 -m pre_commit run --all-files --verbose
6565
6666
- name: Build/Install Triton
67-
working-directory: triton_shared/triton/python
67+
working-directory: triton_shared/triton
6868
run: |
6969
python3 -m pip install --upgrade pip
7070
python3 -m pip install cmake==3.24 ninja pytest-xdist pybind11 setuptools
@@ -74,7 +74,7 @@ jobs:
7474
TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]'
7575
7676
- name: Run shared middle-layer lit tests
77-
working-directory: triton_shared/triton/python
77+
working-directory: triton_shared/triton
7878
run: |
7979
python3 -m pip install lit
8080
LIT_TEST_DIR="build/$(ls build | grep -i cmake)/third_party/triton_shared/test"
@@ -89,7 +89,7 @@ jobs:
8989
python3 -m pip install pytest
9090
9191
- name: Prepare CPU backend environment
92-
working-directory: triton_shared/triton/python
92+
working-directory: triton_shared/triton
9393
run: |
9494
CMAKE_BUILD_DIR=$(ls $(pwd)/build | grep -i cmake)
9595
LLVM_BINARY_DIR=$(find ${HOME}/.triton/llvm/ -name bin | head -1)
@@ -138,7 +138,7 @@ jobs:
138138
python3 -m pre_commit run --all-files --verbose
139139
140140
- name: Build/Install Triton
141-
working-directory: triton_shared/triton/python
141+
working-directory: triton_shared/triton
142142
run: |
143143
python3 -m pip install --upgrade pip
144144
python3 -m pip install cmake==3.24 ninja pytest-xdist pybind11 setuptools
@@ -148,7 +148,7 @@ jobs:
148148
TRITON_BUILD_WITH_CLANG_LLD=true TRITON_BUILD_WITH_CCACHE=true python3 -m pip install --no-build-isolation -vvv '.[tests]'
149149
150150
- name: Run shared middle-layer lit tests
151-
working-directory: triton_shared/triton/python
151+
working-directory: triton_shared/triton
152152
run: |
153153
python3 -m pip install lit
154154
LIT_TEST_DIR="build/$(ls build | grep -i cmake)/third_party/triton_shared/test"
@@ -163,7 +163,7 @@ jobs:
163163
python3 -m pip install pytest
164164
165165
- name: Prepare CPU backend environment
166-
working-directory: triton_shared/triton/python
166+
working-directory: triton_shared/triton
167167
run: |
168168
CMAKE_BUILD_DIR=$(ls $(pwd)/build | grep -i cmake)
169169
LLVM_BINARY_DIR=$(find ${HOME}/.triton/llvm/ -name bin | head -1)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ include_directories(${pybind11_INCLUDE_DIR})
1111
add_subdirectory(include)
1212
add_subdirectory(lib)
1313
add_subdirectory(test)
14-
add_subdirectory(tools)
14+
add_subdirectory(tools/triton-shared-opt)
1515

1616
if (TRITON_SHARED_BUILD_CPU_BACKEND)
1717
add_triton_plugin(TritonShared ${CMAKE_CURRENT_SOURCE_DIR}/triton_shared.cc LINK_LIBS TritonSharedAnalysis TritonToLinalg TritonTilingExtIR)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ You need to set the `TRITON_PLUGIN_DIRS` environment variable to the location of
2626
export TRITON_PLUGIN_DIRS=$(pwd)/triton_shared
2727
2828
git clone --recurse-submodules https://github.com/microsoft/triton-shared.git triton_shared
29-
cd triton_shared/triton/python
29+
cd triton_shared/triton
3030
```
3131

3232
To build with Clang:
@@ -49,7 +49,7 @@ pip3 install ninja cmake wheel pytest pybind11 setuptools
4949
pip3 install -e . --no-build-isolation
5050
```
5151

52-
The resulting `triton-shared` binaries will be placed under `triton/python/build/{current_cmake_version}/third_party/triton_shared`
52+
The resulting `triton-shared` binaries will be placed under `triton/build/{current_cmake_version}/third_party/triton_shared`
5353

5454
### 1. Stand-Alone
5555
The middle layer can be used as a stand-alone component to convert Triton dialect to the middle layer dialects. This is intended for testing and validation purposes, but could potentially be used before sending the IR to another MLIR complier.
@@ -170,7 +170,7 @@ The prototype was tested on the following triton kernel examples:
170170
The Python tests are setup to run with Pytest and you will need to set the following environment variables to run them:
171171
```
172172
export LLVM_BINARY_DIR=<path-to-your-llvm-binaries>
173-
export TRITON_SHARED_OPT_PATH=$TRITON_PLUGIN_DIRS/triton/python/build/<your-cmake-directory>/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt
173+
export TRITON_SHARED_OPT_PATH=$TRITON_PLUGIN_DIRS/triton/build/<your-cmake-directory>/third_party/triton_shared/tools/triton-shared-opt/triton-shared-opt
174174
175175
pytest <path-to-triton-shared>/python/examples
176176
```

backend/driver.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,8 @@ def load_binary(name, kernel_obj, shared, device):
349349
None, # module
350350
kernel_obj, # function
351351
None, # n_regs
352-
None # n_spills
352+
None, # n_spills
353+
sys.maxsize, # n_max_threads
353354
)
354355

355356

tools/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

tools/triton-shared-opt/triton-shared-opt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66
//===----------------------------------------------------------------------===//
77

8-
#include "../RegisterTritonSharedDialects.h"
8+
#include "RegisterTritonSharedDialects.h"
99

1010
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
1111

triton

Submodule triton updated 136 files

0 commit comments

Comments
 (0)