Skip to content

✨ Initial implementation of the mqtdyn Dialect #900

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 30 commits into from
Apr 9, 2025

Conversation

DRovara
Copy link
Collaborator

@DRovara DRovara commented Apr 3, 2025

Description

This pull request migrates the incomplete implementation of the mqtdyn Dialect from the internal repository and finishes the implementation.

The initial implementation was done by @ystade.

It also contains one initial transformation pass, constant-folding, to set up the transformation infrastructure.


At the same time, it also defines CommonTraits.td/CommonTraits.h, a collection of Traits that are applicable even outside the bounds of a single dialect. These traits replace verification methods of indiidual operations to reduce duplicate code.

There is still sole degree of code duplication. This will be further explored in a later PR.

Checklist:

  • The pull request only contains commits that are related to it.
  • I have added appropriate tests and documentation.
  • I have made sure that all CI jobs on GitHub pass.
  • The pull request introduces no new warnings and follows the project's style guidelines.

@github-project-automation github-project-automation bot moved this to In Progress in MQT Core Apr 3, 2025
@DRovara DRovara added enhancement New feature or request c++ Anything related to C++ code MLIR Anything related to MLIR labels Apr 3, 2025
@burgholzer
Copy link
Member

Before merging, we should consider the following question: There is quite a lot of shared code (e.g., consider MQTDynTraits.h and MQTOptTraits.h). Are we okay with that or do we want to reuse some code? In case we want more reuse, we probably need to implement some data structures that are shared over the different dialects; the examples above both use their respective dialect's UnitaryInterface implementation. Alternatively, maybe C++ templates also do the trick.

I haven't really looked through the code in detail, but in general I would argue that we are currently at a point where we should really try to find the cleanest possible design for what we plan to do. Right now, the code base is still small enough and has no dependents so that we can (more or less) easily make big breaking changes. With every PR that grows the MLIR part, this becomes harder and harder.
That being said, I would very much like to avoid redundancy wherever possible.
If we already need to duplicate quite some code while the code base is small, this is not really a good indication for the general design at the moment. So let's strive for making this as clean as possible.

If I am not mistaken, traits and interfaces are not necessarily bound to a particular dialect, are they? So we could be sharing (elements of) them across dialects?
Any other particular suggestions for keeping it simple here?

Copy link

codecov bot commented Apr 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@DRovara DRovara requested review from burgholzer and ystade and removed request for ystade April 8, 2025 13:41
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.

Hey @DRovara 👋🏻
Thanks for all your work on this. This is looking great.
All the feedback is truly minor and should be easy to address.
Looking forward to merging this once everything is addressed 🙂
And to try to reduce the duplication a little more across these files.

@DRovara DRovara requested a review from burgholzer April 9, 2025 10:28
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.

This looks great. Just one more minor nit.

@DRovara DRovara requested a review from burgholzer April 9, 2025 12:57
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.

Great 👍🏻 thanks for also adding the Changelog entry 🙂

@burgholzer burgholzer merged commit cc1797c into main Apr 9, 2025
30 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in MQT Core Apr 9, 2025
@burgholzer burgholzer deleted the mlir/feat/mqt-ref-dialect branch April 9, 2025 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Anything related to C++ code enhancement New feature or request MLIR Anything related to MLIR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants