Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions ndsl/dsl/dace/stree/optimizations/axis_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,10 +405,12 @@ def visit_ScheduleTreeRoot(self, node: dst.ScheduleTreeRoot):
Then exit.
"""

# ndsl_log.debug(f"🧹 Normalizing {self.axis} loop symbol")
# TODO: many interval generate many iterator name right now
# e.g. _k_0, _k_1...
# This makes merging more difficult. We could write a pre-pass
# that cleans this up BUT we have an issue with the THIS_K feature
# in the tasklet...
# NormalizeAxisSymbol(self.axis).visit(node)
# with open("stree-IN-sanitized.txt", "w") as f:
# f.write(node.as_string(-1))

overall_merged = 0
i = 0
Expand All @@ -422,7 +424,6 @@ def visit_ScheduleTreeRoot(self, node: dst.ScheduleTreeRoot):
if __debug__:
detect_cycle(node.children, set())
except RecursionError as re:
breakpoint()
raise re

# If we didn't merge, we revert the children
Expand Down
6 changes: 4 additions & 2 deletions ndsl/dsl/dace/stree/optimizations/memlet_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import dace.sdfg.analysis.schedule_tree.treenodes as dst
from dace.memlet import Memlet

from ndsl import ndsl_log


class AxisIterator(Enum):
_I = ("__i", 0)
Expand All @@ -22,7 +24,7 @@ def no_data_dependencies_on_cartesian_axis(
axis: AxisIterator,
) -> bool:
"""Check for read after write. Allow when indexation on the axis
is not offseted."""
is not offset."""

write_collector = MemletCollector(collect_reads=False)
write_collector.visit(first)
Expand All @@ -39,7 +41,7 @@ def no_data_dependencies_on_cartesian_axis(
for read in read_collector.in_memlets:
if write.data == read.data:
if previous_axis_index != read.subset[axis.as_cartesian_index()][0]:
print(
ndsl_log.debug(
f"[{axis.name} Merge] Found read after write conflict "
f"for {write.data} "
f"w/ different offset to {axis.name} ("
Expand Down
Loading