From 9a9f57330cca80a342133368561582c58c3f6782 Mon Sep 17 00:00:00 2001 From: Florian Deconinck Date: Tue, 7 Oct 2025 12:31:20 -0400 Subject: [PATCH 1/2] Use `ndsl_log` --- ndsl/dsl/dace/stree/optimizations/memlet_helpers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ndsl/dsl/dace/stree/optimizations/memlet_helpers.py b/ndsl/dsl/dace/stree/optimizations/memlet_helpers.py index ecd138b4..1613e014 100644 --- a/ndsl/dsl/dace/stree/optimizations/memlet_helpers.py +++ b/ndsl/dsl/dace/stree/optimizations/memlet_helpers.py @@ -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) @@ -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) @@ -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} (" From acf8e93861eee4ef4a264eb506722d214445ee13 Mon Sep 17 00:00:00 2001 From: Florian Deconinck Date: Tue, 7 Oct 2025 12:31:42 -0400 Subject: [PATCH 2/2] Remove missed `breakpoint` and turn dead code into coding comment --- ndsl/dsl/dace/stree/optimizations/axis_merge.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ndsl/dsl/dace/stree/optimizations/axis_merge.py b/ndsl/dsl/dace/stree/optimizations/axis_merge.py index 27e3bc69..18142998 100644 --- a/ndsl/dsl/dace/stree/optimizations/axis_merge.py +++ b/ndsl/dsl/dace/stree/optimizations/axis_merge.py @@ -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 @@ -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