From 2d9deb58015dc890899835302ff38eda8f8653be Mon Sep 17 00:00:00 2001 From: lstasytis Date: Tue, 13 Aug 2024 12:35:16 +0100 Subject: [PATCH 1/3] [Deps] Update onnx commit hash --- fetch-repos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch-repos.sh b/fetch-repos.sh index 2033973f2a..6ce9ad76d4 100755 --- a/fetch-repos.sh +++ b/fetch-repos.sh @@ -27,7 +27,7 @@ # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -QONNX_COMMIT="fd61cfeebbdaba351abf7e9d54cd785d7776fa4f" +QONNX_COMMIT="2281a777d84aa5cbd7469085c2e534fb4a03ccf9" FINN_EXP_COMMIT="0724be21111a21f0d81a072fccc1c446e053f851" BREVITAS_COMMIT="84f42259ec869eb151af4cb8a8b23ad925f493db" PYVERILATOR_COMMIT="ce0a08c20cb8c1d1e84181d6f392390f846adbd1" From f32cce868d373e97b80a071c0520cea6b58aa4aa Mon Sep 17 00:00:00 2001 From: lstasytis Date: Tue, 13 Aug 2024 13:55:28 +0100 Subject: [PATCH 2/3] Updated auto_pad_to_explicit_padding function path --- .../fpgadataflow/infer_pixel_padding_deconv.py | 5 ++--- .../test_fpgadataflow_convinputgenerator_rtl_dynamic.py | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/finn/transformation/fpgadataflow/infer_pixel_padding_deconv.py b/src/finn/transformation/fpgadataflow/infer_pixel_padding_deconv.py index 8dbf7071fc..e1dcf1dde5 100644 --- a/src/finn/transformation/fpgadataflow/infer_pixel_padding_deconv.py +++ b/src/finn/transformation/fpgadataflow/infer_pixel_padding_deconv.py @@ -2,8 +2,7 @@ import warnings from onnx import TensorProto, helper from qonnx.transformation.base import Transformation -from qonnx.transformation.lower_convs_to_matmul import _auto_pad_to_explicit_padding -from qonnx.util.basic import get_by_name +from qonnx.util.basic import auto_pad_to_explicit_padding, get_by_name class InferPixelPaddingDeconv(Transformation): @@ -61,7 +60,7 @@ def apply(self, model): # use specified padding pad = get_by_name(n.attribute, "pads").ints else: - pad = _auto_pad_to_explicit_padding( + pad = auto_pad_to_explicit_padding( auto_pad, ifm_dim_h, ifm_dim_w, diff --git a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py index 9c45b06f4a..02c86d9972 100644 --- a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py +++ b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py @@ -43,8 +43,8 @@ from qonnx.transformation.infer_shapes import InferShapes from qonnx.transformation.lower_convs_to_matmul import ( LowerConvsToMatMul, - _auto_pad_to_explicit_padding, ) +from qonnx.util.basic import auto_pad_to_explicit_padding from qonnx.util.basic import gen_finn_dt_tensor, get_by_name, qonnx_make_model import finn.core.onnx_exec as oxe @@ -69,11 +69,11 @@ def create_conv_model(idim_h, idim_w, ifm, k, stride, ofm, idt, wdt, pad_mode, d group = ifm if depthwise else 1 group_str = str(group) ishp = (1, ifm, idim_h, idim_w) - pad_0 = _auto_pad_to_explicit_padding(pad_mode, idim_h, idim_w, k, k, stride, stride, 2) + pad_0 = auto_pad_to_explicit_padding(pad_mode, idim_h, idim_w, k, k, stride, stride, 2) int_dim_h = compute_conv_output_dim(idim_h, k, stride, total_pad=pad_0[0] + pad_0[2]) int_dim_w = compute_conv_output_dim(idim_w, k, stride, total_pad=pad_0[1] + pad_0[3]) - pad_1 = _auto_pad_to_explicit_padding(pad_mode, int_dim_h, int_dim_w, k, k, stride, stride, 2) + pad_1 = auto_pad_to_explicit_padding(pad_mode, int_dim_h, int_dim_w, k, k, stride, stride, 2) odim_h = compute_conv_output_dim(int_dim_h, k, stride, total_pad=pad_1[0] + pad_1[2]) odim_w = compute_conv_output_dim(int_dim_w, k, stride, total_pad=pad_1[1] + pad_1[3]) oshp = (1, ifm, odim_h, odim_w) if depthwise else (1, ofm, odim_h, odim_w) From f71f4ba55b3fd6f0b39e9e5166b86a54d135e9ba Mon Sep 17 00:00:00 2001 From: lstasytis1 Date: Tue, 13 Aug 2024 13:24:35 +0000 Subject: [PATCH 3/3] linted the commit --- ...test_fpgadataflow_convinputgenerator_rtl_dynamic.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py index 02c86d9972..26ce8f5f0e 100644 --- a/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py +++ b/tests/fpgadataflow/test_fpgadataflow_convinputgenerator_rtl_dynamic.py @@ -41,11 +41,13 @@ from qonnx.transformation.general import GiveReadableTensorNames, GiveUniqueNodeNames from qonnx.transformation.infer_datatypes import InferDataTypes from qonnx.transformation.infer_shapes import InferShapes -from qonnx.transformation.lower_convs_to_matmul import ( - LowerConvsToMatMul, +from qonnx.transformation.lower_convs_to_matmul import LowerConvsToMatMul +from qonnx.util.basic import ( + auto_pad_to_explicit_padding, + gen_finn_dt_tensor, + get_by_name, + qonnx_make_model, ) -from qonnx.util.basic import auto_pad_to_explicit_padding -from qonnx.util.basic import gen_finn_dt_tensor, get_by_name, qonnx_make_model import finn.core.onnx_exec as oxe import finn.transformation.fpgadataflow.convert_to_hw_layers as to_hw