Skip to content

Commit 00b0907

Browse files
committed
Use clang-12 to fix issue with LLVM_ABI_BREAKING_CHECKS
This commit is fixing the root cause of the issue that appeared during an llvm update, and was raised in triton-lang#4212 (comment). The issue was temporary fixed in triton-lang#4512, where we set LLVM_ABI_BREAKING_CHECKS to FORCE_OFF constant in order to not use a non-deterministic seed inside the hashing function (included in this llvm commit: llvm/llvm-project@ce80c80). A further investigation (with chsigg@) found that the issue is that LLVM is built with clang11, while Triton use a newer version. The ABI issue is brought up here: llvm/llvm-project#96282 (comment), but the consensus seemed to be that this setup is rare. Updated the clang version to 12 in the ubuntu build fixed the issue and therefore we can revert setting LLVM_ABI_BREAKING_CHECKS constant. I am additionaly erasing LLVM_ABI_BREAKING_CHECKS in the setup of the other hardwares (it seems it was not needed) and I am splitting ubuntu and macOS configurations because it seems cleaner than having a variable that sets the compiler version for each of them.
1 parent f4c48a9 commit 00b0907

File tree

3 files changed

+30
-9
lines changed

3 files changed

+30
-9
lines changed

.github/workflows/llvm-build.yml

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,34 @@ jobs:
8888
key: ${{ matrix.config.target-os }}-${{ matrix.config.arch }}-${{ env.short_llvm_commit_hash }}
8989
restore-keys: ${{ matrix.config.target-os }}-${{ matrix.config.arch }}-
9090

91-
- name: Configure, Build, Test, and Install LLVM (Ubuntu and macOS x64)
92-
if: matrix.config.arch == 'x64' && (matrix.config.target-os == 'ubuntu' || matrix.config.target-os == 'macos')
91+
- name: Configure, Build, Test, and Install LLVM (Ubuntu)
92+
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'ubuntu'
93+
run: >
94+
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
95+
96+
cmake -GNinja -Bllvm-project/build
97+
-DCMAKE_BUILD_TYPE=Release
98+
-DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12
99+
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
100+
-DCMAKE_INSTALL_PREFIX="${{ env.llvm_install_dir }}"
101+
-DCMAKE_LINKER=lld
102+
-DLLVM_BUILD_UTILS=ON
103+
-DLLVM_BUILD_TOOLS=ON
104+
-DLLVM_ENABLE_ASSERTIONS=ON
105+
-DMLIR_ENABLE_BINDINGS_PYTHON=ON
106+
-DLLVM_ENABLE_PROJECTS=mlir
107+
-DLLVM_INSTALL_UTILS=ON
108+
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
109+
-DLLVM_ENABLE_TERMINFO=OFF
110+
llvm-project/llvm
111+
112+
ninja -C llvm-project/build check-mlir install
113+
114+
tar czf "${{ env.llvm_install_dir }}.tar.gz" "${{ env.llvm_install_dir }}"
115+
116+
117+
- name: Configure, Build, Test, and Install LLVM (macOS x64)
118+
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'macos'
93119
run: >
94120
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
95121
@@ -107,15 +133,14 @@ jobs:
107133
-DLLVM_INSTALL_UTILS=ON
108134
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
109135
-DLLVM_ENABLE_TERMINFO=OFF
110-
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
111136
llvm-project/llvm
112137
113138
ninja -C llvm-project/build check-mlir install
114139
115140
tar czf "${{ env.llvm_install_dir }}.tar.gz" "${{ env.llvm_install_dir }}"
116141
117142
- name: Configure, Build, Test, and Install LLVM (Windows)
118-
if: matrix.config.arch == 'x64' && (matrix.config.target-os == 'windows')
143+
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'windows'
119144
run: >
120145
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
121146
@@ -131,7 +156,6 @@ jobs:
131156
-DLLVM_INSTALL_UTILS=ON
132157
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
133158
-DLLVM_ENABLE_TERMINFO=OFF
134-
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
135159
llvm-project/llvm
136160
137161
ninja -C llvm-project/build check-mlir install
@@ -177,7 +201,6 @@ jobs:
177201
-DCMAKE_LINKER=$LINKER \
178202
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
179203
-DLLVM_ENABLE_ZSTD=OFF \
180-
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
181204
-DLLVM_INSTALL_UTILS=ON \
182205
-DCMAKE_INSTALL_PREFIX="${{ env.llvm_install_dir }}" \
183206
-DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU" \
@@ -228,7 +251,6 @@ jobs:
228251
-DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU"
229252
-DLLVM_USE_HOST_TOOLS=ON
230253
-DLLVM_ENABLE_TERMINFO=OFF
231-
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
232254
llvm-project/llvm
233255
234256
ninja -C llvm-project/build install

.github/workflows/llvm-build/almalinux.Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ RUN cmake -GNinja -Bbuild \
3333
-DLLVM_ENABLE_PROJECTS=mlir \
3434
-DLLVM_ENABLE_TERMINFO=OFF \
3535
-DLLVM_INSTALL_UTILS=ON \
36-
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
3736
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" \
3837
/source/llvm-project/llvm
3938

cmake/llvm-hash.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
36adf8ecedb64047021265a1e1730773d3b3a9e8
1+
c8fcfe1980999688f22a4ee53ec7c65c8c055752

0 commit comments

Comments
 (0)