-
Notifications
You must be signed in to change notification settings - Fork 51
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[dace][next]: Updated Array Removal Transformations #1915
Merged
philip-paul-mueller
merged 9 commits into
GridTools:main
from
philip-paul-mueller:updated-self-copy-removal
Mar 20, 2025
Merged
feat[dace][next]: Updated Array Removal Transformations #1915
philip-paul-mueller
merged 9 commits into
GridTools:main
from
philip-paul-mueller:updated-self-copy-removal
Mar 20, 2025
+464
−38
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Which handles a special case of the self copy elimination transformation, that should actually be merged with this one.
The function can now handle more complicated situations, especially if there are multiple paths between the two `G` nodes, i.e. either connected directly or through the temporary node.
…ation` transfotmation.
It is no longer needed that the whole array is read. There is no a new heuristic allows to detect some chases where it is also possible.
edopao
reviewed
Mar 18, 2025
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Show resolved
Hide resolved
edopao
reviewed
Mar 18, 2025
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Show resolved
Hide resolved
It adds a new mode to the direct remover, which fully splits the two nodes.
philip-paul-mueller
added a commit
to philip-paul-mueller/gt4py
that referenced
this pull request
Mar 19, 2025
This [issue](spcl/dace#1959) leaded to some problem, especially in ICON4Py stencil `39_to_40`. However, through an [update](GridTools#1915) in GT4Py this leads to now to other problems (`ConstantPropagation` involving AcccessNodes) in `19_to_20`. The underlying issue in DaCe was solved in [PR#1980](spcl/dace#1980) and this PR now deactivate the workaround. Only merge if the DaCe dependency in GT4Py was updated to include that fix.
@edopao Can we merge this PR? |
edopao
reviewed
Mar 20, 2025
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Show resolved
Hide resolved
edopao
approved these changes
Mar 20, 2025
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/transformations/redundant_array_removers.py
Show resolved
Hide resolved
philip-paul-mueller
added a commit
that referenced
this pull request
Mar 24, 2025
This [issue](spcl/dace#1959) leaded to some problem, especially in ICON4Py stencil `39_to_40`. However, through an [update](#1915) in GT4Py this leads to now to other problems (`ConstantPropagation` involving AcccessNodes) in `19_to_20`. The underlying issue in DaCe was solved in [PR#1980](spcl/dace#1980) and this PR now deactivate the workaround. It also updates the version of DaCe.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates how the redundant array removal transformations works.
First of all it updates the "self copy" transformation, i.e. where information is copied from global memory into global memory, either directly or indirectly.
Because of ADR-18 we know that we can simply remove such connections without doing an elaborated analysis.
There are two different transformations, that handles the case of a self copy in the same state (there is also one that handles them across multiple states):
SingleStateGlobalSelfCopyElimination
: This transformation was there before. It essentially handles the pattern(G) -> (T) -> (G)
, i.e. the write is not direct but involves an intermediate. The transformation was updated to handle more cases.SingleStateGlobalDirectSelfCopyElimination
: This transformation was newly added, it essentially handles the following pattern(G) -> (G)
, i.e. there is no temporary data involved.In the long run these two transformation should be combined.
In addition the
CopyChainRemover
was updated.Before it was required that the whole array, that should be removed, henceforth called
A1
, was read, however, in some cases this could not be checked symbolically.To handle these cases, a new heuristic was implemented, which assumes a certain behavior of the domain interference, i.e. that all arrays are as small as possible, i.e. nothing that is not needed is computed.