spcl / spcl/dace

SDFG -> Schedule Tree: Dealiasing fails on array access as a function parameter

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

Description

Reproducer, with inline comments showing working patterns and the failing one.

Non-urgent as this can be side-stepped.

```python
import numpy as np
import dace

def fn(field_to_copy):
field_to_copy[0, 0] = field_to_copy[0, 1]
field_to_copy[1, 1] = field_to_copy[1, 2]

@dace.program
def my_program(out_field):
# Works
out_field[0, 0, :] = out_field[0, 1, :]
out_field[1, 1, :] = out_field[1, 2, :]
# Works
out_field[0, 0, :] = np.where(out_field[0, 0, :] > 0, out_field[0, 1, :], out_field[0, 1, :])
for k in dace.map[0 : 5]:
# Works
tmp = out_field[:, :, k]
fn(tmp)
# Fails
fn(out_field[:, :, k])

if __name__ == "__main__":
domain = (2, 2, 5)

i_arr = np.ones(domain)
o_arr = np.ones(domain)

sdfg = my_program.to_sdfg(o_arr)

sdfg.as_schedule_tree()

print("Done 🚀")
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.