Skip to content

👷 add windows CI for MLIR #952

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
May 19, 2025
Merged

👷 add windows CI for MLIR #952

merged 31 commits into from
May 19, 2025

Conversation

DRovara
Copy link
Collaborator

@DRovara DRovara commented May 14, 2025

Description

This PR adds MLIR CI tests for windows runners.
This is achieved by building MLIR from source so the first execution should take a bit longer.
Afterwards, the cache will be used to store the built versions of MLIR.

This PR contributes to #925

Note: To install a specific version, the runner clones the tag llvmorg-{version}.1.0. It seems that the first release of a new major llvm-project version is typically called {version}.1.0 so this should keep working, but there is no guarantee.

Checklist:

  • The pull request only contains commits that are focused and relevant to this change.
  • I have added appropriate tests that cover the new/changed functionality.
  • I have updated the documentation to reflect these changes.
  • I have added entries to the changelog for any noteworthy additions, changes, fixes or removals.
  • I have added migration instructions to the upgrade guide (if needed).
  • The changes follow the project's style guidelines and introduce no new warnings.
  • The changes are fully tested and pass the CI checks.
  • I have reviewed my own code changes.

@DRovara DRovara self-assigned this May 14, 2025
@DRovara DRovara linked an issue May 14, 2025 that may be closed by this pull request
@DRovara DRovara added continuous integration Anything related to the CI setup MLIR Anything related to MLIR labels May 14, 2025
@DRovara DRovara requested a review from burgholzer May 14, 2025 17:27
@burgholzer burgholzer linked an issue May 15, 2025 that may be closed by this pull request
@burgholzer burgholzer added this to the MLIR Support milestone May 15, 2025
@burgholzer burgholzer moved this to In Progress in MQT Core May 15, 2025
for any new version of LLVM the build directory would be irrelevant anyway.

Signed-off-by: burgholzer <[email protected]>
that has led to several problems over the last couple of weeks and I have heard critical voices for using it on Windows. We might want to use `-T ClangCL` to compile with clang though.

Signed-off-by: burgholzer <[email protected]>
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @DRovara for pushing this 🙏🏼
This was already looking pretty great. I just applied some small finishing touches here and there.

Let's see if CI passes and hope that caching works once this is on the main branch. Waiting two hours for CI certainly is not fun 🙃

I guess my only real question would be if we really want to check out the X.1.0 version of MLIR or whether we would actually like to check out the latest X.Y.Z version, i.e., the latest minor and patch version, which would mirror what the Ubuntu runner is currently doing.

Potentially, we might even opt for doing both in the future, testing the lowest supported LLVM version and the latest one. Similar to how we do testing for the Python package at the moment.
But I guess this is something to keep in mind for the future.

@DRovara
Copy link
Collaborator Author

DRovara commented May 15, 2025

Thanks @DRovara for pushing this 🙏🏼 This was already looking pretty great. I just applied some small finishing touches here and there.

Let's see if CI passes and hope that caching works once this is on the main branch. Waiting two hours for CI certainly is not fun 🙃

I guess my only real question would be if we really want to check out the X.1.0 version of MLIR or whether we would actually like to check out the latest X.Y.Z version, i.e., the latest minor and patch version, which would mirror what the Ubuntu runner is currently doing.

Potentially, we might even opt for doing both in the future, testing the lowest supported LLVM version and the latest one. Similar to how we do testing for the Python package at the moment. But I guess this is something to keep in mind for the future.

Sure, looks good to me!
I guess you're right about getting the latest minor patch version.
Is there any easy way to do that though or do we manually have to filter for it?

@burgholzer
Copy link
Member

Sure, looks good to me! I guess you're right about getting the latest minor patch version. Is there any easy way to do that though or do we manually have to filter for it?

Good question. I do not really know to be honest.
We could simply specify the version for LLVM explicitly down to the patch version for the Windows CI runs. That way, we still need to manually update that once a new version comes out, but we don't need to do any complicated GitHub API parsing and filtering. What do you say?

@DRovara
Copy link
Collaborator Author

DRovara commented May 15, 2025

Good question. I do not really know to be honest. We could simply specify the version for LLVM explicitly down to the patch version for the Windows CI runs. That way, we still need to manually update that once a new version comes out, but we don't need to do any complicated GitHub API parsing and filtering. What do you say?

I'm not so sure about that. First of all, that could lead to a lot of manual maintenance work, and also that could cause confusion because suddenly after an update, the Linux CI may fail while the one for Windows still passes because we didn't manually update it yet.
Before we do that, I'd rather try to invest half an hour more to see if there's an automated approach for that.

@burgholzer
Copy link
Member

I'm not so sure about that. First of all, that could lead to a lot of manual maintenance work, and also that could cause confusion because suddenly after an update, the Linux CI may fail while the one for Windows still passes because we didn't manually update it yet. Before we do that, I'd rather try to invest half an hour more to see if there's an automated approach for that.

Fine with me. And I generally agree with your statement. I just became a bit cautious over the years to demand such extra miles ;o)

@DRovara
Copy link
Collaborator Author

DRovara commented May 15, 2025

Alright, I'm not sure if this is the most idiomatic/cleanest way to do it (would be cool if you could have another look at it @burgholzer), but this solution seems to work.

I use git ls-remote --tags https://github.com/llvm/llvm-project.git "llvmorg-${{ matrix.llvm-version }}.*", that allows us to check the tags without needing to clone the repo. Then we extract the newest revision for the given version using string manipulation, and use that as key for the cache.

The changes in the build system (maybe the move away from ninja?) also made it so that quantum-opt was no longer found by the check-quantum-opt target. This is because check-quantum-opt calls lit which in turn calls bash.exe which has different system variables than the remaining PowerShell instance. The workaround to that was to define a new script called quantum-opt that's globally accessible and calls the built quantum-opt. Not super clean, but I'm not sure if there's a better solution.

DRovara added 2 commits May 16, 2025 10:16
…her testing

The cache will only be stored if an action passes. Therefore, to be able to do further testing, we first run the ci without the problematic step.
@DRovara DRovara requested a review from burgholzer May 19, 2025 10:31
Copy link
Member

@burgholzer burgholzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work on this @DRovara 🙏🏼
The test execution command looks slightly cryptic to me, but I currently do not have the time myself to search for better ways of runnning the tests and this seems to work.

I think some of these commands would potentially benefit from

shell: bash

because then the syntax is much more uniform between the systems.

Let's tackle this in a potential follow-up PR though and get this in 😌

@burgholzer burgholzer merged commit 3e39a9a into main May 19, 2025
18 checks passed
@burgholzer burgholzer deleted the mlir/ci/windows branch May 19, 2025 14:49
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Core May 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
continuous integration Anything related to the CI setup MLIR Anything related to MLIR
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

👷 MLIR - Set up Windows CI
2 participants