This repo contains the pip install package for Quantized Neural Network (QNN) on PYNQ using a Multi-Layer Offload (MO) architecture. Two different overlays are here included, namely W1A2 (1 bit weights, 2 bit activations) and W1A3 (1 bit weights, 3 bit activations), executing in the Programmable Logic 1 Convolutional layer and 1 (optional) Max Pool layer.
In order to install it on your PYNQ board, connect to the board, open a terminal and type:
# (on PYNQ v2.3 and later versions, tested up to v2.5)
sudo pip3 install git+https://github.com/Xilinx/QNN-MO-PYNQ.git
NOTE: The board has to be connected to the internet.
The installation can take up to 10 minutes, since dependencies must be resolved and sources compiled.
This will install the QNN package to your board, and create a QNN directory in the Jupyter home area. You will find the Jupyter notebooks to test the QNN overlays in this directory.
In order to build the shared object during installation, the user should copy the include folder from VIVADO HLS on the PYNQ board (in windows in vivado-path/Vivado_HLS/201x.y/include, /vivado-path/Vidado_HLS/201x.y/include in unix) and set the environment variable VIVADOHLS_INCLUDE_PATH to the location in which the folder has been copied. If the env variable is not set, the precompiled version will be used instead.
The repo is organized as follows:
/home/xilinx/jupyter_notebooks/qnn/
folderIn order to rebuild the hardware designs, the repo should be cloned in a machine with installation of the Vivado Design Suite (tested with 2017.4). Following the step-by-step instructions:
clone_path/QNN-MO-PYNQ/qnn/src/network/
clone_path/QNN-MO-PYNQ/qnn/src/
./make-hw.sh {network} {platform} {mode}
where:
h
to launch Vivado HLS synthesis, b
to launch the Vivado project (needs HLS synthesis results), a
to launch both.clone_path/QNN-MO-PYNQ/qnn/src/network/output/
that is organized as follows:
pip_installation_path/qnn/bitstreams/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。