LogicNets is a methodology for designing, training and deploying sparse, quantized neural networks based on hardware building blocks. They are able to achieve extremely high throughput and low latency on Xilinx FPGAs.
This project provides a set of library components and examples to help you design, train and deploy your own LogicNets networks. Note, this is considered to be an 'alpha' release: expect API changes and issues. You can learn more about LogicNets from this paper, or from the following YouTube videos:
There are two main ways to install LogicNets:
- Using docker (recommended)
- Manually (advanced)
Follow the steps below to install LogicNets within a docker
container:
- Install Vivado Design Suite
- Install docker.
- Clone the LogicNets repository using:
git clone git@github.com:Xilinx/logicnets.git
- Create an environment variable
VIVADO_SETTINGS_FILE
which points to thesettings64.sh
in your Vivado installation (e.g.,export VIVADO_SETTINGS_FILE=/path/to/Vivado/settings64.sh
) - (Optional): Set your
XILINXD_LICENSE_FILE
orLM_LICENSE_FILE
variables to point to a specific license server - Run
./docker/run-docker.sh
from the root directory of the LogicNets repository - (Optional): Copy your Vivado license file over to the running docker container
You are now ready to run an example, browse to /workspace/logicnets/examples/jet_substructure/
and start training a LogicNets network!
Note, a license is not required to run any of the provided examples.
A manual installation is not recommended for beginners. We will only provide limited support for people wishing to pursue a manual installation. People wanting to pursue a manual installation may want to look at the LogicNets Dockerfile, as this contains details for a full environmental setup (including the installation of dependencies of dependencies).
The basic steps for a manual installation are as follows:
- Install Vivado Design Suite
- Install
oh-my-xilinx
by cloning this repository and creating the environment variableOHMYXILINX
which points to its root directory (e.g.,export OHMYXILINX=/path/to/oh-my-xilinx
)oh-my-xilinx
requireszsh
, on Ubuntu, this can be installed as follows:sudo apt-get install zsh
- Install
Nitro-Parts-lib-Xilinx
by cloning this repository and creating the environment variableNITROPARTSLIB
which points to its root directory (e.g.,export NITROPARTSLIB=/path/to/Nitro-Parts-lib-Xilinx
) - Install
verilator
, on Ubuntu, this can be done as follows:sudo apt-get install verilator build-essential
- Install
python3
,pytorch
,brevitas
andpyverilator
usingconda
and/orpip
or your preferred method - Install
logicnets
using:pip install --upgrade git+https://github.com/Xilinx/logicnets.git
Alternatively, instead of the last step you can clone the LogicNets repository and install as follows:
pip install .
Note, to install the dependencies for all the examples, you can run the following:
pip install .[example-all]
Currently, we have the following examples, located in ./examples/
:
More examples coming soon.
Documentation site coming soon.
If you find this work useful for your research, please consider citing our paper from FPL'20 below:
@inproceedings{umuroglu2020logicnets,
author = {Umuroglu, Yaman and Akhauri, Yash and Fraser, Nicholas J and Blott, Michaela},
booktitle = {Proceedings of the International Conference on Field-Programmable Logic and Applications},
title = {LogicNets: Co-Designed Neural Networks and Circuits for Extreme-Throughput Applications},
year = {2020},
pages = {291-297},
publisher = {IEEE Computer Society},
address = {Los Alamitos, CA, USA},
month = {sep}
}