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

dialects: (bufferization) Simplify tensor/memref constraint #3475

Merged
merged 3 commits into from
Nov 19, 2024

Conversation

alexarice
Copy link
Collaborator

Removes the TensorMemrefInferenceConstraint in favour of a simpler TensorFromMemrefConstraint.

@alexarice alexarice requested a review from superlopuh November 19, 2024 11:51
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.28%. Comparing base (122b497) to head (b335b61).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
+ Coverage   90.27%   90.28%   +0.01%     
==========================================
  Files         462      462              
  Lines       57845    57860      +15     
  Branches     5565     5563       -2     
==========================================
+ Hits        52218    52240      +22     
+ Misses       4190     4187       -3     
+ Partials     1437     1433       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

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

LGTM

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
if isa(attr, UnrankedTensorType[Attribute]):
memref_type = UnrankedMemrefType.from_type(attr.element_type)
return self.memref_constraint.verify(memref_type, constraint_context)
raise VerifyException(f"Expected TensorType or UnrankedTensorType, got {attr}")
Copy link
Member

Choose a reason for hiding this comment

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

worth adding a test for this?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's probably OK to merge without this but if it's quick and easy it would catch this sort of thing in the future, hopefully

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added an array of tests

@superlopuh superlopuh added the dialects Changes on the dialects label Nov 19, 2024
@alexarice alexarice requested a review from superlopuh November 19, 2024 15:00
Copy link
Member

@superlopuh superlopuh left a comment

Choose a reason for hiding this comment

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

Beautiful

@alexarice alexarice merged commit 9af842f into main Nov 19, 2024
15 checks passed
@alexarice alexarice deleted the alexarice/tensor-constraint-simpl branch November 19, 2024 15:30
EdmundGoodman pushed a commit to EdmundGoodman/xdsl that referenced this pull request Dec 6, 2024
…ect#3475)

Removes the `TensorMemrefInferenceConstraint` in favour of a simpler
`TensorFromMemrefConstraint`.

---------

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants