Skip to content
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

core: Properties vs Attributes #3260

Open
alexarice opened this issue Oct 8, 2024 · 11 comments
Open

core: Properties vs Attributes #3260

alexarice opened this issue Oct 8, 2024 · 11 comments
Labels
core xDSL core (ir, textual format, ...)

Comments

@alexarice
Copy link
Collaborator

At some point mlir switched over from using attributes to properties, but still calls everything an Attribute in tablegen. As a result, there are a lot of places where we are using attr_def where we should likely be using prop_def.

Would it be worth spending a morning/day to update all of these?

@superlopuh
Copy link
Member

Could you please rephrase this issue in terms of an actionable thing to do? I'm not sure how urgent this is since both MLIR and xDSL are quite lenient when it comes to people putting things in the wrong place, like attributes in properties and vice versa

@alexarice
Copy link
Collaborator Author

The actionable thing to do would be to transition from using an attribute to a property when MLIR uses a property. Personally, I feel that this is worthwhile in order to keep the generic syntax the same between both libraries.

@math-fehr
Copy link
Collaborator

I think this needs to happen at the same time that we are doing an MLIR update. Updating it without updating MLIR is a bit weird, even though there is a conversion between properties and attributes by default.

@alexarice
Copy link
Collaborator Author

What do you mean by "conversion between properties and attributes by default"?

@math-fehr
Copy link
Collaborator

If you parse an operation with an attribute "a" when a property "a" is expected, the attribute is transformed into a property.

@alexarice
Copy link
Collaborator Author

In mlir or xdsl

@math-fehr
Copy link
Collaborator

Both

@alexarice
Copy link
Collaborator Author

Ah ok, maybe this is less of an issue than I thought then, though the difference between the two still annoys me

@math-fehr
Copy link
Collaborator

Yeah I agree, we should try to update MLIR soon, so we can resolve this issue.
I won't really have time until PLDI (mid november), but I could take a look after for updating it.

@alexarice
Copy link
Collaborator Author

Would be good to make a list of the subtasks that need to be done. The main one I'm aware of is updating scf.parallel/scf.reduce. Do you know which commit you want to aim for?

@math-fehr
Copy link
Collaborator

I would just take one of the latest commits that pass, and see what breaks in our tests.
Besides that, I don't think there is a fundamental change in MLIR core that we have to handle, so I think it should just be a matter of fixing some dialect tests.

@superlopuh superlopuh changed the title Properties vs Attributes core: Properties vs Attributes Nov 20, 2024
@superlopuh superlopuh added the core xDSL core (ir, textual format, ...) label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

No branches or pull requests

3 participants