-
Notifications
You must be signed in to change notification settings - Fork 50
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[next][dace]: Fix array subset on the branches of if-expressions #1912
Conversation
else: | ||
# TODO(edopao): this is a workaround for some IR nodes where the inferred | ||
# domain on a tuple of fields is not a tuple, see `test_execution.py::test_ternary_operator_tuple()` | ||
domain_tree = gtx_utils.tree_map(lambda _: node.annex.domain)(symbol_tree) |
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.
@tehrengruber I am using a workaround because domain inference does not create a tuple, as expected, in test_execution.py::test_ternary_operator_tuple()
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.
As agreed, I am going to use an API to correctly retrieve the annex domain when it is available.
.../next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
.../next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
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.
There are some things that should be changed (especially the sharing of some variables used as subset) but there is nothing big.
However, we should wait for the feedback of Till.
.../next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
.../next_tests/unit_tests/program_processor_tests/runners_tests/dace_tests/test_gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/gtir_builtin_translators.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/gtir_builtin_translators.py
Show resolved
Hide resolved
dbe2ffc
to
bf48f00
Compare
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.
From my side it looks okay, but I would wait for Till's feedback.
Thanks for the review. I have already discussed the domain inference problems with Till, there will be some utility functions to get the tuple domain (and the domain range in general, which might be useful in multiple places of the SDFG lowering). |
The issue was discovered by Philip (@philip-paul-mueller).
The lowering of if-expressions has to ensure that all branches (e.g. if/then states) write the same subset to the result array. This was not the case in baseline when one the branches contained a simple expression such as
{dwdx, dwdy}
. The bug was that the full shape of the global fields was copied into the result array, although the result array was allocated on a sub-domain. This caused an out-of-bound write and a segfault.