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

fix[next][dace]: Use constant shape for neighbor tables in local dimension #1422

Merged
merged 20 commits into from
Jan 25, 2024

Conversation

edopao
Copy link
Contributor

@edopao edopao commented Jan 24, 2024

Description

Main purpose of this PR is to avoid the definition of shape symbols for array dimensions known at compile time. The local size of neighbor connectivity tables falls into this category. For each element in the origin dimension, the number of elements in the target dimension is defined by the attribute max_neighbors in the offset provider.

Some side changes included in the PR:

  • In the hash function for the build cache, include max_neighbors and other attributes of NeighborTable offset providers.
  • In the hash function for the build cache, include the build type (debug, release, etc.).
  • Replace itir_embedded.NeighborTableOffsetProvider with generic type common.NeighborTable in type annotations.
  • Optimize list_get for the case where the index is a SymbolExpr, simply use a memlet.
  • Optimize neighbor reduction for the case with has_skip_values == False, do not generate the can_deref check.
  • Rename parameter conn_names to connectivity_names.

@edopao edopao marked this pull request as ready for review January 24, 2024 13:33
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.

The changes looks very good, however, there are some small changes and clarification needed.
The majority is that you should change expressions like for k, _ in dict().item() to for k in dict().keys(), which makes things clearer.

@edopao edopao merged commit ac0478a into GridTools:main Jan 25, 2024
26 checks passed
@edopao edopao deleted the dace-fix-symbols branch January 25, 2024 12:01
philip-paul-mueller added a commit to philip-paul-mueller/gt4py that referenced this pull request Jan 31, 2024
In PR GridTools#1422 @edopao introduced a mechanism to skip the SDFG translation.
This PR moves this cache from the `run_dace_iterator()` function into the `build_sdfg_from_itir()` function.
philip-paul-mueller added a commit that referenced this pull request Feb 1, 2024
In PR #1422 @edopao introduced a mechanism to skip the SDFG translation.
This PR moves this cache from the `run_dace_iterator()` function into the `build_sdfg_from_itir()` function.
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