fastmachinelearning / hls4ml

Machine learning on FPGAs using HLS
https://fastmachinelearning.org/hls4ml
Apache License 2.0
1.24k stars 402 forks source link

Pre-synthesis failed when building a network with QKeras Layers #289

Open JunningFan opened 3 years ago

JunningFan commented 3 years ago

Hi,

I'm trying yo use hls4ml to translate a network model with QKeras layers. Sadly, the generated HLS project failed to synthesis in vivado_hls tool. The log, network model, YAML config, and the generated HLS is attached. Any help is appreciated.

model.zip project.zip

Environment: Windows 10 20H2 Vivado and Vivado HLS 2018.2 HLS4ML 0.5.0b0

Log: SyntaxWarning: "is not" with a literal. Did you mean "!="? if found is not 0: 2021-03-02 13:23:17.163205: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll Loading configuration from .\my-hls-test/hls4ml_config.yml

** Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2018.2 (64-bit) SW Build 2258646 on Thu Jun 14 20:03:12 MDT 2018 IP Build 2256618 on Thu Jun 14 22:10:49 MDT 2018 ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

source D:/Xilinx/Vivado/2018.2/scripts/vivado_hls/hls.tcl -notrace INFO: [HLS 200-10] Running 'D:/Xilinx/Vivado/2018.2/bin/unwrapped/win64.o/vivado_hls.exe' INFO: [HLS 200-10] For user 'haoxi' on host 'haoxi-pc' (Windows NT_amd64 version 6.2) on Tue Mar 02 13:23:20 +1100 2021 INFO: [HLS 200-10] In directory 'E:/DLProjects/hls4ml/my-hls-test' INFO: [HLS 200-10] Creating and opening project 'E:/DLProjects/hls4ml/my-hls-test/myproject_prj'. INFO: [HLS 200-10] Adding design file 'firmware/myproject.cpp' to the project INFO: [HLS 200-10] Adding test bench file 'myproject_test.cpp' to the project INFO: [HLS 200-10] Adding test bench file 'firmware/weights' to the project INFO: [HLS 200-10] Adding test bench file 'tb_data' to the project INFO: [HLS 200-10] Creating and opening solution 'E:/DLProjects/hls4ml/my-hls-test/myproject_prj/solution1'. INFO: [XFORM 203-101] Allowed max sub elements number after partition is 4096. INFO: [XFORM 203-1161] The maximum of name length is set into 60. INFO: [HLS 200-10] Setting target device to 'xc7z020clg484-1' INFO: [SYN 201-201] Setting up clock 'default' with a period of 20ns. INFO: [Common 17-206] Exiting vivado_hls at Tue Mar 2 13:23:20 2021... PS E:\DLProjects\hls4ml> python C:\Users\haoxi\anaconda3\Scripts\hls4ml build -p .\my-hls-test -a C:\Users\haoxi\anaconda3\Scripts\hls4ml:171: SyntaxWarning: "is not" with a literal. Did you mean "!="? if found is not 0: 2021-03-02 13:23:24.678717: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library cudart64_110.dll Loading configuration from .\my-hls-test/hls4ml_config.yml

** Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2018.2 (64-bit) SW Build 2258646 on Thu Jun 14 20:03:12 MDT 2018 IP Build 2256618 on Thu Jun 14 22:10:49 MDT 2018 ** Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.

source D:/Xilinx/Vivado/2018.2/scripts/vivado_hls/hls.tcl -notrace INFO: [HLS 200-10] Running 'D:/Xilinx/Vivado/2018.2/bin/unwrapped/win64.o/vivado_hls.exe' INFO: [HLS 200-10] For user 'haoxi' on host 'haoxi-pc' (Windows NT_amd64 version 6.2) on Tue Mar 02 13:23:27 +1100 2021 INFO: [HLS 200-10] In directory 'E:/DLProjects/hls4ml/my-hls-test' INFO: [HLS 200-10] Opening project 'E:/DLProjects/hls4ml/my-hls-test/myproject_prj'. INFO: [HLS 200-10] Adding design file 'firmware/myproject.cpp' to the project INFO: [HLS 200-10] Adding test bench file 'myproject_test.cpp' to the project INFO: [HLS 200-10] Adding test bench file 'firmware/weights' to the project INFO: [HLS 200-10] Adding test bench file 'tb_data' to the project INFO: [HLS 200-10] Opening solution 'E:/DLProjects/hls4ml/my-hls-test/myproject_prj/solution1'. INFO: [SYN 201-201] Setting up clock 'default' with a period of 20ns. INFO: [HLS 200-10] Setting target device to 'xc7z020clg484-1' INFO: [XFORM 203-101] Allowed max sub elements number after partition is 4096. INFO: [XFORM 203-1161] The maximum of name length is set into 60. INFO: [XFORM 203-101] Allowed max sub elements number after partition is 4096. INFO: [XFORM 203-1161] The maximum of name length is set into 60. C SIMULATION INFO: [SIM 211-2] CSIM start INFO: [SIM 211-4] CSIM will launch GCC as the compiler. Compiling ../../../../myproject_test.cpp in debug mode Compiling ../../../../firmware/myproject.cpp in debug mode Generating csim.exe In file included from D:/Xilinx/Vivado/2018.2/include/floating_point_v7_0_bitacc_cmodel.h:143:0, from D:/Xilinx/Vivado/2018.2/include/hls_fpo.h:166, from D:/Xilinx/Vivado/2018.2/include/hls_half.h:58, from D:/Xilinx/Vivado/2018.2/include/ap_int_sim.h:73, from D:/Xilinx/Vivado/2018.2/include/ap_int.h:65, from ../../../../firmware/myproject.h:23, from ../../../../myproject_test.cpp:28: D:/Xilinx/Vivado/2018.2/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined

define __GMP_LIBGMP_DLL 0

In file included from D:/Xilinx/Vivado/2018.2/include/hls_fpo.h:166:0, from D:/Xilinx/Vivado/2018.2/include/hls_half.h:58, from D:/Xilinx/Vivado/2018.2/include/ap_int_sim.h:73, from D:/Xilinx/Vivado/2018.2/include/ap_int.h:65, from ../../../../firmware/myproject.h:23, from ../../../../myproject_test.cpp:28: D:/Xilinx/Vivado/2018.2/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition

define __GMP_LIBGMP_DLL 1

In file included from D:/Xilinx/Vivado/2018.2/include/floating_point_v7_0_bitacc_cmodel.h:143:0, from D:/Xilinx/Vivado/2018.2/include/hls_fpo.h:166, from D:/Xilinx/Vivado/2018.2/include/hls_half.h:58, from D:/Xilinx/Vivado/2018.2/include/ap_int_sim.h:73, from D:/Xilinx/Vivado/2018.2/include/ap_int.h:65, from ../../../../firmware/myproject.h:23, from ../../../../firmware/myproject.cpp:21: D:/Xilinx/Vivado/2018.2/include/gmp.h:62:0: warning: "__GMP_LIBGMP_DLL" redefined

define __GMP_LIBGMP_DLL 0

In file included from D:/Xilinx/Vivado/2018.2/include/hls_fpo.h:166:0, from D:/Xilinx/Vivado/2018.2/include/hls_half.h:58, from D:/Xilinx/Vivado/2018.2/include/ap_int_sim.h:73, from D:/Xilinx/Vivado/2018.2/include/ap_int.h:65, from ../../../../firmware/myproject.h:23, from ../../../../firmware/myproject.cpp:21: D:/Xilinx/Vivado/2018.2/include/floating_point_v7_0_bitacc_cmodel.h:135:0: note: this is the location of the previous definition

define __GMP_LIBGMP_DLL 1

INFO: Unable to open input/predictions file, using default input. 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 0.0996094 INFO: Saved inference results to file: tb_data/csim_results.log INFO: [SIM 211-1] CSim done with 0 errors. INFO: [SIM 211-3] CSIM finish C SIMULATION COMPLETED IN 0h0m6s C/RTL SYNTHESIS INFO: [HLS 200-10] Analyzing design file 'firmware/myproject.cpp' ... WARNING: [HLS 200-40] In file included from firmware/myproject.cpp:1: In file included from firmware/myproject.cpp:22: In file included from firmware/parameters.h:13: In file included from firmware/nnet_utils/nnet_conv2d.h:24: firmware/nnet_utils/nnet_conv2d_latency.h:214:69: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare] if ((oh*CONFIG_T::stride_height+fh) < CONFIG_T::pad_top


firmware/nnet_utils/nnet_conv2d.h:83:9: note: in instantiation of function template specialization 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config2>' requested here
        conv_2d_latency_cl<data_T, res_T, CONFIG_T>(data, res, weights, biases);
        ^
firmware/myproject.cpp:72:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config2>' requested here
 nnet::conv_2d_cl<input_t, layer2_t, config2>(input_1, layer2_out, w2, b2);
 ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:22:
In file included from firmware/parameters.h:13:
In file included from firmware/nnet_utils/nnet_conv2d.h:24:
firmware/nnet_utils/nnet_conv2d_latency.h:216:67: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                || (ow*CONFIG_T::stride_width+fw) < CONFIG_T::pad_left
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d_latency.h:30:69: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if ((oh*CONFIG_T::stride_height+fh) < CONFIG_T::pad_top
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d_latency.h:191:31: note: in instantiation of function template specialization 'nnet::compute_multiplier_limit_conv2d<config2>' requested here
 const int multiplier_limit = compute_multiplier_limit_conv2d<CONFIG_T>(weights);
                              ^
firmware/nnet_utils/nnet_conv2d.h:83:9: note: in instantiation of function template specialization 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config2>' requested here
        conv_2d_latency_cl<data_T, res_T, CONFIG_T>(data, res, weights, biases);
        ^
firmware/myproject.cpp:72:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config2>' requested here
 nnet::conv_2d_cl<input_t, layer2_t, config2>(input_1, layer2_out, w2, b2);
 ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:22:
In file included from firmware/parameters.h:13:
In file included from firmware/nnet_utils/nnet_conv2d.h:24:
firmware/nnet_utils/nnet_conv2d_latency.h:32:67: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                || (ow*CONFIG_T::stride_width+fw) < CONFIG_T::pad_left
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d_latency.h:214:69: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if ((oh*CONFIG_T::stride_height+fh) < CONFIG_T::pad_top
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d.h:83:9: note: in instantiation of function template specialization 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config5>' requested here
        conv_2d_latency_cl<data_T, res_T, CONFIG_T>(data, res, weights, biases);
        ^
firmware/myproject.cpp:84:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config5>' requested here
 nnet::conv_2d_cl<layer4_t, layer5_t, config5>(layer4_out, layer5_out, w5, b5);
 ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:22:
In file included from firmware/parameters.h:13:
In file included from firmware/nnet_utils/nnet_conv2d.h:24:
firmware/nnet_utils/nnet_conv2d_latency.h:216:67: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                || (ow*CONFIG_T::stride_width+fw) < CONFIG_T::pad_left
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d_latency.h:30:69: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                if ((oh*CONFIG_T::stride_height+fh) < CONFIG_T::pad_top
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~
firmware/nnet_utils/nnet_conv2d_latency.h:191:31: note: in instantiation of function template specialization 'nnet::compute_multiplier_limit_conv2d<config5>' requested here
 const int multiplier_limit = compute_multiplier_limit_conv2d<CONFIG_T>(weights);
                              ^
firmware/nnet_utils/nnet_conv2d.h:83:9: note: in instantiation of function template specialization 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config5>' requested here
        conv_2d_latency_cl<data_T, res_T, CONFIG_T>(data, res, weights, biases);
        ^
firmware/myproject.cpp:84:2: note: in instantiation of function template specialization 'nnet::conv_2d_cl<ap_fixed<16, 6, 5, 3, 0>, ap_fixed<16, 6, 5, 3, 0>, config5>' requested here
 nnet::conv_2d_cl<layer4_t, layer5_t, config5>(layer4_out, layer5_out, w5, b5);
 ^
In file included from firmware/myproject.cpp:1:
In file included from firmware/myproject.cpp:22:
In file included from firmware/parameters.h:13:
In file included from firmware/nnet_utils/nnet_conv2d.h:24:
firmware/nnet_utils/nnet_conv2d_latency.h:32:67: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                                || (ow*CONFIG_T::stride_width+fw) < CONFIG_T::pad_left
                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
8 warnings generated.\n
WARNING: [HLS 214-114] Only function calls and local variable declarations are allowed in a dataflow region: firmware/nnet_utils/nnet_dense_latency.h:64:9
INFO: [HLS 200-111] Finished Linking Time (s): cpu = 00:00:01 ; elapsed = 00:01:51 . Memory (MB): peak = 119.660 ; gain = 64.023
INFO: [HLS 200-111] Finished Checking Pragmas Time (s): cpu = 00:00:01 ; elapsed = 00:01:51 . Memory (MB): peak = 119.660 ; gain = 64.023
INFO: [HLS 200-10] Starting code transformations ...
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<5, 3, true, (ap_q_mode)5, (ap_o_mode)3, 0>::to_double' into 'nnet::compute_multiplier_limit_conv2d<config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:37).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<5, 3, true, (ap_q_mode)5, (ap_o_mode)3, 0>::to_double' into 'nnet::compute_multiplier_limit_conv2d<config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:37).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<5, 3, true, (ap_q_mode)5, (ap_o_mode)3, 0>::to_double' into 'nnet::compute_multiplier_limit_conv2d<config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:37).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<5, 3, true, (ap_q_mode)5, (ap_o_mode)3, 0>::to_double' into 'nnet::compute_multiplier_limit_conv2d<config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:37).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<137, 84, false, (ap_q_mode)5, (ap_o_mode)3, 0>::operator<<' into 'generic_cast_IEEE754<int, (ap_q_mode)6, double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_case_IEEE754.h:17).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<1, 32, false, (ap_q_mode)5, (ap_o_mode)0, 0>::overflow_adjust' into 'ap_fixed_base<1, 32, false, (ap_q_mode)5, (ap_o_mode)0, 0>::ap_fixed_base<137, 84, false, (ap_q_mode)5, (ap_o_mode)3, 0>' ().
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<16, 6, true, (ap_q_mode)5, (ap_o_mode)3, 0>::operator<<' into 'nnet::product::weight_exponential<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, exponent_type18, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' (firmware/nnet_utils/nnet_mult.h:78).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<16, 6, true, (ap_q_mode)5, (ap_o_mode)3, 0>::operator<<' into 'nnet::product::weight_exponential<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, exponent_type17, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' (firmware/nnet_utils/nnet_mult.h:78).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<16, 6, true, (ap_q_mode)5, (ap_o_mode)3, 0>::operator<<' into 'nnet::product::weight_exponential<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, exponent_type16, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' (firmware/nnet_utils/nnet_mult.h:78).
INFO: [XFORM 203-603] Inlining function 'ap_fixed_base<16, 6, true, (ap_q_mode)5, (ap_o_mode)3, 0>::operator<<' into 'nnet::product::weight_exponential<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, exponent_type15, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0> >::product' (firmware/nnet_utils/nnet_mult.h:78).
INFO: [HLS 200-111] Finished Standard Transforms Time (s): cpu = 00:22:27 ; elapsed = 00:31:36 . Memory (MB): peak = 1501.137 ; gain = 1445.500
INFO: [HLS 200-10] Checking synthesizability ...
INFO: [XFORM 203-602] Inlining function '_ZN9fp_structIdEC2Ed28' into '_ZN9fp_structIdEC1Ed24' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/src/technology/autopilot/header_files\utils/x_hls_utils.h:442) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::data' into 'fp_struct<double>::to_double' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/src/technology/autopilot/header_files\utils/x_hls_utils.h:475) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::to_double' into 'fp_struct<double>::to_ieee' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/src/technology/autopilot/header_files\utils/x_hls_utils.h:489) automatically.
INFO: [XFORM 203-602] Inlining function '_ZN9fp_structIdEC1Ed24' into 'generic_copysign<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint/hls_copysign.h:11) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::to_ieee' into 'generic_copysign<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint/hls_copysign.h:13) automatically.
INFO: [XFORM 203-602] Inlining function '_ZN9fp_structIdEC1Ed24' into 'generic_ceil<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_ceil.h:17) automatically.
INFO: [XFORM 203-602] Inlining function '_ZNK9fp_structIdE9__signbitEv26' into 'generic_ceil<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_ceil.h:20) automatically.
INFO: [XFORM 203-602] Inlining function 'generic_copysign<double>' into 'generic_ceil<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_ceil.h:23) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::data' into 'generic_ceil<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_ceil.h:37) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::to_ieee' into 'generic_ceil<double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_ceil.h:41) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::mantissa' into 'generic_cast_IEEE754<int, (ap_q_mode)6, double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_case_IEEE754.h:14) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::expv' into 'generic_cast_IEEE754<int, (ap_q_mode)6, double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_case_IEEE754.h:17) automatically.
INFO: [XFORM 203-602] Inlining function 'fp_struct<double>::__signbit' into 'generic_cast_IEEE754<int, (ap_q_mode)6, double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_case_IEEE754.h:49) automatically.
INFO: [XFORM 203-602] Inlining function 'generic_cast_IEEE754<int, (ap_q_mode)6, double>' into 'generic_cast_IEEE754<int, double>' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/include/FloatingPoint\hls_case_IEEE754.h:98) automatically.
INFO: [XFORM 203-602] Inlining function 'generic_cast_IEEE754<int, double>' into '__hls_fptosi_double_i32' (r:/builds/2018.2/continuous/2018_06_14_2258646/src/products/hls/hls_lib/hlsmath/src/lib_floatconversion.cpp:54) automatically.
INFO: [XFORM 203-602] Inlining function 'ceil' into 'nnet::compute_multiplier_limit_conv2d<config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:49) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::compute_multiplier_limit_conv2d<config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:49) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config15>' (firmware/nnet_utils/nnet_batchnorm.h:73) automatically.
INFO: [XFORM 203-602] Inlining function 'ceil' into 'nnet::compute_multiplier_limit_conv2d<config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:49) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::compute_multiplier_limit_conv2d<config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:49) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config16>' (firmware/nnet_utils/nnet_batchnorm.h:73) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_latency.h:56) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_latency.h:125) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config17>' (firmware/nnet_utils/nnet_batchnorm.h:73) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' (firmware/nnet_utils/nnet_dense_latency.h:56) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::cast<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' into 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' 
(firmware/nnet_utils/nnet_dense_latency.h:125) automatically.
INFO: [XFORM 203-602] Inlining function '__hls_fptosi_double_i32' into 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config18>' (firmware/nnet_utils/nnet_batchnorm.h:73) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:50) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 2, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> >::operator()' into 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:62) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' into 'nnet::softmax_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' (firmware/nnet_utils/nnet_activation.h:249) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax_idx_from_real_val<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' into 'nnet::softmax_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' (firmware/nnet_utils/nnet_activation.h:258) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::conv_2d_cl<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2>' into 'myproject' (firmware/myproject.cpp:72) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::conv_2d_cl<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5>' into 'myproject' (firmware/myproject.cpp:84) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::dense<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' into 'myproject' (firmware/myproject.cpp:96) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::dense<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' into 'myproject' (firmware/myproject.cpp:108) automatically.
INFO: [XFORM 203-602] Inlining function 'nnet::softmax<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' into 'myproject' (firmware/myproject.cpp:118) automatically.
INFO: [HLS 200-111] Finished Checking Synthesizability Time (s): cpu = 00:23:32 ; elapsed = 00:32:42 . Memory (MB): peak = 1501.137 ; gain = 1445.500
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::softmax_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' (firmware/nnet_utils/nnet_activation.h:244:45).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:52:43).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:52:43).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' (firmware/nnet_utils/nnet_common.h:52:43).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config13>' (firmware/nnet_utils/nnet_activation.h:71:39).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config18>' (firmware/nnet_utils/nnet_batchnorm.h:61:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' (firmware/nnet_utils/nnet_dense_latency.h:39:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config10>' (firmware/nnet_utils/nnet_activation.h:71:39).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config17>' (firmware/nnet_utils/nnet_batchnorm.h:61:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' (firmware/nnet_utils/nnet_dense_latency.h:39:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config7>' (firmware/nnet_utils/nnet_activation.h:71:39).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config16>' (firmware/nnet_utils/nnet_batchnorm.h:61:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:177:83).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::compute_multiplier_limit_conv2d<config5>' (firmware/nnet_utils/nnet_conv2d_latency.h:13).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config4>' (firmware/nnet_utils/nnet_activation.h:71:39).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config15>' (firmware/nnet_utils/nnet_batchnorm.h:61:55).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::conv_2d_latency_cl<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:177:83).
INFO: [XFORM 203-502] Unrolling all loops for pipelining in function 'nnet::compute_multiplier_limit_conv2d<config2>' (firmware/nnet_utils/nnet_conv2d_latency.h:13).
INFO: [XFORM 203-501] Unrolling loop 'Loop-1' (firmware/nnet_utils/nnet_activation.h:247) in function 'nnet::softmax_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Loop-2' (firmware/nnet_utils/nnet_activation.h:259) in function 'nnet::softmax_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, Softmax_config14>' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceLeft' (firmware/nnet_utils/nnet_common.h:56) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceRight' (firmware/nnet_utils/nnet_common.h:59) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 10, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceLeft' (firmware/nnet_utils/nnet_common.h:56) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceRight' (firmware/nnet_utils/nnet_common.h:59) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 8, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceLeft' (firmware/nnet_utils/nnet_common.h:56) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'ReduceRight' (firmware/nnet_utils/nnet_common.h:59) in function 'nnet::reduce<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0>, 4, nnet::Op_add<ap_fixed<18, 8, (ap_q_mode)5, (ap_o_mode)3, 0> > >' completely.
INFO: [XFORM 203-501] Unrolling loop 'Loop-1' (firmware/nnet_utils/nnet_activation.h:76) in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config13>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Result' (firmware/nnet_utils/nnet_batchnorm.h:83) in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config18>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Product1' (firmware/nnet_utils/nnet_dense_latency.h:85) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Product2' (firmware/nnet_utils/nnet_dense_latency.h:90) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'ResetAccum' (firmware/nnet_utils/nnet_dense_latency.h:101) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Accum1' (firmware/nnet_utils/nnet_dense_latency.h:109) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Accum2' (firmware/nnet_utils/nnet_dense_latency.h:113) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Result' (firmware/nnet_utils/nnet_dense_latency.h:120) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config11>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Loop-1' (firmware/nnet_utils/nnet_activation.h:76) in function 'nnet::relu<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, relu_config10>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Result' (firmware/nnet_utils/nnet_batchnorm.h:83) in function 'nnet::normalize<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config17>' completely.
INFO: [XFORM 203-501] Unrolling loop 'Product1' (firmware/nnet_utils/nnet_dense_latency.h:85) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' completely.
ERROR: [XFORM 203-504] Stop unrolling loop 'Product1' (firmware/nnet_utils/nnet_dense_latency.h:85) in function 'nnet::dense_latency<ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, ap_fixed<16, 6, (ap_q_mode)5, (ap_o_mode)3, 0>, config8>' because it may cause large runtime and excessive memory usage due to increase in code size. Please avoid unrolling the loop or form sub-functions for code in the loop body.
ERROR: [HLS 200-70] Pre-synthesis failed.
command 'ap_source' returned error code
    while executing
"source [lindex $::argv 1] "
    ("uplevel" body line 1)
    invoked from within
"uplevel \#0 { source [lindex $::argv 1] } "

INFO: [Common 17-206] Exiting vivado_hls at Tue Mar  2 13:57:15 2021...
thesps commented 3 years ago

For a CNN model you should set IOType: io_stream in your configuration. Then, if you still see such errors, or the final resources are too large, you should set Strategy: Resource in the HLSConfig section. And finally, try increasing the ReuseFactor.

I can't be sure, but it also looks like you may have ap_fixed<16,6> data types, while you mentioned using QKeras layers in the title. To derive the data types portion of the configuration for a QKeras model, you should generate your config template like: config = hls4ml.utils.config_from_keras_model(model, granularity='name') See the 'quantization' part of the hls4ml tutorial for more details, or try it online:

hls4ml

JunningFan commented 3 years ago

For a CNN model you should set IOType: io_stream in your configuration. Then, if you still see such errors, or the final resources are too large, you should set Strategy: Resource in the HLSConfig section. And finally, try increasing the ReuseFactor.

I can't be sure, but it also looks like you may have ap_fixed<16,6> data types, while you mentioned using QKeras layers in the title. To derive the data types portion of the configuration for a QKeras model, you should generate your config template like: config = hls4ml.utils.config_from_keras_model(model, granularity='name') See the 'quantization' part of the hls4ml tutorial for more details, or try it online:

hls4ml

Hi thesps,

Thanks for helping. Specifying Resource does resolve the [XFORM 203-504] error for the dense layer. Unfortunately, I have noticed that specifying the Resource strategy changes the output of the network. On a CNN trained to classify MNIST images, the simulated accuracy of the hls_model with latency strategy is expected (0.97 acc, upper image), however, the simulated accuracy of the model with Resource strategy seems to be broken(0.127 acc, lower image).
Latency Resource The generated config file with resource strategy is attached:


Model Precision: ap_fixed<10,3> ReuseFactor: 16 Strategy: Resource LayerName input_1 Precision result: ap_ufixed<8,1> conv2d_0_m Precision weight: ap_fixed<9,1> bias: ap_fixed<9,1> ReuseFactor: 16 act0_m Precision result: ap_ufixed<8,1> ReuseFactor: 16 max_pooling2d Precision: ap_fixed<16,6> conv2d_1_m Precision weight: ap_fixed<9,1> bias: ap_fixed<9,1> ReuseFactor: 16 act1_m Precision result: ap_fixed<9,1> ReuseFactor: 16 fc_0_m Precision weight: ap_fixed<9,1> bias: ap_fixed<9,1> ReuseFactor: 16 softmax Precision: ap_fixed<16,6> ReuseFactor: 16 table_size: 1024 exp_table_t: ap_fixed<18,8,AP_RND,AP_SAT> inv_table_t: ap_fixed<18,8,AP_RND,AP_SAT>


Update: I have noticed that the second convolution layer conv2d_1_m causes this loss of accuracy when the strategy is set to Resource. Any Idea about the cause of the problem? Thanks.

waldenou commented 3 years ago

Hi,

I have encountered a similar issue with my CNN model. The model was trained using MNIST data. When I use Strategy: Latency + IOType: io_stream, the hls4ml model output accuracy is near the keras model accuracy, but the resource usage is undesirable. When I use Strategy: Resource + IOType: io_stream the ouput accuracy is only around 10%, and the converted model seems to predict one class more often than the others.

Any help is appreciated. Thanks.

vloncar commented 3 years ago

@JunningFan @waldenou this is solved in #299