Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad dependency resolution in nested map #1445

Open
luigifusco opened this issue Nov 24, 2023 · 0 comments
Open

Bad dependency resolution in nested map #1445

luigifusco opened this issue Nov 24, 2023 · 0 comments

Comments

@luigifusco
Copy link

The simple program

@dace.program
def bug(mat: dace.int32[N,N]):
    buff = np.zeros_like(mat)
    for i in dace.map[0:N]:
        for j in dace.map[0:N]:
            buff[i, j] = mat[i, j] * 2
        for j in dace.map[0:N-1]:
            mat[i, j] = buff[i, j]

will result in the following wrong simplified sdfg:
image
where the assign tasklet is a simple assignment operator, copying buff to mat

The issue does not happen if the two ranges of the internal maps (the ones with variable j) iterate over the same range. In the unsimplified nested sdfg representing the scope of the outer map (variable i) both buff and mat have two different names -> the state fusion fails to detect the data dependency, and ultimately one of the two maps is discarded.

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

No branches or pull requests

1 participant