-
Notifications
You must be signed in to change notification settings - Fork 17
Added 3D to 4D (tensor) transformation #19
Added 3D to 4D (tensor) transformation #19
Conversation
…m2col]: added/modified several test cases for (non-)square images and kernels
…ol]: added/modified several test cases for (non-)square images and kernels
…instead of integer as required by im2col node
[test_general_transformation]: changed the type of the kernel_size attribute to list of integers
…d kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution.
…lutions in tests" This reverts commit 3ff449c
…mages and kernels and non-equal padding." This reverts commit 15e34ed.
This reverts commit c524020.
…on value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2.
[test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested.
…on-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim
…on-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion.
[lower_convs_to_matmul]: minor fix with assumption on kernel dimension
…D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation
…ensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation.
…et). [test_4d_conversion]: added test case for 3D to 4D transform.
[test_4d_conversion]: changed the test case for an invalid graph.
[lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated).
[lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated).
[lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated).
[test_conv_lowering]: merged test functions into one test function.
[test_4d_converions]: rearranged code.
…mmrahorovic/finn-base into feature/3d_to_4d_transformation
# Initializers | ||
initializer_names = [] # list with all initializers | ||
initializers = {} # list with initializers from Conv, Mul, and Add nodes | ||
for i in model.graph.initializer: | ||
init_name = i.name | ||
initializer_names.append(init_name) | ||
if "Conv" in init_name: | ||
init_dim = i.dims | ||
init_dtype = i.data_type | ||
initializers[init_name] = [init_dtype] | ||
initializers[init_name].append(init_dim) | ||
elif init_name[0:4] == "Mul_": | ||
init_dim = i.dims | ||
if len(i.dims) == 3: | ||
init_dtype = i.data_type | ||
initializers[init_name] = [init_dtype] | ||
initializers[init_name].append(init_dim) | ||
elif "Add" in init_name: | ||
init_dim = i.dims | ||
if len(i.dims) == 3: | ||
init_dtype = i.data_type | ||
initializers[init_name] = [init_dtype] | ||
initializers[init_name].append(init_dim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part seems problematic to me. Is the intention to extract a list of initializers for particular node types? Currently you're checking the start of the initializer tensor name for this but that may not be reliable. A better way would be to build a list of nodes based on op_type in ["Conv","Mul","Add"]
, then use ModelWrapper.get_initializer()
on the inputs of each node.
# Value infos | ||
for t in model.graph.value_info: | ||
tensor_name = t.name | ||
if tensor_name in initializer_names: | ||
continue | ||
else: | ||
tensor_type = t.type.tensor_type.elem_type | ||
tensor_shape = model.get_tensor_shape(tensor_name) | ||
tensor_names[tensor_name] = [tensor_type] | ||
tensor_names[tensor_name].append(tensor_shape) | ||
|
||
# Outputs | ||
for t in model.graph.output: | ||
tensor_name = t.name | ||
tensor_type = t.type.tensor_type.elem_type | ||
tensor_shape = model.get_tensor_shape(tensor_name) | ||
tensor_names[tensor_name] = [tensor_type] | ||
tensor_names[tensor_name].append(tensor_shape) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bit (plus the bit that extracts the initializers above) could potentially be simplified by iterating on the list returned from ModelWrapper.get_all_tensor_names()
-- a list of all input, output and value_info tensor names in the graph. You can then iterate over this list to check whether it needs to be considered for 3D->4D or not.
Also one more general thing: for future PRs, can you please ensure you have merged |
* Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]>
* finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]>
* [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: jalezeta <[email protected]>
* Add default Verilator args to disable warnings, force inlining * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * fix broken logo in README * Extend Change3DTo4DTensors() to more layers (#31) * Support infer_datatype for flatten layer * 3d_to_4d support for additional nodes * Bugfix * Add ZCU111 to part map * Fix ZCU111 part * Separate PRs * Bugfix, new test case * [Docker] pin pyverilator version * [Util] pyverilate_stitched_ip: disable_common_warnings optional Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]>
* Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Inference cost: JSON export, parameter for output onnx * Added support for cost estimation for upsampling Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]>
* [Op] add skeleton for Quant custom op * [Op] more comments on Quant op * [InferDT] add MaxPool to list of identity ops for datatype inf. * [Transform] temporarily exclude Quant ops from const folding * [Analysis] add skeleton for inference_cost, limited conv support * [Analysis] support inference_cost_matmul * [Deps] add clize * [Util] add inference_cost util with entrypoint * [Docker] add clize * [Infra] add entrypoint for inference_cost * Preliminary implementation of quant operation * Fixed wrong numpy type in quant op * Made Quant pre-commit compatible * Changed docker base image to PyTorch and added Brevitas dockerfile and entrypoint * Implemented preliminary test for Quant operation * Reworked comments for Quant operation * Readability improvements for Quant operation * Created preliminary Quant op documentation * Move Quant op documentation * Made documentation of quant attributes more precise. * Created skeleton for Trunc QNNX operation * [DataType] add experimental SCALED(U)INT DataTypes * [Quant] use new scaled int dtypes for dt inference * [TypInf] use non-integer instead of float check in dt inference * [ConstFold] make op exclusion optional * [Analysis] deal with dyn matmul, add some zero-cost op types * [Analysis] make inference_cost optionally sparse-weights-aware * [Util] pass sparsity option to analysis pass, kwargs only for clize * [Analysis] add more free ops to inference_cost * [Quant] fallback to float32 for failed dtype inference * Inference cost: JSON export, parameter for output onnx * Removed FINN dependency from documentation * Added support for executing qonnx custom_ops. * Add support for Bipolar and Binary FINN datatype for Quant op. (#41) * Add support for Bipolar and Binary FINN datatype for Quant op. * [Quant] custom qnt execution for bipolar until Brevitas bug resolved Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for cost estimation for upsampling (#37) * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Inference cost: JSON export, parameter for output onnx * Added support for cost estimation for upsampling Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * [Quant] fix edge case for 0d input array execution * Added trunc support for MobileNet, needs some fixing. * Made trunc datatype inference pass-through. * Addressed numpy deprecation warning in Truc op exectution. * Updated Quant op to support rounding mode. * Added support for new Trunc op. * Added support for static datatype inference to the Trunc op. * Resolved left over ToDo in Trunc op. * Remove scaledInt from Trunc op and replace with float32. * Moved RemoveIdentityOps transformation from FINN to finn-base. * Fixed a bug in RemoveIdentityOps, where an identity op would not get removed if it was preceded by another identity op. * Moved GemmToMatMul from FINN to finn-base. * Added support for recognizing MultiThreshold node in sign discovery. * Moved RemoveEmptyPadding transformation from finn to finn-base. * Updated Quant op documentation to add the rounding_mode attribute. * Added documentation for trunc op and small adjustments for Quant op documentation. * Added preliminary support for BinaryQuant node. * Updated datatype inference for Quant and BinaryQuant to remove scaledInt types. * Fixed bug in datatype inference for Quant node. * Added support for merging into non-linear graphs for _remove_node_and_rewire function. * Added another op to sign_preserving_ops. * Updated Trunc op documentation. * Extended graph based signed inference to more quantization nodes. * Renamed BinaryQuant to BipolarQuant. * Renamed BinaryQuant to BipolarQuant for Trunc op Signed inference. * Updated BipolarQuant op documentation and moved documentation of QONNX ops into their own folder. * Made remove_node_and_rewire function part of the publicly facing api. * Adapt test_remove_identity_ops to new datatype system. * Made padding removal more reliable. * Moved ExtractBiasFromConv transformation from FINN to finn-base. * Fixed changed import for test_remove_identity_ops test. * Extended MultiThreshold data type inference to adjust for float scale/bias. * Removed test_brevitas_quant_onnx_export_and_exec test, since test_QONNX_to_FINN in FINN already tests for the same. * Fixed spelling typos in QONNX op documentation. * Specified rounding operation in Quant and Trunc documentation. * Updated version description for QONNX ops documentation. * Removed dependency on onnxoptimizer. * Refactored check for float. * Refactored get_internal_dtype to get_integer_datatype. * Disabled constant folding for Quant and BipolarQuant by default. * Added a warning if an unsupported ONNX version is encountered during the GemmToMatMul transformation. * Moved functionality of RemoveEmptyPadding into RemoveIdentityOps. * Made float32 default output for Trunc node and removed sign inference from node. Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]>
* GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * fix broken logo in README * Extend Change3DTo4DTensors() to more layers (#31) * Support infer_datatype for flatten layer * 3d_to_4d support for additional nodes * Bugfix * Add ZCU111 to part map * Fix ZCU111 part * Separate PRs * Bugfix, new test case * Verilator: force inlining, disable common warnings (#33) * Add default Verilator args to disable warnings, force inlining * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Update quantavgpool2d.py (#22) Add "Copyright (c) 2021 Xilinx, Inc" heather * [batchnorm_to_affine]: epsilon value is now read out from the attributes. (#21) [test_batchnorm_to_affine]: added a test case for various epsilon values. * Added 3D to 4D (tensor) transformation (#19) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_convs_to_matmul] removed old assertion [test_conv_lowering] added more dilation values to test cases. Dilation values of {1, 2, 3, 4} are tested. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim [test_conv_lowering] changed function call to compute_conv_output_dim * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: minor fix with assumption on kernel dimension [lower_convs_to_matmul]: minor fix with assumption on kernel dimension * [change_3d_tensors_to_4d]: added new transformation that transforms 3D tensors to 4D and changes the nodes accordingly [test_4d_conversion]: test function for 3D to 4D tensor transformation * [change_3d_tensors_to_4d]: added new transformation that changes 3D tensors to 4D. [test_4d_conversion]: added a test case for the 3D to 4D transformation. * [change_3d_tensors_to_4d]: added 3D to 4D transformation (for QuartzNet). [test_4d_conversion]: added test case for 3D to 4D transform. * [change_3d_tensors_to_4d]: changed how an invalid graph is handled. [test_4d_conversion]: changed the test case for an invalid graph. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [im2col]: minor style change and changed the way how a square kernel is instantiated. * [test_conv_lowering]: merged tests for depthwise and standard convolutions. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * [im2col]: minor style adjustment. [test_conv_lowering]: merged test functions into one test function. * [change_3d_tensors_to_4d]: style fixes and comments. [test_4d_converions]: rearranged code. * [Transform] check invalid node list length * [change_3d_tensors_to_4d]: rearranged the code to make it more readable. Co-authored-by: Yaman Umuroglu <[email protected]> * [Docs] update tutorials * [Util] experimental: fast_mode data packing for binary (#24) * Generic partitioning feature (#23) * Add basic partitioning functionality * Mount build dir within docker container * Support for non-linear models and multi in/out partitions * Remove dataflowpartition custom op from finn-base * Fix temporary build dir for CI * Fix docstring * [create_generic_partitions]: minor modification, removed redundant output value_info entries. (#26) * [extend_partition]: added a new transformation ExtendPartition. (#27) [test_extend_partition]: added a test case for the new transformation. * Added support for non-equal strides along different axes (#25) * [im2col]: added support for non-equal strides along different axes and cleaned up the code. [lower_convs_to_matmul]: added support for non-equal strides along different axes and cleaned up the code. [test_conv_lowering]: added test case for non-equal strides along different axes. * [im2col]: minor fix. [test_im2col]: added test case for non-equal strides along different axes. * Changes for supporting vitis_hls (#28) * [Refactor] split up RTL/HLS-related utils * [Util] rename to CallHLS and allow specifying vivado_hls/vitis_hls * [Util] more flexible stream naming in rtlsim_multi_io * Changes for supporting non-equal dilation (#29) * added support for non-equal dilation value along (H, W) dimension * added test cases for non-equal dilation configurations * appending dilation value along dummy dimension correctly (i.e. with a '1') * changed tensor sparsity annotation for consistency * Support infer_datatype for flatten layer (#30) * Support infer_datatype for flatten layer * [InferDT] add more identity op types for datatype inference * [Lint] fix linting issues Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * Update python-publish.yml * Update python-publish.yml * Lint Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> Co-authored-by: Felix Jentzsch <[email protected]> * fix broken logo in README * Extend Change3DTo4DTensors() to more layers (#31) * Support infer_datatype for flatten layer * 3d_to_4d support for additional nodes * Bugfix * Add ZCU111 to part map * Fix ZCU111 part * Separate PRs * Bugfix, new test case * [Docker] pin pyverilator version * [Util] pyverilate_stitched_ip: disable_common_warnings optional Co-authored-by: Yaman Umuroglu <[email protected]> Co-authored-by: Mirza Mrahorovic <[email protected]> Co-authored-by: jalezeta <[email protected]> * Copied platforms from finn-experimental and made pre-commit conform (#36) * Copied platforms from finn-experimental and made pre-commit conform * Add ZCU102 and ZCU111 platforms * [Util] add comments on platforms.py Co-authored-by: Felix Jentzsch <[email protected]> Co-authored-by: Yaman Umuroglu <[email protected]> * Various fixes from multi-headed net testing (#45) * [QuantAvgPool2d] support broader range of DataTypes for inference * [pyverilator] use case-agnostic r/w fxns in rtlsim_multi_io * [Rename] support renaming multiple i/o + add test * [InferDT] more identity case, support NN upsample/resize * [InferDT] fix typo * [DataLayout] add more layout variants and MakeInputChanLast trafo * [Test] fix test_infer_datatypes * [ModelWrapper] add assertions for multiple ValueInfoProto multiple VIPs cause undefined behavior when changing the graph * [Core] node input ValueInfos can come from graph output too * [Partition] don't duplicate VIP for border nodes * [Test] increase atol for test_batchnorm_to_affine_shufflenet * chore: Add message to AssertionError (#44) * chore: Add message to AssertionError when file passed to ModelWrapper does not exists (or is not a file) * Various fixes from multi-headed net testing (#45) * [QuantAvgPool2d] support broader range of DataTypes for inference * [pyverilator] use case-agnostic r/w fxns in rtlsim_multi_io * [Rename] support renaming multiple i/o + add test * [InferDT] more identity case, support NN upsample/resize * [InferDT] fix typo * [DataLayout] add more layout variants and MakeInputChanLast trafo * [Test] fix test_infer_datatypes * [ModelWrapper] add assertions for multiple ValueInfoProto multiple VIPs cause undefined behavior when changing the graph * [Core] node input ValueInfos can come from graph output too * [Partition] don't duplicate VIP for border nodes * [Test] increase atol for test_batchnorm_to_affine_shufflenet * Run linter Co-authored-by: Yaman Umuroglu <[email protected]> * [Core] hotfix, relax set_tensor_layout checks otherwise running data layout inference on e.g. models with reshape catches on this assertion * [InferShapes] hotfix for defaulting to unknown data layout * [Partition] hotfix: empty protobuf containers with pop() iterating over the container and calling remove(x) can still leave items inside it * [Core] unify exec paths for GenericPartition+StreamingDFPartition * rtlsim improvements (#47) * bugfix in rtlsim_multi_io * allow extra args in pyverilate_stitched_ip * allow multiple i/o in rtlsim_exec through rtlsim_multi_io also add possibility to pass extra args through metadata_prop * support multiple i/o in throughput_test_rtlsim * fast npy->rtlsim packing when innermost dim=1 * [Core] hotfix for 0-len input nodes in find_* fxns * [Core] hotfix: bug in find_consumer implementation * [Core] hotfix: respect model opset version for node-by-node exec * DataType system refactoring and fixed-point types (#50) * [DataType] sketch new classes for FINN DataTypes * [DataType] flesh out refactored DataType for existing types * [Refactor] DataType.X -> DataType["X"] * [DataType] sketch FixedPointType * [DataType] tweaks to FixedPointType + add is_fixed_point * [Test] add test_datatypes_fixedpoint * [Util] data packing for fixed point types * [Test] data un/packing tests for fixed point * [Util] more fixed-point datatype support * [Test] test fixed-point random tensor gen * [DataType] refactor fxn to get accumulator dt cands * [Refactor] get_smallest_possible and get_dt_cands as staticmethod * [Util] print dt name during sanitize_quant_tensors check * [DataType] fix cand types for get_smallest_possible * [Util, Test] fix unpacking for float32 + add test * [DataType, Test] hotfix: override str/repr fxns for DataType * [Refactor] use RandomNormal instead of Const for shape inf. (#51) * [Test] fix and strenghten test_im2col_infer_shapes * [Refactor] reimpl const shape inference in base CustomOp * QONNX ops and new general transformations (#52) * [Op] add skeleton for Quant custom op * [Op] more comments on Quant op * [InferDT] add MaxPool to list of identity ops for datatype inf. * [Transform] temporarily exclude Quant ops from const folding * [Analysis] add skeleton for inference_cost, limited conv support * [Analysis] support inference_cost_matmul * [Deps] add clize * [Util] add inference_cost util with entrypoint * [Docker] add clize * [Infra] add entrypoint for inference_cost * Preliminary implementation of quant operation * Fixed wrong numpy type in quant op * Made Quant pre-commit compatible * Changed docker base image to PyTorch and added Brevitas dockerfile and entrypoint * Implemented preliminary test for Quant operation * Reworked comments for Quant operation * Readability improvements for Quant operation * Created preliminary Quant op documentation * Move Quant op documentation * Made documentation of quant attributes more precise. * Created skeleton for Trunc QNNX operation * [DataType] add experimental SCALED(U)INT DataTypes * [Quant] use new scaled int dtypes for dt inference * [TypInf] use non-integer instead of float check in dt inference * [ConstFold] make op exclusion optional * [Analysis] deal with dyn matmul, add some zero-cost op types * [Analysis] make inference_cost optionally sparse-weights-aware * [Util] pass sparsity option to analysis pass, kwargs only for clize * [Analysis] add more free ops to inference_cost * [Quant] fallback to float32 for failed dtype inference * Inference cost: JSON export, parameter for output onnx * Removed FINN dependency from documentation * Added support for executing qonnx custom_ops. * Add support for Bipolar and Binary FINN datatype for Quant op. (#41) * Add support for Bipolar and Binary FINN datatype for Quant op. * [Quant] custom qnt execution for bipolar until Brevitas bug resolved Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for cost estimation for upsampling (#37) * Update AUTHORS.rst * Create python-publish.yml * Add ZCU111 board to part map (#32) * Update AUTHORS.rst * GHA for PyPI, sdist only (#35) * finn-base v0.0.2 (#34) * Modified set_nodeattr to allow using it on repeated fields (#18) * [base]: changed how the floats, ints, strings, tensors, graphs and sparse_tensors field of AttributeProto is set. * [Core] restrict attributes to tested types Co-authored-by: Yaman Umuroglu <[email protected]> * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst * Support for non-square input images and kernels in LowerConvsToMatMul transformation (#16) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] function compute_conv_output_dim can now be called in case non-equal and equal padding is assumed. [test_im2col] changed function call to compute_conv_output_dim. [test_conv_lowering] changed function call to compute_conv_output_dim. [lower_convs_to_matmul] removed old assertion. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [test_conv_lowering]: minor fix for test case depthwise and regular convolutions * Support for non-square input images and kernels for im2col node (#20) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col]: changed how a square kernel is instantiated. [lower_convs_to_matmul]: changed how the kernel size attribute is read (based on how a square kernel is instantiated). * [im2col]: minor change in style. * [Im2Col] style fixes and comments Co-authored-by: Yaman Umuroglu <[email protected]> * Update AUTHORS.rst Co-authored-by: Yaman Umuroglu <[email protected]> * Added support for dilation value = 2 for 1D and 2D images/kernels (#17) * [im2col.py]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [im2col]: support for non-square input images and kernels, [test_im2col]: added/modified several test cases for (non-)square images and kernels * [test_general_transformation]: changed kernel_size attribute to list instead of integer as required by im2col node * [base]: changed how the "ints" field of AttributeProto set. [test_general_transformation]: changed the type of the kernel_size attribute to list of integers * removed unused import * [base]: added support for writing repeated fields in AttributeProto * minor style changes * [im2col, test_im2col]: added support for non-equal padding * [lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding. [test_conv_lowering]: added/modified test cases for non-equal padding, depthwise convolution and 'standard' convolution. * [test_conv_lowering]: included 1D depthwise and regular convolutions in tests * Revert "[test_conv_lowering]: included 1D depthwise and regular convolutions in tests" This reverts commit 3ff449c42d709e640ca904c41a241bb94fc9e335 * Revert "[lower_convs_to_matmul]: added support for non-square input images and kernels and non-equal padding." This reverts commit 15e34ed8d07d4a55996f162bd3bd1aa24b33c3ac. * Revert "[im2col, test_im2col]: added support for non-equal padding" This reverts commit c524020ee8a7b363eb0c30d70cf21332e9c73678. * [im2col] added support for dilations = 2 for 2D and 1D images. Dilation value must be equal along each axis. [test_im2col] added several test cases in case dilations = 2 (a.o. cases where image and kernel are 2D and 1D, with and without padding, and with stride = 2). [lower_convs_to_matmul] added support for dilation value. Dilation value must be equal along each axis. [test_conv_lowering] added test case for dilations = 2 for 2D and 1D images and kernels, with and without padding, and with stride = 2. * [lower_…
[change_3d_tensors_to_4d]: 3D to 4D transformation of tensors. This transformation was needed to make QuartzNet compatible with other transformations (like LowerConvsToMatMul).
[test_4d_conversion]: added test cases for the 3D to 4D (tensor) transformation.
This pull request (PR) contains the changes from PR #17.