Hi,
I have encountered a problem while trying to make a synthesis of a simple neural network on FPGA using hls4ml. I used Keras framework for this and ran on a 48 GB RAM and TITAN RTX GPU.
To convert my model to HLS a used the following methods:
config = hls4ml.utils.config_from_keras_model(model, granularity='model')
hls_model = hls4ml.converters.convert_from_keras_model(model, hls_config=config, output_dir='../hls4ml_prj')
without the
.yml configuration file option that is on the
web site
and then writing and compiling the hls model.
While trying to use the predict and build methods my code would crush.
The same thing happens when I use a quantized neural network with QKeras.
I have to mention that my neural network contains convolutional layers, but I'm not quite sure if the problem comes from this. When I use a neural network with only dense layers my synthesis would not crush, but would not finish either, and vivado_hls.log would show the following warnings:
WARNING: [HLS 214-104] Only for-loops and functions support the dataflow: firmware/nnet_utils/nnet_batchnorm.h:76:9
WARNING: [HLS 214-114] Since the only kind of statements allowed in a dataflow region are variable declarations and function calls, the compiler may not be able to correctly handle the region: firmware/nnet_utils/nnet_dense.h:139:9
WARNING: [HLS 214-104] Only for-loops and functions support the dataflow: firmware/nnet_utils/nnet_dense.h:151:9
WARNING: [HLS 200-471] Dataflow form checks found 3 issue(s) in file firmware/myproject.cpp
My questions are the following:
1) Should I implement a yml configuration file, instead of using config = hls4ml.utils.config_from_keras_model(model, granularity='model').
2) Is the neural network quantization necessary prior to creating the hls model?
Thank you very much!
Kind regard,
Narcisa Guran