Skip to content

Commit

Permalink
Use clang-12 to fix issue with LLVM_ABI_BREAKING_CHECKS
Browse files Browse the repository at this point in the history
This commit is fixing the root cause of the issue that appeared during
an llvm update, and was raised in #4212 (comment).

The issue was temporary fixed in #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.
  • Loading branch information
karupayun committed Sep 19, 2024
1 parent f4c48a9 commit 00b0907
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/llvm-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,34 @@ jobs:
key: ${{ matrix.config.target-os }}-${{ matrix.config.arch }}-${{ env.short_llvm_commit_hash }}
restore-keys: ${{ matrix.config.target-os }}-${{ matrix.config.arch }}-

- name: Configure, Build, Test, and Install LLVM (Ubuntu and macOS x64)
if: matrix.config.arch == 'x64' && (matrix.config.target-os == 'ubuntu' || matrix.config.target-os == 'macos')
- name: Configure, Build, Test, and Install LLVM (Ubuntu)
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'ubuntu'
run: >
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
cmake -GNinja -Bllvm-project/build
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang-12 -DCMAKE_CXX_COMPILER=clang++-12
-DCMAKE_C_COMPILER_LAUNCHER=sccache -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_INSTALL_PREFIX="${{ env.llvm_install_dir }}"
-DCMAKE_LINKER=lld
-DLLVM_BUILD_UTILS=ON
-DLLVM_BUILD_TOOLS=ON
-DLLVM_ENABLE_ASSERTIONS=ON
-DMLIR_ENABLE_BINDINGS_PYTHON=ON
-DLLVM_ENABLE_PROJECTS=mlir
-DLLVM_INSTALL_UTILS=ON
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
-DLLVM_ENABLE_TERMINFO=OFF
llvm-project/llvm
ninja -C llvm-project/build check-mlir install
tar czf "${{ env.llvm_install_dir }}.tar.gz" "${{ env.llvm_install_dir }}"
- name: Configure, Build, Test, and Install LLVM (macOS x64)
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'macos'
run: >
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
Expand All @@ -107,15 +133,14 @@ jobs:
-DLLVM_INSTALL_UTILS=ON
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
llvm-project/llvm
ninja -C llvm-project/build check-mlir install
tar czf "${{ env.llvm_install_dir }}.tar.gz" "${{ env.llvm_install_dir }}"
- name: Configure, Build, Test, and Install LLVM (Windows)
if: matrix.config.arch == 'x64' && (matrix.config.target-os == 'windows')
if: matrix.config.arch == 'x64' && matrix.config.target-os == 'windows'
run: >
python3 -m pip install -r llvm-project/mlir/python/requirements.txt
Expand All @@ -131,7 +156,6 @@ jobs:
-DLLVM_INSTALL_UTILS=ON
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU"
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
llvm-project/llvm
ninja -C llvm-project/build check-mlir install
Expand Down Expand Up @@ -177,7 +201,6 @@ jobs:
-DCMAKE_LINKER=$LINKER \
-DMLIR_ENABLE_BINDINGS_PYTHON=ON \
-DLLVM_ENABLE_ZSTD=OFF \
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
-DLLVM_INSTALL_UTILS=ON \
-DCMAKE_INSTALL_PREFIX="${{ env.llvm_install_dir }}" \
-DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU" \
Expand Down Expand Up @@ -228,7 +251,6 @@ jobs:
-DLLVM_TARGETS_TO_BUILD="AArch64;NVPTX;AMDGPU"
-DLLVM_USE_HOST_TOOLS=ON
-DLLVM_ENABLE_TERMINFO=OFF
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF
llvm-project/llvm
ninja -C llvm-project/build install
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/llvm-build/almalinux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ RUN cmake -GNinja -Bbuild \
-DLLVM_ENABLE_PROJECTS=mlir \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_INSTALL_UTILS=ON \
-DLLVM_ABI_BREAKING_CHECKS=FORCE_OFF \
-DLLVM_TARGETS_TO_BUILD="host;NVPTX;AMDGPU" \
/source/llvm-project/llvm

Expand Down
2 changes: 1 addition & 1 deletion cmake/llvm-hash.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
36adf8ecedb64047021265a1e1730773d3b3a9e8
c8fcfe1980999688f22a4ee53ec7c65c8c055752

0 comments on commit 00b0907

Please sign in to comment.