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

mlir printing and parsing fix #199

Merged
merged 5 commits into from Jan 9, 2023
Merged

mlir printing and parsing fix #199

merged 5 commits into from Jan 9, 2023

Conversation

martin-luecke
Copy link
Collaborator

  • fix mlir parsing of symbol_ref, e.g.
"some.mlirop"() {symbol = @some_symbol} : () -> ()
  • fix mlir printing of tensors with unknown sizes
    Now printed as tensor<?x128xf32> instead of tensor<-1x128xf32>.
    This is required for reparsing with mlir-opt

Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

Looks good!
Can you just add two tests for the printing and parsing of these things?
Also, is the printing of the FlatSymborRefAttr implemented right now?

@martin-luecke
Copy link
Collaborator Author

@math-fehr In which test file do you suggest to put the tests?
I see the other mlir printing/parsing tests are in `tests/filecheck/mlir-conversion/builtin_attrs.mlir'.
I think that is not a good option as these tests are disabled when the C++ mlir python bindings are not found. (e.g. on my machine these tests are currently not run). The mlir printing/parsing does not require the mlir bindings so I think we should move all mlir printing/parsing tests to another location

@math-fehr
Copy link
Collaborator

@math-fehr In which test file do you suggest to put the tests? I see the other mlir printing/parsing tests are in `tests/filecheck/mlir-conversion/builtin_attrs.mlir'. I think that is not a good option as these tests are disabled when the C++ mlir python bindings are not found. (e.g. on my machine these tests are currently not run). The mlir printing/parsing does not require the mlir bindings so I think we should move all mlir printing/parsing tests to another location

Right, I'll make a PR to fix this issue, which will start executing this file.
Otherwise, I would put it in tests/filecheck/mlir-conversion/builtin_attrs.mlir in the meantime, I fixed the file in my other PR.

@tobiasgrosser
Copy link
Contributor

Hey @martin-luecke, is this PR still open? Is this sth we should tackle during the hackathon?

@codecov
Copy link

codecov bot commented Jan 9, 2023

Codecov Report

Base: 86.60% // Head: 88.80% // Increases project coverage by +2.20% 🎉

Coverage data is based on head (77272c0) compared to base (5f870d1).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   86.60%   88.80%   +2.20%     
==========================================
  Files          47       48       +1     
  Lines        6586     6603      +17     
  Branches     1107     1109       +2     
==========================================
+ Hits         5704     5864     +160     
+ Misses        650      504     -146     
- Partials      232      235       +3     
Impacted Files Coverage Δ
xdsl/parser.py 83.50% <100.00%> (+0.32%) ⬆️
xdsl/printer.py 95.58% <100.00%> (ø)
tests/xdsl_opt/test_xdsl_opt.py 100.00% <0.00%> (ø)
xdsl/irdl_mlir_printer.py 92.04% <0.00%> (+22.72%) ⬆️
xdsl/xdsl_opt_main.py 77.64% <0.00%> (+57.64%) ⬆️
xdsl/dialects/cmath.py 85.18% <0.00%> (+85.18%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

- fix mlir parsing of symbol_ref
- fix mlir printing of tensors with unknown sizes
@math-fehr math-fehr self-requested a review January 9, 2023 16:57
Copy link
Collaborator

@math-fehr math-fehr left a comment

Choose a reason for hiding this comment

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

Perfect!

@math-fehr math-fehr added dialects Changes on the dialects hackathon To be tackled at the hackathon and removed hackathon To be tackled at the hackathon labels Jan 9, 2023
@math-fehr math-fehr merged commit e5d03ea into main Jan 9, 2023
@math-fehr math-fehr deleted the mlir_parsing_printing_fix branch January 9, 2023 16:58
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.

None yet

4 participants