diff --git a/notebooks/end2end_example/cnv_end2end_example.ipynb b/notebooks/end2end_example/cnv_end2end_example.ipynb index e0f346eb294751e49343cb329e8f499d1013dab7..cecb1c9be6d59262e13d77d3d6b3242a013f5ee3 100644 --- a/notebooks/end2end_example/cnv_end2end_example.ipynb +++ b/notebooks/end2end_example/cnv_end2end_example.ipynb @@ -84,7 +84,6 @@ "from finn.util.test import get_test_model_trained\n", "import brevitas.onnx as bo\n", "from finn.core.modelwrapper import ModelWrapper\n", - "from finn.transformation.double_to_single_float import DoubleToSingleFloat\n", "from finn.transformation.infer_shapes import InferShapes\n", "from finn.transformation.fold_constants import FoldConstants\n", "from finn.transformation.general import GiveReadableTensorNames, GiveUniqueNodeNames\n", @@ -92,7 +91,6 @@ "cnv = get_test_model_trained(\"CNV\", 1, 1)\n", "bo.export_finn_onnx(cnv, (1, 3, 32, 32), build_dir + \"/end2end_cnv_w1a1_export.onnx\")\n", "model = ModelWrapper(build_dir + \"/end2end_cnv_w1a1_export.onnx\")\n", - "model = model.transform(DoubleToSingleFloat())\n", "model = model.transform(InferShapes())\n", "model = model.transform(FoldConstants())\n", "model = model.transform(GiveUniqueNodeNames())\n", diff --git a/tests/brevitas/test_brevitas_cnv.py b/tests/brevitas/test_brevitas_cnv.py index 764671bee13710ef1d9fa21aab5ef600075b9b0d..120c67646de08a1a9875b76bedd3a0130792b487 100644 --- a/tests/brevitas/test_brevitas_cnv.py +++ b/tests/brevitas/test_brevitas_cnv.py @@ -39,7 +39,6 @@ from finn.core.modelwrapper import ModelWrapper from finn.transformation.fold_constants import FoldConstants from finn.transformation.infer_shapes import InferShapes from finn.transformation.general import GiveUniqueNodeNames, RemoveStaticGraphInputs -from finn.transformation.double_to_single_float import DoubleToSingleFloat from finn.util.test import get_test_model_trained export_onnx_path = "test_brevitas_cnv.onnx" @@ -54,7 +53,6 @@ def test_brevitas_cnv_export_exec(wbits, abits): bo.export_finn_onnx(cnv, (1, 3, 32, 32), export_onnx_path) model = ModelWrapper(export_onnx_path) model = model.transform(GiveUniqueNodeNames()) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(RemoveStaticGraphInputs()) diff --git a/tests/brevitas/test_brevitas_debug.py b/tests/brevitas/test_brevitas_debug.py index 84fcf4a3827c9f5576a8292ef4719b3b0fb1dfe0..50d0ca44cd0befe5d08b5c1b45edf602457bda19 100644 --- a/tests/brevitas/test_brevitas_debug.py +++ b/tests/brevitas/test_brevitas_debug.py @@ -41,7 +41,6 @@ from finn.transformation.fold_constants import FoldConstants from finn.transformation.general import RemoveStaticGraphInputs from finn.transformation.infer_shapes import InferShapes from finn.util.test import get_test_model_trained -from finn.transformation.double_to_single_float import DoubleToSingleFloat def test_brevitas_debug(): @@ -50,7 +49,6 @@ def test_brevitas_debug(): dbg_hook = bo.enable_debug(fc) bo.export_finn_onnx(fc, (1, 1, 28, 28), finn_onnx) model = ModelWrapper(finn_onnx) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(RemoveStaticGraphInputs()) diff --git a/tests/end2end/test_end2end_bnn_pynq.py b/tests/end2end/test_end2end_bnn_pynq.py index 45b64d1969c30ae7bd00b391d6bbca0c3eaec2fc..b997fbae195f9226a727ea82f51f3903ec0699de 100644 --- a/tests/end2end/test_end2end_bnn_pynq.py +++ b/tests/end2end/test_end2end_bnn_pynq.py @@ -66,7 +66,6 @@ from finn.util.test import ( ) from finn.transformation.fpgadataflow.annotate_resources import AnnotateResources from finn.transformation.infer_data_layouts import InferDataLayouts -from finn.transformation.double_to_single_float import DoubleToSingleFloat from finn.transformation.move_reshape import RemoveCNVtoFCFlatten from finn.transformation.lower_convs_to_matmul import LowerConvsToMatMul from finn.transformation.streamline.reorder import MakeMaxPoolNHWC @@ -211,7 +210,6 @@ class TestEnd2End: def test_import_and_tidy(self, topology, wbits, abits): prev_chkpt_name = get_checkpoint_name(topology, wbits, abits, "export") model = load_test_checkpoint_or_skip(prev_chkpt_name) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames()) diff --git a/tests/fpgadataflow/test_convert_to_hls_layers_cnv.py b/tests/fpgadataflow/test_convert_to_hls_layers_cnv.py index 20e3ee08d7ffdd013a89d26bb71d86ccc554a5b4..e8b50efef0723c1394c2bdd438a87e090071507d 100644 --- a/tests/fpgadataflow/test_convert_to_hls_layers_cnv.py +++ b/tests/fpgadataflow/test_convert_to_hls_layers_cnv.py @@ -42,7 +42,6 @@ from finn.transformation.infer_shapes import InferShapes from finn.transformation.infer_data_layouts import InferDataLayouts from finn.transformation.streamline import Streamline from finn.util.test import get_test_model_trained -from finn.transformation.double_to_single_float import DoubleToSingleFloat from finn.transformation.lower_convs_to_matmul import LowerConvsToMatMul from finn.transformation.bipolar_to_xnor import ConvertBipolarMatMulToXnorPopcount import finn.transformation.fpgadataflow.convert_to_hls_layers as to_hls @@ -61,7 +60,6 @@ def test_convert_to_hls_layers_cnv_w1a1(fused_activation): cnv = get_test_model_trained("CNV", 1, 1) bo.export_finn_onnx(cnv, (1, 3, 32, 32), export_onnx_path_cnv) model = ModelWrapper(export_onnx_path_cnv) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames()) diff --git a/tests/fpgadataflow/test_convert_to_hls_layers_synthetic.py b/tests/fpgadataflow/test_convert_to_hls_layers_synthetic.py index 9d861929f3d421c431a27ccac5d513938aa7d726..3c8da5de1d8629b3692646e1aa18120ffcc30b99 100644 --- a/tests/fpgadataflow/test_convert_to_hls_layers_synthetic.py +++ b/tests/fpgadataflow/test_convert_to_hls_layers_synthetic.py @@ -46,7 +46,6 @@ from finn.transformation.infer_datatypes import InferDataTypes from finn.transformation.infer_data_layouts import InferDataLayouts from finn.util.basic import gen_finn_dt_tensor from finn.util.test import soft_verify_topk -from finn.transformation.double_to_single_float import DoubleToSingleFloat from finn.transformation.insert_topk import InsertTopK import finn.transformation.fpgadataflow.convert_to_hls_layers as to_hls from finn.transformation.fpgadataflow.prepare_cppsim import PrepareCppSim @@ -149,7 +148,6 @@ def test_convert_to_hls_layers_synthetic(ch, ifmdim, idt): model = make_model(ch, ifmdim) model.save(export_onnx_path) model = ModelWrapper(export_onnx_path) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames()) diff --git a/tests/transformation/streamline/test_streamline_cnv.py b/tests/transformation/streamline/test_streamline_cnv.py index bcb66a2c22eb4d6a998580129881793bbc86b250..82a38636e3927e17e5e2a3e8714f46082bba10e4 100644 --- a/tests/transformation/streamline/test_streamline_cnv.py +++ b/tests/transformation/streamline/test_streamline_cnv.py @@ -44,7 +44,6 @@ from finn.transformation.infer_shapes import InferShapes from finn.transformation.streamline import Streamline from finn.util.test import get_test_model_trained from finn.util.basic import make_build_dir -from finn.transformation.double_to_single_float import DoubleToSingleFloat export_onnx_path = make_build_dir("test_streamline_cnv_") @@ -62,7 +61,6 @@ def test_streamline_cnv(size, wbits, abits): fc = get_test_model_trained(size, wbits, abits) bo.export_finn_onnx(fc, (1, 3, 32, 32), finn_onnx) model = ModelWrapper(finn_onnx) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames()) diff --git a/tests/transformation/test_batchnorm_to_affine.py b/tests/transformation/test_batchnorm_to_affine.py index 43110c6bf9e5469b2ca21ac667d7f92808017fb8..a3df5ae9bbd3f99bc29bc088a5f461122af06d81 100644 --- a/tests/transformation/test_batchnorm_to_affine.py +++ b/tests/transformation/test_batchnorm_to_affine.py @@ -41,7 +41,6 @@ from finn.transformation.batchnorm_to_affine import BatchNormToAffine from finn.transformation.fold_constants import FoldConstants from finn.transformation.infer_shapes import InferShapes from finn.util.test import get_test_model_trained -from finn.transformation.double_to_single_float import DoubleToSingleFloat export_onnx_path = "test_output_bn2affine.onnx" @@ -50,7 +49,6 @@ 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(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) fn = pk.resource_filename("finn", "data/cifar10/cifar10-test-data-class3.npz") diff --git a/tests/transformation/test_conv_lowering.py b/tests/transformation/test_conv_lowering.py index ab545d483321f8c52625b5401828277987bba3a9..b6ab634b374dea3ba309bbf12654c73c0a90e36c 100644 --- a/tests/transformation/test_conv_lowering.py +++ b/tests/transformation/test_conv_lowering.py @@ -40,7 +40,6 @@ from finn.transformation.fold_constants import FoldConstants from finn.transformation.infer_shapes import InferShapes from finn.util.test import get_test_model_trained from finn.transformation.lower_convs_to_matmul import LowerConvsToMatMul -from finn.transformation.double_to_single_float import DoubleToSingleFloat import finn.core.onnx_exec as oxe from finn.custom_op.im2col import compute_conv_output_dim from finn.util.basic import gen_finn_dt_tensor @@ -53,7 +52,6 @@ def test_conv_lowering_cnv_w1a1(): cnv = get_test_model_trained("CNV", 1, 1) bo.export_finn_onnx(cnv, (1, 3, 32, 32), export_onnx_path) model = ModelWrapper(export_onnx_path) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) fn = pk.resource_filename("finn", "data/cifar10/cifar10-test-data-class3.npz") diff --git a/tests/transformation/test_infer_data_layouts.py b/tests/transformation/test_infer_data_layouts.py index d6d9920043114c78e970842aee5955e3150cf526..0bc30ea0eb48087606545c86e705328217b004ca 100644 --- a/tests/transformation/test_infer_data_layouts.py +++ b/tests/transformation/test_infer_data_layouts.py @@ -37,7 +37,6 @@ from finn.transformation.general import GiveReadableTensorNames, GiveUniqueNodeN from finn.transformation.infer_shapes import InferShapes from finn.transformation.streamline import Streamline from finn.util.test import get_test_model_trained -from finn.transformation.double_to_single_float import DoubleToSingleFloat from finn.transformation.lower_convs_to_matmul import LowerConvsToMatMul from finn.transformation.bipolar_to_xnor import ConvertBipolarMatMulToXnorPopcount import finn.transformation.fpgadataflow.convert_to_hls_layers as to_hls @@ -51,7 +50,6 @@ def test_infer_data_layouts(): cnv = get_test_model_trained("CNV", 1, 1) bo.export_finn_onnx(cnv, (1, 3, 32, 32), export_onnx_path_cnv) model = ModelWrapper(export_onnx_path_cnv) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames()) diff --git a/tests/transformation/test_linear_past_eltwise.py b/tests/transformation/test_linear_past_eltwise.py index 4cff5e5e1d40986a006cc02186fce21a907c2ef1..f5af2307fb042879a837a26c50715c8ec1b96963 100644 --- a/tests/transformation/test_linear_past_eltwise.py +++ b/tests/transformation/test_linear_past_eltwise.py @@ -37,7 +37,6 @@ from finn.transformation.fold_constants import FoldConstants from finn.transformation.general import GiveReadableTensorNames, GiveUniqueNodeNames from finn.transformation.streamline.reorder import MoveLinearPastEltwiseAdd from finn.transformation.infer_shapes import InferShapes -from finn.transformation.double_to_single_float import DoubleToSingleFloat import pytest @@ -105,7 +104,6 @@ def test_linear_past_eltwise_add(ch, ifmdim): model = make_model(input_tensor_shape) model.save(export_onnx_path) model = ModelWrapper(export_onnx_path) - model = model.transform(DoubleToSingleFloat()) model = model.transform(InferShapes()) model = model.transform(FoldConstants()) model = model.transform(GiveUniqueNodeNames())