Skip to content

fix[next-dace]: skip partially written temporaries in DistributedBufferRelocator - #2812

Open
edopao wants to merge 2 commits into
GridTools:mainfrom
edopao:dace-buffer-relocator-partial-write-back
Open

fix[next-dace]: skip partially written temporaries in DistributedBufferRelocator#2812
edopao wants to merge 2 commits into
GridTools:mainfrom
edopao:dace-buffer-relocator-partial-write-back

Conversation

@edopao

@edopao edopao commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Problem

The stree lowering of concat_where emits 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_candidates scans such write-back states and assumes the transient's write-back node is a pure sink, requiring write_back_state.in_degree(write_back_node) == 0. On the concat_where pattern the write-back node also has an incoming edge (the partial write in the same state), so gt_simplify crashed with an AssertionError (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

  • New regression test test_distributed_buffer_partial_write_back builds an SDFG with the partial-write-in-write-back-state pattern and asserts that gt_reduce_distributed_buffering no longer crashes, records no DistributedBufferRelocator relocation, and leaves the state intact.
  • The full transformation_tests/test_distributed_buffer_relocator.py suite passes (8 tests).

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.

1 participant