Skip to content

Commit

Permalink
update compute_node and reduce_node to remove the hacked connection t…
Browse files Browse the repository at this point in the history
…o max
  • Loading branch information
bobcheng15 committed Jan 23, 2024
1 parent 010929a commit 97cef1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
5 changes: 1 addition & 4 deletions sam/onyx/hw_nodes/compute_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 1 addition & 8 deletions sam/onyx/hw_nodes/reduce_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 97cef1e

Please sign in to comment.