Skip to content
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

Error in Redundant Array Removal #1644

Open
philip-paul-mueller opened this issue Sep 6, 2024 · 0 comments
Open

Error in Redundant Array Removal #1644

philip-paul-mueller opened this issue Sep 6, 2024 · 0 comments

Comments

@philip-paul-mueller
Copy link
Collaborator

The new MapFusion transformation removes useless length 1 dimensions that were introduced by the over approximation. One of the big changes is, that now a the dimensionality the two subsets of a memlet are the same (it was not always true before anyway).

If the following patch is used to disable the strict data flow mode in the auto optimizer:

From 213c36d5ba337bfc1541941b0bc459f94270dcf5 Mon Sep 17 00:00:00 2001
From: Philip Mueller <philip.mueller@cscs.ch>
Date: Fri, 6 Sep 2024 14:54:20 +0200
Subject: [PATCH] Disable strict dataflow in auto optimizer.

---
 dace/transformation/auto/auto_optimize.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dace/transformation/auto/auto_optimize.py b/dace/transformation/auto/auto_optimize.py
index 09ff481e3..db0ba5ef2 100644
--- a/dace/transformation/auto/auto_optimize.py
+++ b/dace/transformation/auto/auto_optimize.py
@@ -52,6 +52,9 @@ def greedy_fuse(graph_or_subgraph: GraphViewType,
     :param permutations_only: Disallow splitting of maps during MultiExpansion stage
     :param expand_reductions: Expand all reduce nodes before fusion
     """
+    validate_all = True
+    validate = True
+    strict_dataflow = True
     debugprint = config.Config.get_bool('debugprint')
     if isinstance(graph_or_subgraph, ControlFlowRegion):
         if isinstance(graph_or_subgraph, SDFG):
@@ -61,7 +64,7 @@ def greedy_fuse(graph_or_subgraph: GraphViewType,
             #  We have to use `strict_dataflow` because it is known that `CompositeFusion`
             #  has problems otherwise.
             graph_or_subgraph.apply_transformations_repeated(
-                    MapFusion(strict_dataflow=True),
+                    MapFusion(strict_dataflow=strict_dataflow),
                     validate_all=validate_all,
             )
 
@@ -82,7 +85,7 @@ def greedy_fuse(graph_or_subgraph: GraphViewType,
         if isinstance(graph_or_subgraph, SDFGState):
             sdfg = graph_or_subgraph.parent
             sdfg.apply_transformations_repeated(
-                    MapFusion(strict_dataflow=True),
+                    MapFusion(strict_dataflow=strict_dataflow),
                     validate_all=validate_all,
             )
             graph = graph_or_subgraph
-- 
2.46.0

the test tests/npbench/weather_stencils/vadv_test.py will fail with an error that Subset.offset() was called with offsets of different dimensionality.

@tbennun tbennun changed the title Error in Redundand Array Removal Error in Redundant Array Removal Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant