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

sdfg.validate goes on infinite recursion with loopy sdfg #1562

Open
tim0s opened this issue Apr 26, 2024 · 0 comments
Open

sdfg.validate goes on infinite recursion with loopy sdfg #1562

tim0s opened this issue Apr 26, 2024 · 0 comments

Comments

@tim0s
Copy link
Contributor

tim0s commented Apr 26, 2024

Describe the bug

For certain (erroneous) SDFGs, sdfg.validate() does not thrown an exception, instead it crashes with a RecursionError.
This may be undesirable, since it is unclear to the user if the SDFG is erroneous or he should increase the stack size in order to be able to validate the SDFG.

To Reproduce

Run the following Python code:

import dace
sdfg = dace.SDFG("foo")
state = sdfg.add_state()
mentry_2, mexit_2 = state.add_map("map_2", dict(i="0:9"))
mentry_6, mexit_6 = state.add_map("map_6", dict(i="0:9"))
mentry_8, mexit_8 = state.add_map("map_8", dict(i="0:9"))
state.add_edge(mentry_8, "OUT_0", mentry_6, "IN_0", dace.Memlet(data="bla", subset='0:9'))
state.add_edge(mentry_6, "OUT_0", mentry_2, "IN_0", dace.Memlet(data="bla", subset='0:9'))
state.add_edge(mentry_2, "OUT_0", mentry_6, "IN_0", dace.Memlet(data="bla", subset='0:9'))
sdfg.validate()

Expected behavior
Either sdfg.validate() throws an exception telling me I formed a loop, or the last add_edge() throws an exception telling me I cannot add this edge because it would form a loop.

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