From 97cef1e41631f9ef905163e3b875cce7179858a4 Mon Sep 17 00:00:00 2001 From: Bo Wun Cheng Date: Tue, 23 Jan 2024 10:04:15 -0800 Subject: [PATCH] update compute_node and reduce_node to remove the hacked connection to max --- sam/onyx/hw_nodes/compute_node.py | 5 +---- sam/onyx/hw_nodes/reduce_node.py | 9 +-------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/sam/onyx/hw_nodes/compute_node.py b/sam/onyx/hw_nodes/compute_node.py index b45acd88..622716f8 100644 --- a/sam/onyx/hw_nodes/compute_node.py +++ b/sam/onyx/hw_nodes/compute_node.py @@ -129,10 +129,7 @@ def connect(self, other, edge, kwargs=None): other_pe = other.get_name() other_conn = other.get_num_inputs() pe = self.get_name() - # TODO: remove hack eventually - if 'Max 0' in other.op: - other_conn = 1 - elif 'Faddiexp' in other.op: + if 'Faddiexp' in other.op: comment = edge.get_attributes()["comment"].strip('"') if 'fp' in comment: other_conn = 0 diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index 4a43a9ec..0700373e 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -72,17 +72,10 @@ def connect(self, other, edge, kwargs=None): raise NotImplementedError(f'Cannot connect ReduceNode to {other_type}') elif other_type == ComputeNode: pe = other.get_name() - if 'Max 0' in other.op: - other_conn = 1 - else: - other_conn = other.get_num_inputs() + other_conn = other.mapped_input_ports[other.get_num_inputs()] new_conns = { f'reduce_to_pe_{other_conn}': [ - # send output to rd scanner ([(red, "reduce_data_out"), (pe, f"data{other_conn}")], 17), - # ([(red, "eos_out"), (wr_scan, "eos_in_0")], 1), - # ([(wr_scan, "ready_out_0"), (red, "ready_in")], 1), - # ([(red, "valid_out"), (wr_scan, "valid_in_0")], 1), ] } other.update_input_connections()