Skip to content
Snippets Groups Projects
Commit 2a322f66 authored by auphelia's avatar auphelia
Browse files

Merge branch 'feature/jenkins' into feature/fix_2022.1_zynqbuild

parents 78018407 ffed025c
No related branches found
No related tags found
No related merge requests found
......@@ -78,7 +78,7 @@ module axi_info_top #(
32'h0,
CHECKSUM_COUNT
})
)(
) inst (
//- Global Control ------------------
.ap_clk, .ap_rst_n,
......
......@@ -124,6 +124,7 @@ markers =
util: mark tests that test util functions
transform: mark tests that test transformations (before hls layers)
fpgadataflow: mark tests related to hls layers
end2end: mark tests that run the end2end flow
norecursedirs =
dist
build
......
......@@ -88,8 +88,6 @@ def execute_onnx(
str(input_dict[inp_name].shape),
)
)
# else:
# raise Exception("Provided input not found in graph context: %s" % inp_name)
# check if model has an execution mode set
# if None, execute model node by node using execute_node()
......@@ -136,7 +134,6 @@ def execute_onnx_and_make_model(model, input_dict):
new_model.set_initializer(i, execution_context[i])
for vi in new_model.graph.value_info:
new_model.graph.output.append(vi)
# import pdb; pdb.set_trace()
return new_model
......
......@@ -34,6 +34,8 @@ from finn.util.test import get_build_env
@pytest.mark.board
@pytest.mark.end2end
@pytest.mark.xfail
def test_end2end_access_board():
build_env = get_build_env("zynq", 5)
if build_env["ip"] == "":
......
......@@ -314,6 +314,7 @@ def topology2dataset(topology):
@pytest.mark.parametrize("abits", [1, 2])
@pytest.mark.parametrize("topology", ["lfc", "tfc", "cnv"])
@pytest.mark.parametrize("QONNX_export", [False, True])
@pytest.mark.end2end
class TestEnd2End:
def test_export(self, topology, wbits, abits, QONNX_export):
if wbits > abits:
......@@ -670,6 +671,7 @@ class TestEnd2End:
@pytest.mark.slow
@pytest.mark.vivado
@pytest.mark.vitis
@pytest.mark.xfail
@pytest.mark.parametrize("kind", ["zynq", "alveo"])
def test_build(self, topology, wbits, abits, QONNX_export, kind):
if kind == "alveo" and ("VITIS_PATH" not in os.environ):
......@@ -692,6 +694,7 @@ class TestEnd2End:
@pytest.mark.slow
@pytest.mark.vivado
@pytest.mark.vitis
@pytest.mark.xfail
@pytest.mark.parametrize("kind", ["zynq", "alveo"])
def test_make_pynq_driver(self, topology, wbits, abits, QONNX_export, kind):
if kind == "alveo" and ("VITIS_PATH" not in os.environ):
......@@ -707,6 +710,7 @@ class TestEnd2End:
)
@pytest.mark.parametrize("kind", ["zynq", "alveo"])
@pytest.mark.xfail
def test_deploy(self, topology, wbits, abits, QONNX_export, kind):
prev_chkpt_name = get_checkpoint_name(
topology, wbits, abits, QONNX_export, "driver_" + kind
......@@ -730,6 +734,7 @@ class TestEnd2End:
)
@pytest.mark.parametrize("kind", ["zynq", "alveo"])
@pytest.mark.xfail
def test_run_on_hw(self, topology, wbits, abits, QONNX_export, kind):
prev_chkpt_name = get_checkpoint_name(
topology, wbits, abits, QONNX_export, "deploy_" + kind
......@@ -754,6 +759,7 @@ class TestEnd2End:
assert np.isclose(y, output_tensor_npy).all()
@pytest.mark.parametrize("kind", ["zynq", "alveo"])
@pytest.mark.xfail
def test_throughput_hw(self, topology, wbits, abits, QONNX_export, kind):
prev_chkpt_name = get_checkpoint_name(
topology, wbits, abits, QONNX_export, "deploy_" + kind
......@@ -813,6 +819,7 @@ class TestEnd2End:
ret[largest_bsize]["throughput[images/s]"],
)
@pytest.mark.xfail
def test_upload_results_to_dashboard(self, topology, wbits, abits, QONNX_export):
# ToDo: Extend the dashboard to also upload QONNX exported models?
if QONNX_export:
......
......@@ -86,6 +86,7 @@ class CybSecMLPForExport(nn.Module):
@pytest.mark.parametrize("QONNX_export", [False, True])
@pytest.mark.end2end
def test_end2end_cybsec_mlp_export(QONNX_export):
assets_dir = pk.resource_filename("finn.qnn-data", "cybsec-mlp/")
# load up trained net in Brevitas
......@@ -180,6 +181,8 @@ def test_end2end_cybsec_mlp_export(QONNX_export):
@pytest.mark.slow
@pytest.mark.vivado
@pytest.mark.end2end
@pytest.mark.xfail
@pytest.mark.parametrize("QONNX_export", [False, True])
def test_end2end_cybsec_mlp_build(QONNX_export):
model_file = get_checkpoint_name("export", QONNX_export)
......@@ -226,6 +229,8 @@ def test_end2end_cybsec_mlp_build(QONNX_export):
shutil.copytree(output_dir + "/deploy", get_checkpoint_name("build", QONNX_export))
@pytest.mark.end2end
@pytest.mark.xfail
@pytest.mark.parametrize("QONNX_export", [False, True])
def test_end2end_cybsec_mlp_run_on_hw(QONNX_export):
build_env = get_build_env(build_kind, target_clk_ns)
......
......@@ -87,6 +87,7 @@ extra_fold = 1
first_layer_res_type = "dsp"
@pytest.mark.end2end
def test_end2end_mobilenet_export():
# export preprocessing
preproc_onnx = build_dir + "/end2end_mobilenet_preproc.onnx"
......@@ -142,6 +143,7 @@ def test_end2end_mobilenet_export():
assert os.path.isfile(build_dir + "/end2end_mobilenet_preproc.onnx")
@pytest.mark.end2end
def test_end2end_mobilenet_tidy_and_merge_with_preproc():
preproc_model = load_test_checkpoint_or_skip(
build_dir + "/end2end_mobilenet_preproc.onnx"
......@@ -164,6 +166,7 @@ def test_end2end_mobilenet_tidy_and_merge_with_preproc():
model.save(build_dir + "/end2end_mobilenet_tidy.onnx")
@pytest.mark.end2end
def test_end2end_mobilenet_streamline():
model = load_test_checkpoint_or_skip(build_dir + "/end2end_mobilenet_tidy.onnx")
model = model.transform(Streamline())
......@@ -194,6 +197,7 @@ def test_end2end_mobilenet_streamline():
assert len(model.get_nodes_by_op_type("Mul")) == 0 # no Mul ops remain
@pytest.mark.end2end
def test_end2end_mobilenet_lowering():
model = load_test_checkpoint_or_skip(
build_dir + "/end2end_mobilenet_streamlined.onnx"
......@@ -208,6 +212,7 @@ def test_end2end_mobilenet_lowering():
model.save(build_dir + "/end2end_mobilenet_lowered.onnx")
@pytest.mark.end2end
def test_end2end_mobilenet_convert_to_hls_layers():
model = load_test_checkpoint_or_skip(build_dir + "/end2end_mobilenet_lowered.onnx")
model = model.transform(to_hls.InferPool_Batch())
......@@ -222,6 +227,7 @@ def test_end2end_mobilenet_convert_to_hls_layers():
model.save(build_dir + "/end2end_mobilenet_hls_layers.onnx")
@pytest.mark.end2end
def test_end2end_mobilenet_folding():
model = load_test_checkpoint_or_skip(
build_dir + "/end2end_mobilenet_hls_layers.onnx"
......@@ -285,6 +291,7 @@ def test_end2end_mobilenet_folding():
model.save(build_dir + "/end2end_mobilenet_folded.onnx")
@pytest.mark.end2end
def test_end2end_mobilenet_create_dataflow_partition():
model = load_test_checkpoint_or_skip(build_dir + "/end2end_mobilenet_folded.onnx")
parent_model = model.transform(CreateDataflowPartition())
......@@ -299,6 +306,7 @@ def test_end2end_mobilenet_create_dataflow_partition():
@pytest.mark.slow
@pytest.mark.vivado
@pytest.mark.end2end
@pytest.mark.xfail
def test_end2end_mobilenet_cppsim():
model = load_test_checkpoint_or_skip(build_dir + "/end2end_mobilenet_folded.onnx")
......
......@@ -68,6 +68,7 @@ def get_checkpoint_name(step):
return build_dir + "/end2end_ext_weights_%s.onnx" % (step)
@pytest.mark.end2end
def test_end2end_ext_weights_download():
if not os.path.isfile(onnx_zip_local):
wget.download(onnx_zip_url, out=onnx_zip_local)
......@@ -78,6 +79,8 @@ def test_end2end_ext_weights_download():
@pytest.mark.slow
@pytest.mark.vivado
@pytest.mark.end2end
@pytest.mark.xfail
def test_end2end_ext_weights_build():
model_file = get_checkpoint_name("download")
load_test_checkpoint_or_skip(model_file)
......@@ -110,6 +113,8 @@ def test_end2end_ext_weights_build():
@pytest.mark.board
@pytest.mark.end2end
@pytest.mark.xfail
def test_end2end_ext_weights_dataset():
# make sure we have local copies of mnist dataset files
subprocess.check_output(["mkdir", "-p", mnist_local])
......@@ -125,6 +130,8 @@ def test_end2end_ext_weights_dataset():
subprocess.check_output(rsync_dataset_cmd)
@pytest.mark.end2end
@pytest.mark.xfail
def test_end2end_ext_weights_run_on_hw():
build_env = get_build_env(build_kind, target_clk_ns)
deploy_dir = get_checkpoint_name("build")
......
......@@ -28,7 +28,6 @@
import pytest
# import numpy as np
from onnx import TensorProto, helper
from qonnx.core.datatype import DataType
from qonnx.core.modelwrapper import ModelWrapper
......@@ -39,8 +38,6 @@ from qonnx.util.basic import gen_finn_dt_tensor
import finn.core.onnx_exec as oxe
from finn.analysis.fpgadataflow.exp_cycles_per_layer import exp_cycles_per_layer
# from qonnx.custom_op.registry import getCustomOp
from finn.transformation.fpgadataflow.compile_cppsim import CompileCppSim
from finn.transformation.fpgadataflow.convert_to_hls_layers import InferStreamingMaxPool
from finn.transformation.fpgadataflow.hlssynth_ip import HLSSynthIP
......
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