From 76235ceb507c2ed5b318bc86441860d6cf5b85f5 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Oct 2024 10:35:42 -0700 Subject: [PATCH 1/4] code cleanup --- sam/onyx/hw_nodes/buffet_node.py | 2 +- sam/onyx/hw_nodes/compute_node.py | 8 +---- sam/onyx/hw_nodes/crdhold_node.py | 18 +--------- sam/onyx/hw_nodes/fiberaccess_node.py | 42 ++---------------------- sam/onyx/hw_nodes/glb_node.py | 2 -- sam/onyx/hw_nodes/intersect_node.py | 18 +--------- sam/onyx/hw_nodes/merge_node.py | 8 +---- sam/onyx/hw_nodes/pass_through_node.py | 15 +++------ sam/onyx/hw_nodes/read_scanner_node.py | 8 +---- sam/onyx/hw_nodes/reduce_node.py | 4 +-- sam/onyx/hw_nodes/repeat_node.py | 7 +--- sam/onyx/hw_nodes/repsiggen_node.py | 1 + sam/onyx/hw_nodes/stream_arbiter_node.py | 3 +- sam/onyx/hw_nodes/write_scanner_node.py | 2 +- sam/onyx/parse_dot.py | 34 +++++++++---------- 15 files changed, 34 insertions(+), 138 deletions(-) diff --git a/sam/onyx/hw_nodes/buffet_node.py b/sam/onyx/hw_nodes/buffet_node.py index 828f1337..20a9e083 100644 --- a/sam/onyx/hw_nodes/buffet_node.py +++ b/sam/onyx/hw_nodes/buffet_node.py @@ -113,7 +113,7 @@ def connect(self, other, edge, kwargs=None): raise NotImplementedError(f'Cannot connect BuffetNode to {other_type}') def configure(self, attributes): - + print("Buffet Configure ", attributes) total_cap = 2048 capacity_0 = 1024 diff --git a/sam/onyx/hw_nodes/compute_node.py b/sam/onyx/hw_nodes/compute_node.py index 0593cfcb..f801175c 100644 --- a/sam/onyx/hw_nodes/compute_node.py +++ b/sam/onyx/hw_nodes/compute_node.py @@ -153,13 +153,10 @@ def connect(self, other, edge, kwargs=None): elif other_type == CrdHoldNode: raise NotImplementedError(f'Cannot connect GLBNode to {other_type}') elif other_type == FiberAccessNode: - print("COMPUTE TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns else: @@ -212,11 +209,9 @@ def parse_mapped_json(self, filename, node_id, is_mapped_from_complex_op, origin self.opcode = int(opcode, 0) def configure(self, attributes): - print("PE CONFIGURE") - print(attributes) + print("PE Configure ", attributes) c_op = attributes['type'].strip('"') comment = attributes['comment'].strip('"') - print(c_op) op_code = 0 # configuring via sam, it is a sparse app use_dense = False @@ -228,7 +223,6 @@ def configure(self, attributes): num_sparse_inputs = list("000") for port in self.mapped_input_ports: num_sparse_inputs[2 - int(port)] = '1' - print("".join(num_sparse_inputs)) num_sparse_inputs = int("".join(num_sparse_inputs), 2) cfg_kwargs = { diff --git a/sam/onyx/hw_nodes/crdhold_node.py b/sam/onyx/hw_nodes/crdhold_node.py index 47143ee0..88a47eb0 100644 --- a/sam/onyx/hw_nodes/crdhold_node.py +++ b/sam/onyx/hw_nodes/crdhold_node.py @@ -47,8 +47,6 @@ def connect(self, other, edge, kwargs=None): wr_scan = other.get_name() conn = 0 comment = edge.get_attributes()['comment'].strip('"') - print("CRDHOLD TO WR SCAN") - print(comment) if 'outer' in comment: conn = 1 new_conns = { @@ -65,23 +63,18 @@ def connect(self, other, edge, kwargs=None): # out_conn = 0 # in_conn = 0 - print(edge) intersect = other.get_name() # Use inner to process outer - print("CRDHOLD TO INTERSECT") comment = edge.get_attributes()['comment'].strip('"') - print(comment) label = edge.get_attributes()['label'].strip('"') t_label = label.split('-')[1] - print(t_label) if self.get_inner() in t_label: out_conn = 0 else: out_conn = 1 other_t_0 = other.get_tensor_from_connection(0) - print(other_t_0) if other_t_0 in comment: in_conn = 0 else: @@ -108,12 +101,7 @@ def connect(self, other, edge, kwargs=None): hold_outer = other.get_outer() hold_inner = other.get_inner() conn = 0 - print(edge) - print("CRDHOLD TO CRDHOLD") comment = edge.get_attributes()['comment'].strip('"') - print(comment) - print(hold_outer) - print(hold_inner) if hold_outer in comment: conn = 1 new_conns = { @@ -142,13 +130,10 @@ def connect(self, other, edge, kwargs=None): return new_conns elif other_type == FiberAccessNode: - print("CRDHOLD TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns else: @@ -157,8 +142,7 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes): - print("CRDHOLD CONFIGURE") - print(attributes) + print("CRDHOLD Configure: ", attributes) cmrg_enable = 1 # TODO what is this supposed to be? cmrg_stop_lvl = 1 diff --git a/sam/onyx/hw_nodes/fiberaccess_node.py b/sam/onyx/hw_nodes/fiberaccess_node.py index 1983e22e..a325f092 100644 --- a/sam/onyx/hw_nodes/fiberaccess_node.py +++ b/sam/onyx/hw_nodes/fiberaccess_node.py @@ -48,7 +48,7 @@ def remap_conns(self, conns, flavor): for conn_set_name, conn_list in conns.items(): # remapped_conns[conn_set_name] - print(f"remapping {conn_set_name}: {conn_list}") + # print(f"remapping {conn_set_name}: {conn_list}") tmp_list_conns = [] for conn_item in conn_list: conns, size = conn_item @@ -93,10 +93,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO GLB") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -111,10 +108,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO WRITE SCANNER") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -123,10 +117,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO INTERSECT") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -135,10 +126,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Crd Hold") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -149,10 +137,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Crd Hold") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -161,10 +146,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Crd Hold") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -173,10 +155,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Crd Hold") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -185,10 +164,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO WRITE SCANNER") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -199,10 +175,7 @@ def connect(self, other, edge, kwargs=None): assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Crd Hold") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns @@ -213,32 +186,22 @@ def connect(self, other, edge, kwargs=None): assert 'flavor_that' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) - print("FIBER ACCESS TO FIBER ACCESS") init_conns = this_flavor.connect(that_flavor, edge) - print(init_conns) final_conns_1 = self.remap_conns(init_conns, kwargs['flavor_this']) final_conns_2 = other.remap_conns(final_conns_1, kwargs['flavor_that']) - print(final_conns_2) return final_conns_2 elif other_type == StreamArbiterNode: assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Stream Arbiter") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns elif other_type == PassThroughNode: assert kwargs is not None assert 'flavor_this' in kwargs this_flavor = self.get_flavor(kwargs['flavor_this']) - print(kwargs) - print("FIBER ACCESS TO Pass Through") init_conns = this_flavor.connect(other, edge) - print(init_conns) final_conns = self.remap_conns(init_conns, kwargs['flavor_this']) return final_conns else: @@ -247,11 +210,10 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes, flavor): + print("Fiber Access Configure: ", attributes) cfg_tuple, cfg_kwargs = self.get_flavor(flavor=flavor).configure(attributes) cfg_kwargs['flavor'] = flavor - print("THESE ARE MY CONFIG KWARGS") - print(cfg_kwargs) # breakpoint() # vr_mode = 0 diff --git a/sam/onyx/hw_nodes/glb_node.py b/sam/onyx/hw_nodes/glb_node.py index 2dc3b55b..a2ed6baa 100644 --- a/sam/onyx/hw_nodes/glb_node.py +++ b/sam/onyx/hw_nodes/glb_node.py @@ -120,9 +120,7 @@ def connect(self, other, edge, kwargs=None): # Only could be using the write scanner portion of the fiber access # fa = other.get_name() conns_original = self.connect(other.get_write_scanner(), edge=edge) - print(conns_original) conns_remapped = other.remap_conns(conns_original, "write_scanner") - print(conns_remapped) return conns_remapped elif other_type == PassThroughNode: diff --git a/sam/onyx/hw_nodes/intersect_node.py b/sam/onyx/hw_nodes/intersect_node.py index d52855e2..bd544a5b 100644 --- a/sam/onyx/hw_nodes/intersect_node.py +++ b/sam/onyx/hw_nodes/intersect_node.py @@ -123,20 +123,12 @@ def connect(self, other, edge, kwargs=None): elif other_type == LookupNode: raise NotImplementedError(f'Cannot connect IntersectNode to {other_type}') elif other_type == MergeNode: - print("INTERSECT TO MERGE") - print(edge) merge = other.get_name() # Use inner to process outer merge_outer = other.get_outer() merge_inner = other.get_inner() conn = 0 - # print("INTERSECT TO MERGE") - # print(edge) - # print(edge.get_attributes()) comment = edge.get_attributes()['comment'].strip('"') - # print(comment) - # print(merge_outer) - # print(merge_inner) # okay this is dumb, stopgap until we can have super consistent output try: mapped_to_conn = comment.split("-")[1] @@ -147,7 +139,6 @@ def connect(self, other, edge, kwargs=None): mapped_to_conn = comment if merge_outer in mapped_to_conn: conn = 1 - print(f"CONN: {conn}") new_conns = { f'isect_to_merger_{conn}': [ # Send isect row and isect col to merger inside isect_col @@ -158,9 +149,7 @@ def connect(self, other, edge, kwargs=None): return new_conns elif other_type == RepeatNode: repeat = other.get_name() - print("INTERSECT TO REPEAT EDGE!") out_conn = 0 - print(edge) comment = edge.get_attributes()['comment'].strip('"') cmt_tnsr = comment.split("-")[1] assert cmt_tnsr in self.tensor_to_conn @@ -199,7 +188,6 @@ def connect(self, other, edge, kwargs=None): } return new_conns elif other_type == CrdHoldNode: - print(edge) crdhold = other.get_name() edge_comment = edge.get_attributes()['comment'].strip('"') if 'outer' in edge_comment: @@ -213,13 +201,10 @@ def connect(self, other, edge, kwargs=None): } return new_conns elif other_type == FiberAccessNode: - print("INTERSECT TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns elif other_type == PassThroughNode: @@ -266,8 +251,7 @@ def get_tensor_from_connection(self, conn): return self.conn_to_tensor[conn] def configure(self, attributes): - # print("INTERSECT CONFIGURE") - # print(attributes) + print("INTERSECT Configure", attributes) cmrg_enable = 0 cmrg_stop_lvl = 0 type_op = attributes['type'].strip('"') diff --git a/sam/onyx/hw_nodes/merge_node.py b/sam/onyx/hw_nodes/merge_node.py index 4bbbc2a6..378ec4ff 100644 --- a/sam/onyx/hw_nodes/merge_node.py +++ b/sam/onyx/hw_nodes/merge_node.py @@ -50,11 +50,8 @@ def connect(self, other, edge, kwargs=None): wr_scan = other.get_name() conn = 0 comment = edge.get_attributes()['comment'].strip('"') - print("MERGE TO WR SCAN") - print(comment) if 'outer' in comment: conn = 1 - print(conn) new_conns = { f'merge_{conn}_to_wr_scan': [ ([(merge, f"coord_out_{conn}"), (wr_scan, f"data_in")], 17), @@ -64,7 +61,6 @@ def connect(self, other, edge, kwargs=None): return new_conns elif other_type == IntersectNode: isect = other.get_name() - print("MERGE TO UNION FOR VECTOR REDUCE") new_conns = { f'merge_to_union_inner': [ ([(merge, f"coord_out_{0}"), (isect, f"coord_in_{0}")], 17), @@ -138,13 +134,10 @@ def connect(self, other, edge, kwargs=None): elif other_type == CrdHoldNode: raise NotImplementedError(f'Cannot connect MergeNode to {other_type}') elif other_type == FiberAccessNode: - print("MERGE TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns else: @@ -153,6 +146,7 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes): + print("MERGE Configure", attributes) cmrg_enable = 1 # TODO what is this supposed to be? cmrg_stop_lvl = 1 diff --git a/sam/onyx/hw_nodes/pass_through_node.py b/sam/onyx/hw_nodes/pass_through_node.py index 9debf377..874b3a79 100644 --- a/sam/onyx/hw_nodes/pass_through_node.py +++ b/sam/onyx/hw_nodes/pass_through_node.py @@ -33,7 +33,7 @@ def connect(self, other, edge, kwargs=None): pass_through = self.get_name() other_type = type(other) - print(other_type) + # print(other_type) if other_type == WriteScannerNode: wr_scan = other.get_name() @@ -44,7 +44,6 @@ def connect(self, other, edge, kwargs=None): } return new_conns elif other_type == ReadScannerNode: - print("PASSTHORUGH TO REPEAT EDGE!") rd_scan = other.get_name() new_conns = { 'pass_through_to_rd_scan': [ @@ -54,7 +53,6 @@ def connect(self, other, edge, kwargs=None): return new_conns elif other_type == RepeatNode: repeat = other.get_name() - print("PASSTHROUGH TO REPEAT EDGE!") new_conns = { 'pass_through_to_repeat': [ # send output to rd scanner @@ -95,8 +93,6 @@ def connect(self, other, edge, kwargs=None): elif other_type == MergeNode: edge_attr = edge.get_attributes() crddrop = other.get_name() - print("CHECKING READ TENSOR - CRDDROP") - print(edge) crd_drop_outer = other.get_outer() comment = edge_attr['comment'].strip('"') conn = 0 @@ -135,13 +131,10 @@ def connect(self, other, edge, kwargs=None): } elif other_type == FiberAccessNode: # fa = other.get_name() - print("PASSTHROUGH TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns @@ -151,7 +144,7 @@ def connect(self, other, edge, kwargs=None): return new_conns def get_connection_from_tensor(self, tensor): - print(self.tensor_to_conn) + # print(self.tensor_to_conn) return self.tensor_to_conn[tensor] def update_input_connections(self): @@ -161,8 +154,8 @@ def get_num_inputs(self): return self.num_inputs_connected def configure(self, attributes): - # print("Pass Through CONFIGURE") - # print(attributes) + print("PASSTHROUGH Configure", attributes) + placeholder = 1 cfg_kwargs = { diff --git a/sam/onyx/hw_nodes/read_scanner_node.py b/sam/onyx/hw_nodes/read_scanner_node.py index 32e90f14..2bdca283 100644 --- a/sam/onyx/hw_nodes/read_scanner_node.py +++ b/sam/onyx/hw_nodes/read_scanner_node.py @@ -152,9 +152,6 @@ def connect(self, other, edge, kwargs=None): edge_attr = edge.get_attributes() crddrop = other.get_name() - print("CHECKING READ TENSOR - CRDDROP") - print(edge) - print(self.get_tensor()) crd_drop_outer = other.get_outer() comment = edge_attr['comment'].strip('"') conn = 0 @@ -244,10 +241,7 @@ def connect(self, other, edge, kwargs=None): crdhold_outer = other.get_outer() crdhold_inner = other.get_inner() conn = 0 - print(edge) - print("RDSCAN TO CRDHOLD") comment = edge.get_attributes()['comment'].strip('"') - print(comment) mapped_to_conn = comment if crdhold_outer in mapped_to_conn: conn = 1 @@ -297,6 +291,7 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes): + print("ReadScanner Configure", attributes) inner_offset = 0 max_outer_dim = 0 strides = [0] @@ -325,7 +320,6 @@ def configure(self, attributes): else: is_root = int(attributes['root'].strip('"') == 'true') if attributes['format'].strip('"') == 'dense': - print("FOUND DENSE") dense = 1 dim_size = self.dim_size do_repeat = 0 diff --git a/sam/onyx/hw_nodes/reduce_node.py b/sam/onyx/hw_nodes/reduce_node.py index 96edda0e..61a30bb4 100644 --- a/sam/onyx/hw_nodes/reduce_node.py +++ b/sam/onyx/hw_nodes/reduce_node.py @@ -87,19 +87,17 @@ def connect(self, other, edge, kwargs=None): elif other_type == CrdHoldNode: raise NotImplementedError(f'Cannot connect GLBNode to {other_type}') elif other_type == FiberAccessNode: - print("REDUCE TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns else: raise NotImplementedError(f'Cannot connect ReduceNode to {other_type}') def configure(self, attributes): + print("Reduce Configure", attributes) # TODO stop_lvl = 2 # bypassing the fifos in the pe, get result in a single cycle diff --git a/sam/onyx/hw_nodes/repeat_node.py b/sam/onyx/hw_nodes/repeat_node.py index 740a8ad9..8e99c24f 100644 --- a/sam/onyx/hw_nodes/repeat_node.py +++ b/sam/onyx/hw_nodes/repeat_node.py @@ -74,13 +74,10 @@ def connect(self, other, edge, kwargs=None): elif other_type == CrdHoldNode: raise NotImplementedError(f'Cannot connect GLBNode to {other_type}') elif other_type == FiberAccessNode: - print("REPEAT TO FIBER ACCESS") assert kwargs is not None assert 'flavor_that' in kwargs that_flavor = other.get_flavor(kwargs['flavor_that']) - print(kwargs) init_conns = self.connect(that_flavor, edge) - print(init_conns) final_conns = other.remap_conns(init_conns, kwargs['flavor_that']) return final_conns else: @@ -89,18 +86,16 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes): - + print("Repeat Configure", attributes) spacc_mode = 0 if 'spacc' in attributes: spacc_mode = 1 - print("Repeat stop") root = 0 stop_lvl = 1 if 'true' in attributes['root'].strip('"'): root = 1 stop_lvl = 0 - print(attributes) cfg_kwargs = { 'stop_lvl': stop_lvl, 'root': root, diff --git a/sam/onyx/hw_nodes/repsiggen_node.py b/sam/onyx/hw_nodes/repsiggen_node.py index a172b48e..a3434b1b 100644 --- a/sam/onyx/hw_nodes/repsiggen_node.py +++ b/sam/onyx/hw_nodes/repsiggen_node.py @@ -79,6 +79,7 @@ def connect(self, other, edge, kwargs=None): return new_conns def configure(self, attributes): + print("Repeat Signal Generator", attributes) stop_lvl = 0 cfg_kwargs = { 'stop_lvl': stop_lvl diff --git a/sam/onyx/hw_nodes/stream_arbiter_node.py b/sam/onyx/hw_nodes/stream_arbiter_node.py index 1ae6ed09..4317db24 100644 --- a/sam/onyx/hw_nodes/stream_arbiter_node.py +++ b/sam/onyx/hw_nodes/stream_arbiter_node.py @@ -65,8 +65,7 @@ def get_num_inputs(self): return self.num_inputs_connected def configure(self, attributes): - # print("STREAM ARBITER CONFIGURE") - # print(attributes) + print("Stream Arbiter Configure", attributes) seg_mode = attributes['seg_mode'] num_requests = self.num_inputs_connected diff --git a/sam/onyx/hw_nodes/write_scanner_node.py b/sam/onyx/hw_nodes/write_scanner_node.py index 6e5bc49f..2e8517ac 100644 --- a/sam/onyx/hw_nodes/write_scanner_node.py +++ b/sam/onyx/hw_nodes/write_scanner_node.py @@ -69,7 +69,7 @@ def connect(self, other, edge, kwargs=None): raise NotImplementedError(f'Cannot connect WriteScannerNode to {other_type}') def configure(self, attributes): - + print("Write Scanner Configure", attributes) stop_lvl = 0 init_blank = 0 diff --git a/sam/onyx/parse_dot.py b/sam/onyx/parse_dot.py index 1fd818ec..6c37cd84 100644 --- a/sam/onyx/parse_dot.py +++ b/sam/onyx/parse_dot.py @@ -66,9 +66,9 @@ def __init__(self, filename=None, local_mems=True, use_fork=False, self.rewrite_complex_ops() nodes = self.graph.get_nodes() - for node in nodes: - print(node.get_name()) - print(node.get_attributes()) + # for node in nodes: + # print(node.get_name()) + # print(node.get_attributes()) def get_mode_map(self): sc = self.graph.get_comment().strip('"') @@ -81,7 +81,7 @@ def get_mode_map(self): for mode, tf_subspec in enumerate(tensor_format[0:len(tensor_format) // 2]): actual_mode = int(tensor_format[mode + len(tensor_format) // 2]) self.mode_map[tensor_name][actual_mode] = (mode, tf_subspec) - print(self.mode_map) + # print(self.mode_map) self.mode_map_list = [] self.tensor_list = [] for tensor, mappings in self.mode_map.items(): @@ -472,7 +472,7 @@ def rewrite_VectorReducer(self): # # self.graph.del_edge(edge_) # self.graph.del_edge(edge_.get_source(), edge_.get_destination()) - print(attrs) + # print(attrs) og_type = attrs['type'] del attrs['type'] @@ -587,8 +587,8 @@ def rewrite_VectorReducer(self): self.graph.add_node(vals_wr_scanner) # print(in_edge_attrs[in_input_node]) - print(in_edge_attrs[in_crd_node]) - print(in_edge_attrs[in_val_node]) + # print(in_edge_attrs[in_crd_node]) + # print(in_edge_attrs[in_val_node]) del in_edge_attrs[in_crd_node]['comment'] del in_edge_attrs[in_val_node]['type'] @@ -641,8 +641,8 @@ def rewrite_VectorReducer(self): self.graph.del_edge(crd_edge.get_source(), crd_edge.get_destination()) self.graph.del_edge(val_edge.get_source(), val_edge.get_destination()) - print(crd_edge_attr) - print(val_edge_attr) + # print(crd_edge_attr) + # print(val_edge_attr) # crd_rd_scan_to_glb = pydot.Edge(src=crd_rd_scanner, dst=dst_crd, **crd_edge_attr, use_alt_out_port="1") # val_rd_scan_to_glb = pydot.Edge(src=vals_rd_scanner, dst=dst_vals, **val_edge_attr, use_alt_out_port="1") @@ -701,7 +701,7 @@ def rewrite_tri_to_binary(self): assert all([v <= 3 for k, v in joiner_ninputs.items()]) nodes_to_proc = [n for n in nodes_to_proc if joiner_ninputs[n.get_name()] == 3] - print("NODES TO REWRITE FOR BINARY", [n.get_name() for n in nodes_to_proc]) + # print("NODES TO REWRITE FOR BINARY", [n.get_name() for n in nodes_to_proc]) for node in nodes_to_proc: attrs = node.get_attributes() @@ -935,8 +935,8 @@ def rewrite_lookup(self, unroll): 'fiberwrite' in node.get_comment()] # print comment for each node - for node in nodes_to_proc: - print(node.get_comment()) + # for node in nodes_to_proc: + # print(node.get_comment()) for node in nodes_to_proc: if 'fiberlookup' in node.get_comment(): @@ -1256,8 +1256,8 @@ def rewrite_arrays(self): # TODO better solution for this? if len(og_label) > 1 and og_label[-1] != 'lut': - print(attrs) - print(og_label) + # print(attrs) + # print(og_label) # TODO better solution dup_id = int(og_label[-1]) else: @@ -1394,7 +1394,7 @@ def duplicate_graph(self, unroll_factor): new_edge = pydot.Edge(src=rmp_src, dst=rmp_dst, **edge.get_attributes()) self.graph.add_edge(new_edge) - print(self.graph) + # print(self.graph) def annotate_IO_nodes(self): original_nodes = self.graph.get_nodes() @@ -1437,8 +1437,8 @@ def parse_graph(graph): else: hwnode_cnt[prim_type] += 1 - print("type", type_cnt) - print("hwnode", hwnode_cnt) + # print("type", type_cnt) + # print("hwnode", hwnode_cnt) return type_cnt, hwnode_cnt From 7624452a6cd20253a30c1fe15472207fddd0ce34 Mon Sep 17 00:00:00 2001 From: kalhankoul96 Date: Tue, 15 Oct 2024 11:52:56 -0700 Subject: [PATCH 2/4] Update makefile.yml --- .github/workflows/makefile.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/makefile.yml b/.github/workflows/makefile.yml index d79d9370..3b9a5ec0 100644 --- a/.github/workflows/makefile.yml +++ b/.github/workflows/makefile.yml @@ -9,7 +9,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 From 0df1737024d589d5cb4a8cfffba3c4b13d043b26 Mon Sep 17 00:00:00 2001 From: kalhankoul96 Date: Tue, 15 Oct 2024 13:17:27 -0700 Subject: [PATCH 3/4] Update python-package-conda.yml --- .github/workflows/python-package-conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-package-conda.yml b/.github/workflows/python-package-conda.yml index f87f7c6f..65844c40 100644 --- a/.github/workflows/python-package-conda.yml +++ b/.github/workflows/python-package-conda.yml @@ -4,7 +4,7 @@ on: [push] jobs: build-linux: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 strategy: max-parallel: 5 steps: From 080975192bb307754435098a6e28d9f034a1363a Mon Sep 17 00:00:00 2001 From: root Date: Tue, 15 Oct 2024 13:21:14 -0700 Subject: [PATCH 4/4] lint fix --- sam/onyx/hw_nodes/pass_through_node.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sam/onyx/hw_nodes/pass_through_node.py b/sam/onyx/hw_nodes/pass_through_node.py index 874b3a79..e681903e 100644 --- a/sam/onyx/hw_nodes/pass_through_node.py +++ b/sam/onyx/hw_nodes/pass_through_node.py @@ -156,7 +156,6 @@ def get_num_inputs(self): def configure(self, attributes): print("PASSTHROUGH Configure", attributes) - placeholder = 1 cfg_kwargs = { 'placeholder': placeholder