-
Notifications
You must be signed in to change notification settings - Fork 127
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
SubToSubView
canonicalization disabled
#141
Comments
I was actually about to poke you regarding that. There was an incompatibility with a recent LLVM rebase that I hadn't tracked down. Would you be take a look at re-enabling? |
hmm... simply re-enabling the canonicalization seems to work fine for my use cases 🤔.. |
Let me see if I can reproduce the issue (it has since been rebased again). If I recall, the issue was that the subview op would produce a different memref type (e.g. one with an affine map), which would be illegal to replace the original result type with. |
Looks like i encountered the issue myself.
yields
The issue seems to be that the following is no longer considered valid: %2 = memref.subview %1[%arg0, 0] [1, 100] [1, 1] : memref<10x100xi32> to memref<100xi32> Looks like |
This smells like something from a thread I remember from last year. Specifically this comment: https://llvm.discourse.group/t/memref-subview-affine-map-and-symbols/4851/9. This is the patch in question: llvm/llvm-project@d69f5e1. The error message here (mismatch of result layout) seems to hint that we hit the new condition. I don't have any idea what the appropriate solution is offhand, but hopefully this helps. |
I think the issue here partially stems from the fact that to create a consistent type system, we need to have offset operations that maintain the same type. It looks like (upstream) subview does not maintain this property, and thus why we created subindex. I had a chat with @ftynse yesterday about this and I think we came to the conclusion that subindex is technically distinct from various upstream view-like operations. We (along with @chelini and @kumasento) had a discussion about upstreaming the op a while ago, but ended up working on other things and not pushing that through. @mortbopet what precisely is your requirement behind not using this non-upstream op. Would your problem be mitigated by telling your downstream tool about the op or potentially would you have the cycles to look into upstreaming it (we even have lowering to LLVM/canonicalizations/etc that would be nice if they could be made upstream)? |
@wsmoses it's driven from a desire that i have to run various other |
Ah, what I meant by the conversion to LLVM is that presumably upstream wouldn't take a new op unless it could be lowered to LLVM (which happily this can be) -- not that you should do the lowering of that op first. It then sounds like you can either run polygeist-opt (which should contain various base MLIR transforms -- but now with polygeist registered as a dialect), or perhaps look into upstreaming the op? |
I see... I'll just investigate whether i can get my flow to work by enabling |
Noticed that the
SubToSubView
canonicalization was disabled in a recent commit:https://github.com/wsmoses/Polygeist/blob/main/lib/polygeist/Ops.cpp#L681
What was the reason for this? If it is interfering with the application order of the other canonicalization patterns, should it instead be moved to a separate pass?
I'm asking because for my use-case (and i presume in general) it's fairly important that the Polygeist dialect operations have been lowered to that available in upstream MLIR.
The text was updated successfully, but these errors were encountered: