dace icon indicating copy to clipboard operation
dace copied to clipboard

SDFG contains unnecessary intermediate transient

Open hodelcl opened this issue 2 years ago • 1 comments

Describe the bug SDFG contains unnecessary intermediate transient. Might be an issue with the Python frontend.

To Reproduce Steps to reproduce the behavior:

  1. Run the following Python code:
import dace as dc

@dc.program
def example_sdfg(x: dc.float64[10], y: dc.float64[10]):
    x[0] += y[0]

sdfg = example_sdfg.to_sdfg()
sdfg.simplify()
sdfg.view()
  1. Investigate the produced SDFG (produces SDFG as seen in screenshot).

Expected behavior I expect to get the same SDFG but without the transient __tmp0 AccessNode and the y[0] memlet flowing directly into the tasklet.

Screenshots Screenshot of the produced SDFG: Screenshot from 2023-10-04 12-20-34

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • DaCe version: 0.14.4 (current main branch)
  • Python version: 3.8

hodelcl avatar Oct 04 '23 10:10 hodelcl

My suggestion would be to debug the ArrayElimination pass with your example and see why RedundantSecondArray doesn't apply on y -> __tmp0. Then, we can discuss if the conditions are too conservative or if there are good reasons/concerns for the current behavior.

alexnick83 avatar Oct 04 '23 11:10 alexnick83