-
Notifications
You must be signed in to change notification settings - Fork 133
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
Constant Propagation (partially) Fails If NestedSDFG
Has Multiple States
#1817
Comments
I updated the reproducer, it can now be used as unit tests afterwards. I extended the test and it seems that it fails as soon as there is an SDFG with multiple states, however, some symbols are correctly replaced. |
|
Hello Tal, |
What I meant was to try this transformation and seeing if it helps: https://github.com/spcl/dace/blob/main/dace/transformation/dataflow/prune_connectors.py#L92 I think this behavior is by design. |
I found a bug in constant propagation, that I am unable to fix.
The bug is related to nested SDFGs that have multiple states, it works if it has only one state.
My main test case is a simple Map, its range is
N
, which is also the size of the data containers.Furthermore, there is also the the symbol
lim_area
that effects the output of the mapped Tasklets.I needed it to replace some symbols with constant values.

So I looked at
ConstantPropagation
and saw that it offers theinitial_symbols
argument, which I use to pass the value mapping, i.e.{'lim_area': True, 'N': 10}
.When I run this on an SDFG, containing a NestedSDFG that has an SDFG with only one state, the Map is replaced as I expected it:
However, if the NestedSDFG contains multiple states, then only one variable,

lim_area
is replaced.What is interesting that, before the symbol mapping was
{'lim_area': 'lim_area', 'N': 'N'}
, but after constant propagation it is{'N': '10'}
, so instead of removing the entry, as it did forlim_area
, it replaced it with'10'
, which is a string (I passed the integer value).As a side note if the Nested SDFG had only one state the symbol map is empty.
This means that the transformation only partially fails, as it is able to fully replace
lim_area
.This is the reproducer:
The text was updated successfully, but these errors were encountered: