From df121cafb72c2ccf9cba25a5eac884ff64ec9cb0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 12 Aug 2024 07:54:39 -0700 Subject: [PATCH 1/2] fix bug handling sam graphs without consectuive numbered nodes --- sam/onyx/parse_dot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sam/onyx/parse_dot.py b/sam/onyx/parse_dot.py index 1fd818ec..ffc2842c 100644 --- a/sam/onyx/parse_dot.py +++ b/sam/onyx/parse_dot.py @@ -1353,7 +1353,13 @@ def duplicate_graph(self, unroll_factor): dupe_map = {} orig_nodes_list = self.graph.get_nodes().copy() # shallow copy is sufficient - node_count = len(orig_nodes_list) + # get largest node number + node_count = 0 + for node in orig_nodes_list: + node_name = node.get_name().strip('"') + if int(node_name) > node_count: + node_count = int(node_name) + node_count += 1 # Duplicate every node that isn't the tensor of interest for node in orig_nodes_list: node_attrs = node.get_attributes() From bac356aa5e36db947edeb5bc0fba210cccaeb065 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 12 Aug 2024 08:01:00 -0700 Subject: [PATCH 2/2] sytle fix --- sam/onyx/parse_dot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sam/onyx/parse_dot.py b/sam/onyx/parse_dot.py index ffc2842c..108d959e 100644 --- a/sam/onyx/parse_dot.py +++ b/sam/onyx/parse_dot.py @@ -1359,7 +1359,7 @@ def duplicate_graph(self, unroll_factor): node_name = node.get_name().strip('"') if int(node_name) > node_count: node_count = int(node_name) - node_count += 1 + node_count += 1 # Duplicate every node that isn't the tensor of interest for node in orig_nodes_list: node_attrs = node.get_attributes()