Skip to content

Commit

Permalink
SubgraphFusion doesn't remove intermediate nodes whose data have also…
Browse files Browse the repository at this point in the history
… output accesses.
  • Loading branch information
alexnick83 committed Jul 26, 2023
1 parent b72c722 commit 438dafd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dace/transformation/subgraph/subgraph_fusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1146,10 +1146,15 @@ def change_data(transient_array, shape, strides, total_size, offset, lifetime, s
# by reconnecting their adjacent edges to nodes outside the subgraph.
# NOTE: Currently limited to cases where there is a single source and sink
# if there are multiple intermediate accesses for the same data.
# NOTE: Currently limited to intermediate data that do not have a separate output node

# Filter out outputs
output_data = set([n.data for n in out_nodes])
true_intermediate_nodes = set([n for n in intermediate_nodes if n.data not in output_data])

# Sort intermediate nodes by data name
intermediate_data = dict()
for acc in intermediate_nodes:
for acc in true_intermediate_nodes:
if acc.data in intermediate_data:
intermediate_data[acc.data].append(acc)
else:
Expand Down

0 comments on commit 438dafd

Please sign in to comment.