-
Notifications
You must be signed in to change notification settings - Fork 54
fix[next][dace]: Better usage of SubgraphContext during SDFG lowering
#2413
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
base: main
Are you sure you want to change the base?
Conversation
SubgraphContext during SDFG loweringSubgraphContext during SDFG lowering
This reverts commit 2dbda35.
philip-paul-mueller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An initial review, if you need clarification let me know.
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
| data=target.dc_node.data, subset=target_subset, other_subset=source_subset | ||
| ), | ||
| ) | ||
| if ctx.state.degree(source.dc_node) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this node?
Was it created in the (eager) assumption that it is an inout node and it is not?
Because it is also a bit strange considering the creation of the edge before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens in case of a conditional expression, which ends with a join state containing only an access node to the result, while the dataflow is in the then-else branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my curiosity, who/where/why was the node put into that state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg_primitives.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg_scan.py
Show resolved
Hide resolved
edopao
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review comments!
| data=target.dc_node.data, subset=target_subset, other_subset=source_subset | ||
| ), | ||
| ) | ||
| if ctx.state.degree(source.dc_node) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens in case of a conditional expression, which ends with a join state containing only an access node to the result, while the dataflow is in the then-else branches.
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg_primitives.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg_scan.py
Show resolved
Hide resolved
src/gt4py/next/program_processors/runners/dace/lowering/gtir_to_sdfg.py
Outdated
Show resolved
Hide resolved
philip-paul-mueller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks okay, there are some parts I have a bit trouble understanding, especially the motivation behind it, but there should be nothing blocking.
| data=target.dc_node.data, subset=target_subset, other_subset=source_subset | ||
| ), | ||
| ) | ||
| if ctx.state.degree(source.dc_node) == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For my curiosity, who/where/why was the node put into that state?
|
We wait for the icon4py PR#896 to be merged, because we need to remove a write-write pattern which dace state fusion cannot handle (see spcl/dace#2256). This PR reveals the issue, because of non-deterministic code generation, by introducing a new name convention of transient arrays and map nodes. |


Change the visitor class so that we can generate unique labels for temporaries/maps/tasklets across all nested SDFG.