Skip to content

Commit

Permalink
update configuration code for pe and reduce to account for the new co…
Browse files Browse the repository at this point in the history
…nfig register heirarchy in reduce_pe_cluster. also modified the signal name for connection from crddrop to reduce and reduce to arrayval to match the new signal name of reduce in cluster, matmul_ijk_crddrop passed
  • Loading branch information
bobcheng15 committed Nov 15, 2023
1 parent 09490d7 commit ef31fa3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
13 changes: 11 additions & 2 deletions sam/onyx/hw_nodes/compute_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,13 +151,22 @@ def configure(self, attributes):
comment = attributes['comment'].strip('"')
print(c_op)
op_code = 0
# configuring via sam, it is a sparse app
use_dense = False
# mapping to pe only, configuring only the pe, ignore the reduce
pe_only = True
# data I/O should interface with other primitive outside of the cluster
pe_in_external = True
if c_op == 'mul':
op_code = 1
elif c_op == 'add' and 'sub=1' not in comment:
op_code = 0
elif c_op == 'add' and 'sub=1' in comment:
op_code = 2
cfg_kwargs = {
'op': op_code
'op': op_code,
'use_dense': use_dense,
'pe_only': pe_only,
'pe_in_external': pe_in_external
}
return op_code, cfg_kwargs
return (op_code, use_dense, pe_only, pe_in_external), cfg_kwargs
2 changes: 1 addition & 1 deletion sam/onyx/hw_nodes/merge_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def connect(self, other, edge, kwargs=None):
other_red = other.get_name()
new_conns = {
f'merge_to_reduce_inner': [
([(merge, f"cmrg_coord_out_{0}"), (other_red, f"data_in")], 17),
([(merge, f"cmrg_coord_out_{0}"), (other_red, f"reduce_data_in")], 17),
]
}

Expand Down
18 changes: 15 additions & 3 deletions sam/onyx/hw_nodes/reduce_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def connect(self, other, edge, kwargs=None):
new_conns = {
'reduce_to_wr_scan': [
# send output to rd scanner
([(red, "data_out"), (wr_scan, "data_in")], 17),
([(red, "reduce_data_out"), (wr_scan, "data_in")], 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),
Expand Down Expand Up @@ -102,7 +102,19 @@ def connect(self, other, edge, kwargs=None):
def configure(self, attributes):
# TODO
stop_lvl = 2
# configuring via sam, it is a sparse app
use_dense = False
# configuring both the pe and the reduce
pe_only = False
# data I/O to and from the PE should be internal with the reduce
pe_in_external = False
# op is set to integer add for the PE TODO: make this configurable in the sam graph
op = 0
cfg_kwargs = {
'stop_lvl': stop_lvl
'stop_lvl': stop_lvl,
'use_dense': use_dense,
'pe_only': pe_only,
'pe_in_external': pe_in_external,
'op': op
}
return stop_lvl, cfg_kwargs
return (stop_lvl, use_dense, pe_only, pe_in_external, op), cfg_kwargs

0 comments on commit ef31fa3

Please sign in to comment.