-
Notifications
You must be signed in to change notification settings - Fork 49
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
feat[next][dace]: iterator-view support to DaCe backend #1790
Conversation
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.
It looks good, there are some issues I see, but it looks good.
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.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.
Thank you for the review comments, I tried to address most of them.
src/gt4py/next/program_processors/runners/dace_common/workflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.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 is the aspect of naming variables, i.e. the centralized naming stuff, I am not really happy.
The result looks good.
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_builtin_translators.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.
I have two final remarks about, most importantly I think that an add_temp_array()
function is missing and we should no longer generate __tmp
names, but turn them differently.
Then there is something that I think is a bit inconsistent.
self, sdfg: dace.SDFG, dtype: dace.dtypes.typeclass | ||
) -> tuple[str, dace.data.Scalar]: | ||
"""Add a temporary scalar to the SDFG.""" | ||
temp_name = sdfg.temp_data_name() |
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.
- To fully avoid the renaming problem, you should perform here the renaming, i.e.
__tmp
->__gtit_tmp
, also add a note to why this is done. - It looks rather strange that there is no
add_temp_array()
because they suffer from the same problem. Furthermore, it is just strange if that method is missing.
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.
- The renaming problem was solved, the renaming of DaCe data containers was removed in the first place. All temporaries that are added during the lowering are safe to be
__tmp
dace transients. The GTIR temp symbols generated by the SSA pass are renamed intogtir_tmp
before starting the lowering. - I have added the helper method
add_temp_array()
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.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.
LGTM
src/gt4py/next/program_processors/runners/dace_fieldview/gtir_dataflow.py
Outdated
Show resolved
Hide resolved
…1824) The implementation of scan field operator introduced a bug in the lowering of if-statements to SDFG. The scan requires extended lowering support for iterator view, therefore #1790 introduced the lowering of local-if with exclusive branch execution. However, attention was not paid to enable the exclusive behavior of if-expressions only in iterator view, that is only in the scope of scan field operators. Regular field operators should instead lower if-expressions to a tasklet, because the field view behavior is that of a local select.
The lowering of scan to SDFG requires the support for iterator view. This PR introduces a subset of iterator features:
if_
with exclusive branch executionlist_get
,make_tuple
andtuple_get
in iterator viewIterator tests are enabled on dace CPU backend without SDFG transformations (
auto_optimize=False
).