Skip to content

Commit 2927385

Browse files
👷 Update MLIR set-up to use self-built versions (#1294)
## Description This PR configures the MLIR set-up in our CI to use the Action we have developed in munich-quantum-software/setup-mlir#1. ## Checklist: - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~I have added appropriate tests that cover the new/changed functionality.~ - [x] ~I have updated the documentation to reflect these changes.~ - [x] I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals. - [x] ~I have added migration instructions to the upgrade guide (if needed).~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. Fixes #1124 --------- Signed-off-by: Daniel Haag <121057143+denialhaag@users.noreply.github.com> Signed-off-by: burgholzer <burgholzer@me.com> Co-authored-by: burgholzer <burgholzer@me.com>
1 parent 308365e commit 2927385

File tree

5 files changed

+18
-219
lines changed

5 files changed

+18
-219
lines changed

.github/scripts/setup-mlir.ps1

Lines changed: 0 additions & 100 deletions
This file was deleted.

.github/scripts/setup-mlir.sh

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/reusable-mlir-tests.yml

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
mlir:
77
name: >-
88
${{ contains(matrix.os, 'ubuntu') && '🐧' || contains(matrix.os, 'windows') && '🏁' || '🍎' }}
9-
${{ matrix.coverage && 'Coverage' || matrix.os }} with LLVM@${{ matrix.llvm-version }}
9+
${{ matrix.coverage && 'Coverage' || matrix.os }}
1010
runs-on: ${{ matrix.os }}
1111
permissions:
1212
contents: read
@@ -23,11 +23,9 @@ jobs:
2323
windows-2025,
2424
windows-11-arm,
2525
]
26-
llvm-version: [21]
2726
coverage: [false]
2827
include:
2928
- os: ubuntu-24.04
30-
llvm-version: 21
3129
coverage: true
3230
env:
3331
CMAKE_BUILD_PARALLEL_LEVEL: 4
@@ -39,24 +37,10 @@ jobs:
3937
with:
4038
fetch-depth: 0
4139

42-
# OS-specific toolchain setup
43-
- name: Setup LLVM/MLIR (Linux/macOS)
44-
if: runner.os != 'Windows'
45-
run: bash .github/scripts/setup-mlir.sh ${{ matrix.llvm-version }}
46-
47-
- name: Restore LLVM/MLIR cache (Windows)
48-
if: runner.os == 'Windows'
49-
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
50-
id: mlir-cache
40+
- name: Set up MLIR
41+
uses: munich-quantum-software/setup-mlir@2025.11.25
5142
with:
52-
path: llvm-install
53-
key: ${{ matrix.os }}-llvm-${{ matrix.llvm-version }}
54-
55-
- name: Setup LLVM/MLIR (Windows)
56-
if: runner.os == 'Windows'
57-
shell: pwsh
58-
run: |
59-
& "${{ github.workspace }}\.github\scripts\setup-mlir.ps1" -MajorVersion ${{ matrix.llvm-version }} -InstallPrefix "${{ github.workspace }}\llvm-install"
43+
tag: 2025.11.25
6044

6145
# Build acceleration and Python tooling
6246
- name: Set up mold as linker (Linux)
@@ -83,8 +67,6 @@ jobs:
8367
cmake -G Ninja -S . -B build \
8468
-DCMAKE_BUILD_TYPE=${{ matrix.coverage && 'Debug' || 'Release' }} \
8569
-DBUILD_MQT_CORE_MLIR=ON \
86-
-DLLVM_DIR=$LLVM_DIR \
87-
-DMLIR_DIR=$MLIR_DIR \
8870
-DLLVM_EXTERNAL_LIT=$(which lit) \
8971
${{ matrix.coverage && '-DENABLE_COVERAGE=ON' || '' }}
9072
@@ -94,8 +76,6 @@ jobs:
9476
cmake -S . -B build `
9577
-DCMAKE_BUILD_TYPE=${{ matrix.coverage && 'Debug' || 'Release' }} `
9678
-DBUILD_MQT_CORE_MLIR=ON `
97-
-DLLVM_DIR="${{ github.workspace }}\llvm-install\lib\cmake\llvm" `
98-
-DMLIR_DIR="${{ github.workspace }}\llvm-install\lib\cmake\mlir" `
9979
-DLLVM_EXTERNAL_LIT=${{ github.workspace }}\.venv\Scripts\lit.exe `
10080
${{ matrix.coverage && '-DENABLE_COVERAGE=ON' || '' }}
10181
@@ -118,22 +98,22 @@ jobs:
11898
if: matrix.coverage
11999
run: |
120100
uvx gcovr \
121-
--gcov-executable "/usr/lib/llvm-${{ matrix.llvm-version }}/bin/llvm-cov gcov" \
122-
--exclude build \
123-
--exclude-unreachable-branches \
124-
--exclude-noncode-lines \
125-
--exclude-throw-branches \
126-
--print-summary \
127-
--keep \
128-
--json \
129-
-o coverage-llvm-${{ matrix.llvm-version }}.json
101+
--gcov-executable "llvm-cov gcov" \
102+
--exclude build \
103+
--exclude-unreachable-branches \
104+
--exclude-noncode-lines \
105+
--exclude-throw-branches \
106+
--print-summary \
107+
--keep \
108+
--json \
109+
-o mlir-coverage.json
130110
131111
- name: Upload coverage to Codecov
132112
if: matrix.coverage
133113
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
134114
with:
135115
flags: mlir
136-
name: mlir-coverage-llvm-${{ matrix.llvm-version }}
116+
name: mlir-coverage
137117
fail_ci_if_error: true
138118
use_oidc: true
139-
files: coverage-llvm-${{ matrix.llvm-version }}.json
119+
files: mlir-coverage.json

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Changed
1313

14+
- 👷 Use `munich-quantum-software/setup-mlir` to set up MLIR ([#1294]) ([**@denialhaag**])
1415
- ♻️ Preserve tuple structure and improve site type clarity of the MQT NA Default QDMI Device ([#1299]) ([**@marcelwa**])
1516
- ♻️ Move DD package evaluation module to standalone script ([#1327]) ([**@burgholzer**])
1617

@@ -251,6 +252,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
251252
[#1327]: https://github.com/munich-quantum-toolkit/core/pull/1327
252253
[#1300]: https://github.com/munich-quantum-toolkit/core/pull/1300
253254
[#1299]: https://github.com/munich-quantum-toolkit/core/pull/1299
255+
[#1294]: https://github.com/munich-quantum-toolkit/core/pull/1294
254256
[#1293]: https://github.com/munich-quantum-toolkit/core/pull/1293
255257
[#1287]: https://github.com/munich-quantum-toolkit/core/pull/1287
256258
[#1283]: https://github.com/munich-quantum-toolkit/core/pull/1283

cmake/AddMQTPythonBinding.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function(add_mqt_python_binding package_name target_name)
1515
pybind11_add_module(
1616
# name of the extension
1717
${target_name}
18-
# Pprefer thin LTO if available
18+
# prefer thin LTO if available
1919
THIN_LTO
2020
# optimize the bindings for size
2121
OPT_SIZE

0 commit comments

Comments
 (0)