fix[next-dace]: skip partially written temporaries in DistributedBufferRelocator - #2812
Open
edopao wants to merge 2 commits into
Open
fix[next-dace]: skip partially written temporaries in DistributedBufferRelocator#2812edopao wants to merge 2 commits into
edopao wants to merge 2 commits into
Conversation
This file contains hidden or 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
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.
Problem
The stree lowering of
concat_whereemits a transient array that is partially written in two consecutive SDFG states, and the second state also copies the transient to a global array (its "write-back" state).DistributedBufferRelocator._find_candidatesscans such write-back states and assumes the transient's write-back node is a pure sink, requiringwrite_back_state.in_degree(write_back_node) == 0. On theconcat_wherepattern the write-back node also has an incoming edge (the partial write in the same state), sogt_simplifycrashed with anAssertionError(observed e.g. on ICON OIR programs). Per ADR-018 a transient must be written within a single state, but the relocator must not crash while other passes handle such patterns.Fix
A temporary whose write-back node is also written in the write-back state (i.e.
state.in_degree(temp_storage) != 0) is simply not treated as a relocation candidate and is left untouched.Tests
test_distributed_buffer_partial_write_backbuilds an SDFG with the partial-write-in-write-back-state pattern and asserts thatgt_reduce_distributed_bufferingno longer crashes, records noDistributedBufferRelocatorrelocation, and leaves the state intact.transformation_tests/test_distributed_buffer_relocator.pysuite passes (8 tests).