-
Notifications
You must be signed in to change notification settings - Fork 129
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
Fixed RedundantArray
's handling of "reshaping" Memlets
#1603
Fixed RedundantArray
's handling of "reshaping" Memlets
#1603
Conversation
e3f6cfe
to
59120ae
Compare
I also verified that without the fix the test will fail.
8e4ca85
to
7ea9a62
Compare
It essentially creates a special case for it and applies then the correct way. This is not very good but it works and I have no better solution.
This is for investigate why the CI fails. After this commit all tests except the one I had added should pass. And NOAA which should also fail. This reverts commit 742568d.
This reverts commit 8ec3c58.
@philip-paul-mueller please rename the title, this is unclear. Even "Fix for issue #1595" is a better name. |
RedundantArray
's handling of "reshaping" Memlets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the first/input array has multiple incoming edges? It looks like the transformation will apply as before your fix and produce a similar error. You don't need to make the transformation work on such corner cases, but maybe it should not match those cases in the first place. How about refactoring the new login into a separate helper method and calling it also in can_be_applied
?
I like that idea. |
… handles the reshaping case but simply ignore it. I put everything inside a helper function.
In the previous versions I tried to simply ignore the reshaping Memlet case, however, this break other tests. In this version reshaping Memlets are not turned into a view, i.e. the source array is not removed but turned into a view. This fixed the other tests again. It is not the best solution but it works.
A reshaping memlet must change the shape of a datacontainer. However, in the old version also the total size was considered. Which is not fully correct, as the total size is more related to the memory layout and not to the "computational domain".
I enabled the simplify pass in commit `411bd7bd` and it worked locally. However, this was because I was not running it inside nox and using my own version of DaCe. The bug in simplify was fixed in [PR#1603](spcl/dace#1603) which was merged _after_ 16.1 was released, thus the fix is not avaliable.
This PR fixes an issue that was reported as issue 1595, that was traced back to
RedundantArray
.The commit adds a deterministic test, unlike the one in the issue, that fails without the fix.
The underlying problem is, that the transformation does not correctly handle a Memlet that performs a reshaping.
This commit does not really solves the issue, instead it adds a special case for this particular case and then handles it correctly as I was unable to modify the code to handle it correctly.
It is not a nice solution, but it works.