Description
hi, I try to use hls4ms with the model "KERAS_conv1d.json" at vitis 2020 ,and I want to know whether all the models at folder "hls4ml/example-models/keras" that have been tested and correctly. for me I am working for supporting vitis 2020 and got something error but no error log showing, so i test the model "KERAS_conv1d.json" at vivado 2020 firstly and also failed.
I suspect that the error caused by the different version between vivado 2019 and vivado 2020. someone can help me , thanks
for vivado 2020, the error as below:
INFO: [HLS 200-489] Unrolling loop 'Product1' (firmware/nnet_utils/nnet_dense.h:160) 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 with a factor of 3200.
ERROR: [XFORM 203-504] Stop unrolling loop 'Product1' (firmware/nnet_utils/nnet_dense.h:160) 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 build_prj.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $arg] "
for vitis 2020, the error as below:
***** C/RTL SYNTHESIS *****
INFO: [HLS 200-10] Analyzing design file 'firmware/myproject.cpp' ...
WARNING: [HLS 214-104] Only for-loops and functions support the dataflow: firmware/nnet_utils/nnet_dense.h:151:9
Resolution: For help on HLS 214-104 see www.xilinx.com/html_docs/xilinx2020_1/hls-guidance/214-104.html
WARNING: [HLS 214-104] Only for-loops and functions support the dataflow: firmware/nnet_utils/nnet_dense.h:151:9
Resolution: For help on HLS 214-104 see www.xilinx.com/html_docs/xilinx2020_1/hls-guidance/214-104.html
WARNING: [HLS 200-471] Dataflow form checks found 2 issue(s) in file firmware/myproject.cpp
Resolution: For help on HLS 200-471 see www.xilinx.com/html_docs/xilinx2020_1/hls-guidance/200-471.html
Compilation of the preprocessed source 'myproject' failed
while executing
"source build_prj.tcl"
("uplevel" body line 1)
invoked from within
"uplevel #0 [list source $arg] "
INFO: [Common 17-206] Exiting vitis_hls at Thu Dec 3 13:04:23 2020...
and python script as below:
config = hls4ml.utils.fetch_example_model('KERAS_conv1d.json',"vitis")
print("-----------------config-----------------------")
print(config) #You can print it to see some default parameters
print("-----------------config finish-----------------------")
#Convert it to a hls project
hls_model = hls4ml.converters.keras_to_hls(config)
#Print full list of example model if you want to explore more
#hls4ml.utils.fetch_example_list()
print(hls_model.config.get_output_dir())
hls_model.write()
hls_model.build(csim=False, export=True)
```