Skip to content
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]: Support for sparse fields and reductions over lift expressions #1377

Merged
merged 9 commits into from
Dec 4, 2023

Conversation

edopao
Copy link
Contributor

@edopao edopao commented Nov 30, 2023

Description

This PR adds support to DaCe backend for sparse fields and reductions over lift expressions.

The DaCe backend is configured with full-inlining of lifts in ITIR. An additional option is enabled, in combination with reduce-unroll, to fully inline lambda-like arguments. This option is required because the ITIR visitor in the DaCe backend is not able to translate reductions over lift expressions.

The inlined ITIR could contain the list_get operator. This PR adds translation capability for thelist_get operator.

In icon4py stencils, list_get is proceeded by the deref operator, in order to extract a 1D slice out of a multi-dimensional field. Baseline only supported deref operator on full-domain index, that returns a scalar value. When the deref indexing is partial, deref will return a 1D or ND slice from the original field, and the return type should be array. Therefore, this PR also adds support for deref with array return.

Requirements

@edopao edopao changed the title feat[next]: Add DaCe support for sparse fields and reduction over lift expressions feat[next]: DaCe support for sparse fields and reduction over lift expressions Nov 30, 2023
@edopao edopao changed the title feat[next]: DaCe support for sparse fields and reduction over lift expressions feat[next]: DaCe support for sparse fields and reductions over lift expressions Nov 30, 2023
Copy link
Contributor

@philip-paul-mueller philip-paul-mueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my first one. Further, I have one or two off topic questions, things that just pop up in my mind and would like to ask.

@edopao
Copy link
Contributor Author

edopao commented Dec 1, 2023

@philip-paul-mueller Thank you for the review, I have tried to address your comments. Please check again.

@edopao edopao changed the title feat[next]: DaCe support for sparse fields and reductions over lift expressions feat[next][dace]: support for sparse fields and reductions over lift expressions Dec 4, 2023
@edopao edopao changed the title feat[next][dace]: support for sparse fields and reductions over lift expressions feat[next][dace]: Support for sparse fields and reductions over lift expressions Dec 4, 2023
Comment on lines -517 to -522
dace.symbol(unique_var_name() + "__shp", dace.int64),
dace.symbol(unique_var_name() + "__shp", dace.int64),
)
strides = (
dace.symbol(unique_var_name() + "__strd", dace.int64),
dace.symbol(unique_var_name() + "__strd", dace.int64),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the add_storage function we also create such variables, but we name them shape and stride.
We should use the same words in both functions. However, since they were part of #1379 I will change them there.

@edopao edopao marked this pull request as ready for review December 4, 2023 08:14
@edopao edopao merged commit b1f9c9a into GridTools:main Dec 4, 2023
@edopao edopao deleted the dace-sparse_fields branch December 4, 2023 08:15
philip-paul-mueller added a commit to philip-paul-mueller/gt4py that referenced this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants