-
Notifications
You must be signed in to change notification settings - Fork 54
feat[next-dace]: Updated MoveDataflowIntoIfBody
#2460
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?
feat[next-dace]: Updated MoveDataflowIntoIfBody
#2460
Conversation
| # `True` then this order is better. Solve that issue. | ||
| # TODO(phimuell): Because of the limitation that the transformation only works | ||
| # for dataflow that is directly enclosed by a Map, the order in which it is | ||
| # applied matters. Instead we have to run it into a topological order. |
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.
| # applied matters. Instead we have to run it into a topological order. | |
| # applied matters. Instead we should run it into a topological order. |
| that can be relocated, not yet filtered. | ||
| non_relocatable_dataflow: The connectors and their associated dataflow | ||
| that can not be relocated. | ||
| enclosing_map: The limiting node, i.e. the MapEntry of the Map `if_block` |
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.
| enclosing_map: The limiting node, i.e. the MapEntry of the Map `if_block` | |
| enclosing_map: The limiting node, i.e. the MapEntry of the Map where `if_block` |
| for oedge in state.out_edges(reloc_node) | ||
| if oedge.dst is not if_block | ||
| ): | ||
| nodes_proposed_for_reloc.discard(reloc_node) |
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.
Why discard() and not remove()? remove() is more strict because it also checks that it exists, right? and the node has to exists in nodes_proposed_for_reloc
| return branch_nodes | ||
|
|
||
| else: | ||
| # Only some of the incoming nodes will be moved into the `if` |
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.
The first part of the comment is misleading, in my opinion. I would write:
| # Only some of the incoming nodes will be moved into the `if` | |
| # Only some of the incoming nodes could be moved into the `if` |
|
|
||
| else: | ||
| # Only some of the incoming nodes will be moved into the `if` | ||
| # body. This is legal only if the not moved nodes are |
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.
and below:
| # body. This is legal only if the not moved nodes are | |
| # body. It would be legal to relocate the node if all incoming nodes were access nodes, this is why access nodes are not included in 'incoming_nodes'. | |
| # In this case, we cannot relocate the node, so we discard also those 'incoming_nodes' that were candidates for relocation. |
| ``` | ||
| """ | ||
| # This test is temporarily disabled. | ||
| return |
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.
I would use a skip annotation @pytest.mark.skip(reason="")
| state.add_edge(a1, None, top_if_block, "__arg1", dace.Memlet("a1[0]")) | ||
| state.add_edge(b1, None, top_if_block, "__arg2", dace.Memlet("b1[0]")) | ||
| state.add_edge(c1, None, top_if_block, "__cond", dace.Memlet("c1[0]")) | ||
| state.add_edge(top_if_block, "__output", t1, None, dace.Memlet("t1[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.
I tried this test but t1 is not defined.
MoveDataflowIntoIfBodyMoveDataflowIntoIfBody

Refines the condition which determines what can be moved into the
ifbody and what not.TODO:
MoveDataflowIntoIfBodytransformation C2SM/icon4py#1015