Goal is to run a Tensorflow / Keras ANN on an FPGA using HLS4ML.
create virtual environment
python3 -m venv HLS4ML
. HLS4ML/bin/activate
For an convinient usage, there is a requirements.txt
file in this repository.
This can be easily installed via
pip install -r requirements.txt
If you are using python 3.10
, installation of the ONNX package is not possible
per default. This solution suggests
adding a CMAKE ARG before the installation.
export CMAKE_ARGS="-DONNX_USE_PROTOBUF_SHARED_LIBS=ON"
pip install -r requirements.txt
By this the installation is successful.
If the installation seems to be on hold, fake /etc/os-releases
to a version,
which is officially supported by Xilinx see this answer record
If the installation stops on generating the installed hardware list - this answer records helped me - and I generated this list manually after the installer exits.
This manual from Digilent helped me to install the Board Files from Digilent.
There is a HLS4ML tutorial
focusing on HEP. This is based on: Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2019.2 (64-bit)
[1] https://fastmachinelearning.org/hls4ml/ [2] https://jiafulow.github.io/blog/2021/02/17/simple-fully-connected-nn-firmware-using-hls4ml/