spcl / spcl/dace

SDFG contains unnecessary intermediate transient

Open
#1,382 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
593
Forks
163
Avg merge
2d 23h
Merged PRs (30d)
60

Description

**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:
```Python
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()
```
2. 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](https://github.com/spcl/dace/assets/111381329/325f1026-c2b5-45ae-a623-2763874149d7)

**Desktop (please complete the following information):**
- OS: Ubuntu 20.04
- DaCe version: 0.14.4 (current main branch)
- Python version: 3.8

Contributor guide

Open the contributing guide

Research direction

Start by running the provided Python example with DaCe 0.14.4 or current main, then inspect the SDFG after example_sdfg.to_sdfg() and sdfg.simplify(). Trace how the transient __tmp0 is produced and compare the resulting memlet flow with the expected direct y[0] connection. Done means the unnecessary AccessNode is absent and y[0] flows directly into the tasklet.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.