spcl / spcl/dace

Simplify Removes Arrays Used Only For Indirect Accesses

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

Description

I have a case of simplify failing.

This SDFG computes:

Image

```
@dace.program
def scatter_store(A: dace.float64[N], idx: dace.int64[N], B: dace.float64[N], scale: dace.float64):
for i, in dace.map[0:N:1]:
B[idx[i]] = A[i] * scale
```

Then I have a vectorized variant that does:
```
@dace.program
def scatter_store(A: dace.float64[N], idx: dace.int64[N], B: dace.float64[N], scale: dace.float64):
for i, in dace.map[0:N:8]:
B_buf[0:8] = A[i:i+8] * scale
indices[0:8] = idx[i:i+8]
B[indices[0:8] = B_buf[0:8]
```

In this case `idx` is used only on an interstate edge and it gets removed.
This is the pattern that causes it:
Image

SDFGs are attached:
[scatter_store.sdfg.json](https://github.com/user-attachments/files/24135906/scatter_store.sdfg.json)

[scatter_store_vec.sdfg.json](https://github.com/user-attachments/files/24135909/scatter_store_vec.sdfg.json)

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.