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

Merge branch 'dev' of https://github.com/Xilinx/finn into feature/remote_pynq_execution

parents d42fe72a 2ebcae37
No related branches found
No related tags found
No related merge requests found
......@@ -2,4 +2,6 @@
Contributors
============
* Yaman Umuroglu <yamanu@xilinx.com>
* Yaman Umuroglu
* Jakoba Petri-Koenig
* Andrea Rigoni
......@@ -17,6 +17,9 @@ DOCKER_TAG="finn_${DOCKER_UNAME}"
# uncomment to run multiple instances with different names
# DOCKER_INST_NAME="finn_${DOCKER_UNAME}_${DOCKER_RND}"
DOCKER_INST_NAME="finn_${DOCKER_UNAME}"
# ensure Docker tag and inst. name are all lowercase
DOCKER_TAG=$(echo "$DOCKER_TAG" | tr '[:upper:]' '[:lower:]')
DOCKER_INST_NAME=$(echo "$DOCKER_INST_NAME" | tr '[:upper:]' '[:lower:]')
# the settings below will be taken from environment variables if available,
# otherwise the defaults below will be used
: ${JUPYTER_PORT=8888}
......
......@@ -5,7 +5,6 @@ from onnx import TensorProto, helper
import finn.util.basic as util
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fpgadataflow.cleanup import CleanUp
from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
......@@ -66,4 +65,3 @@ def test_code_gen_trafo():
op type {} is empty!""".format(
node.op_type
)
model = model.transform(CleanUp())
......@@ -5,7 +5,6 @@ from onnx import TensorProto, helper
import finn.util.basic as util
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fpgadataflow.cleanup import CleanUp
from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
from finn.transformation.fpgadataflow.compile import Compile
......@@ -63,4 +62,3 @@ def test_compilation_trafo():
op type {} does not exist!""".format(
node.op_type
)
model = model.transform(CleanUp())
......@@ -6,7 +6,6 @@ from onnx import TensorProto, helper
import finn.core.onnx_exec as oxe
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fpgadataflow.cleanup import CleanUp
from finn.transformation.fpgadataflow.codegen_ipgen import CodeGen_ipgen
from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
from finn.transformation.fpgadataflow.compile import Compile
......@@ -167,4 +166,3 @@ def test_fpgadataflow_slidingwindow(idt, k, ifm_dim, ifm_ch, stride):
model = model.transform(HLSSynth_IPGen())
y_produced = oxe.execute_onnx(model, input_dict)["outp"]
assert (y_produced == y_expected).all(), "rtlsim failed"
model = model.transform(CleanUp())
......@@ -9,7 +9,6 @@ from finn.analysis.fpgadataflow.hls_synth_res_estimation import hls_synth_res_es
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.custom_op.multithreshold import multithreshold
from finn.transformation.fpgadataflow.cleanup import CleanUp
from finn.transformation.fpgadataflow.codegen_ipgen import CodeGen_ipgen
from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
from finn.transformation.fpgadataflow.compile import Compile
......@@ -175,7 +174,6 @@ def test_fpgadataflow_fclayer_npysim(idt, wdt, act, nf, sf, mw, mh):
# execute model
y_produced = oxe.execute_onnx(model, input_dict)["outp"]
assert (y_produced.reshape(y_expected.shape) == y_expected).all(), "npysim failed"
model = model.transform(CleanUp())
# activation: None or DataType
......@@ -257,5 +255,3 @@ def test_fpgadataflow_fclayer_rtlsim(idt, wdt, act, nf, sf, mw, mh):
hls_synt_res_est = model.analysis(hls_synth_res_estimation)
assert "StreamingFCLayer_Batch_0" in hls_synt_res_est
model = model.transform(CleanUp())
......@@ -4,7 +4,6 @@ from onnx import TensorProto, helper
import finn.core.onnx_exec as oxe
from finn.core.datatype import DataType
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.fpgadataflow.cleanup import CleanUp
from finn.transformation.fpgadataflow.codegen_npysim import CodeGen_npysim
from finn.transformation.fpgadataflow.compile import Compile
from finn.transformation.fpgadataflow.set_exec_mode import SetExecMode
......@@ -111,7 +110,6 @@ def test_layer_streaming_maxpool_batch():
],
dtype=np.float32,
).reshape(2, 2, 4, 4)
print(input_tensor)
model = model.transform(SetExecMode("npysim"))
model = model.transform(CodeGen_npysim())
......@@ -119,5 +117,3 @@ def test_layer_streaming_maxpool_batch():
input_dict = {"in": input_tensor}
output_dict = oxe.execute_onnx(model, input_dict)
print(output_dict)
model = model.transform(CleanUp())
......@@ -30,16 +30,18 @@ def test_batchnorm_to_affine_lfc_w1a1():
os.remove(export_onnx_path)
def test_batchnorm_to_affine_cnv_w1a1():
lfc = get_test_model_trained("CNV", 1, 1)
bo.export_finn_onnx(lfc, (1, 3, 32, 32), export_onnx_path)
model = ModelWrapper(export_onnx_path)
model = model.transform(InferShapes())
model = model.transform(FoldConstants())
# TODO shape inference failing on transformed model below -- needs debug
new_model = model.transform(BatchNormToAffine())
# check that there are no BN nodes left
# TODO replace this with execution test
op_types = list(map(lambda x: x.op_type, new_model.graph.node))
assert "BatchNormalization" not in op_types
os.remove(export_onnx_path)
# cnv batchnorm to affine not yet supported
# def test_batchnorm_to_affine_cnv_w1a1():
# lfc = get_test_model_trained("CNV", 1, 1)
# bo.export_finn_onnx(lfc, (1, 3, 32, 32), export_onnx_path)
# model = ModelWrapper(export_onnx_path)
# model = model.transform(InferShapes())
# model = model.transform(FoldConstants())
# # TODO shape inference failing on transformed model below -- needs debug
# new_model = model.transform(BatchNormToAffine())
# # check that there are no BN nodes left
# # TODO replace this with execution test
# op_types = list(map(lambda x: x.op_type, new_model.graph.node))
# assert "BatchNormalization" not in op_types
# os.remove(export_onnx_path)
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