Skip to content
Snippets Groups Projects
Commit e244bc47 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Test] use BNN-PYNQ folding config for cnv-w1a1

parent affd5885
No related branches found
No related tags found
No related merge requests found
...@@ -134,33 +134,22 @@ def test_end2end_cnv_w1a1_create_dataflow_partition(): ...@@ -134,33 +134,22 @@ def test_end2end_cnv_w1a1_create_dataflow_partition():
def test_end2end_cnv_w1a1_fold_and_tlastmarker(): def test_end2end_cnv_w1a1_fold_and_tlastmarker():
model = ModelWrapper(build_dir + "/end2end_cnv_w1a1_dataflow_model.onnx") model = ModelWrapper(build_dir + "/end2end_cnv_w1a1_dataflow_model.onnx")
fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch") fc_layers = model.get_nodes_by_op_type("StreamingFCLayer_Batch")
fc0w = getCustomOp(fc_layers[0]) # each tuple is (PE, SIMD) for a layer
fc1w = getCustomOp(fc_layers[1]) folding = [
fc2w = getCustomOp(fc_layers[2]) (16, 3),
fc3w = getCustomOp(fc_layers[3]) (32, 32),
fc4w = getCustomOp(fc_layers[4]) (16, 32),
fc5w = getCustomOp(fc_layers[5]) (16, 32),
fc6w = getCustomOp(fc_layers[6]) (4, 32),
fc7w = getCustomOp(fc_layers[7]) (1, 32),
fc8w = getCustomOp(fc_layers[8]) (1, 4),
fc0w.set_nodeattr("SIMD", 27) (1, 8),
fc0w.set_nodeattr("PE", 8) (5, 1),
fc1w.set_nodeattr("SIMD", 32) ]
fc1w.set_nodeattr("PE", 8) for fcl, (pe, simd) in zip(fc_layers, folding):
fc2w.set_nodeattr("SIMD", 32) fcl_inst = getCustomOp(fcl)
fc2w.set_nodeattr("PE", 16) fcl_inst.set_nodeattr("PE", pe)
fc3w.set_nodeattr("SIMD", 32) fcl_inst.set_nodeattr("SIMD", simd)
fc3w.set_nodeattr("PE", 16)
fc4w.set_nodeattr("SIMD", 32)
fc4w.set_nodeattr("PE", 32)
fc5w.set_nodeattr("SIMD", 64)
fc5w.set_nodeattr("PE", 16)
fc6w.set_nodeattr("SIMD", 32)
fc6w.set_nodeattr("PE", 16)
fc7w.set_nodeattr("SIMD", 64)
fc7w.set_nodeattr("PE", 8)
fc8w.set_nodeattr("SIMD", 16)
fc8w.set_nodeattr("PE", 10)
model = model.transform(InsertDWC()) model = model.transform(InsertDWC())
model = model.transform(InsertTLastMarker()) model = model.transform(InsertTLastMarker())
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment