-
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
Fix codegen with data access on inter-state edge #1434
Conversation
After uplift to dace v0.15, one SDFG which was working before started to show compilation errors. The latest DaCe is moving a data access to an inter-state edge. For the data-access, the symbols that define array strides are needed for code generation. The SDFG was validated, before and after the simplify pass, but it did not compile for CPU. When skipping the simplify pass, the compilation did work. The problem has been narrowed down to the scalar-to-symbol promotion, which is moving a data access to an inter-state edge. Then, the method _used_symbols_internal needs to be update to account for data containers, including symbolic shape and strides. This commit contains a unit test to reproduce the issue and verify the proposed fix.
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.
Hey, sorry for the delayed review. I briefly talked with Tal, and the changes to DaCe are very good. Thanks a lot for that!
I would like to make some suggestions to the test:
- Move the test to this file:
tests/codegen/codegen_used_symbols_test.py
- Try to reduce the test-case. Particularly, build the SDFG directly instead of starting with a different SDFG and then applying transformations until you reach the SDFG that triggers the bug
Regarding (2), I am worried that if the transformations change, then that might nullify the test. We don't really want to test the transformations here (most of the assert
s just check that the test should work correctly).
Unit-test reduced to reproduce the origin of this issue. Also, unit-test moved to codegen test file.
@BenWeber42 Thank you for the review. Very good comment, I totally agree. I had focused my test more on the trigger of this issue rather than on its cause. I have pushed a commit where I apply the changes you proposed. |
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.
Thanks for the changes! Yea, I often also forget about the tests once I start focusing on the actual changes. But now the test is really nice 👌
After uplift to dace v0.15, one SDFG which was working before started to show compilation errors. The latest DaCe is moving a data access to an inter-state edge. For the data-access, the symbols that define array strides are needed for code generation. The SDFG was validated, before and after the simplify pass, but it did not compile for CPU. When skipping the simplify pass, the compilation did work. The problem has been narrowed down to the scalar-to-symbol promotion, which is moving a data access to an inter-state edge. Then, the method
_used_symbols_internal
needs to be update to account for data containers, including symbolic shape and strides.This issue was reported in #1433. This PR contains a unit test to reproduce the issue and verify the proposed fix.