Skip to content
Snippets Groups Projects
Commit eb02604b authored by Lucian Petrica's avatar Lucian Petrica
Browse files

Merge remote-tracking branch 'origin/dev' into feature/autosize_fifos

parents 3e5b7fb3 63622616
No related branches found
No related tags found
No related merge requests found
Showing
with 8025 additions and 1096 deletions
......@@ -23,6 +23,7 @@ Please see the [Getting Started](https://finn.readthedocs.io/en/latest/getting_s
## What's New in FINN?
* **2020-09-21:** v0.4b (beta) is released. Read more on the <a href="https://xilinx.github.io/finn/2020/09/21/finn-v04b-beta-is-released.html">release blog post</a>.
* **2020-05-08:** v0.3b (beta) is released, with initial support for convolutions, parallel transformations, more flexible memory allocation for MVAUs, throughput testing and many other smaller improvements and bugfixes. Read more on the <a href="https://xilinx.github.io/finn/2020/05/08/finn-v03b-beta-is-released.html">release blog post</a>.
* **2020-04-15:** FINN v0.2.1b (beta): use fixed commit versions for dependency repos, otherwise identical to 0.2b
* **2020-02-28:** FINN v0.2b (beta) is released, which is a clean-slate reimplementation of the framework. Currently only fully-connected networks are supported for the end-to-end flow. Please see the release blog post for a summary of the key features.
......
......@@ -40,6 +40,12 @@ RUN apt-get install -y verilator zsh
RUN apt-get -y install sshpass wget unzip
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
# XRT deps
RUN wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh
RUN apt-get update
RUN bash xrtdeps.sh
RUN rm xrtdeps.sh
# cloning dependency repos
# Brevitas
RUN git clone https://github.com/Xilinx/brevitas.git /workspace/brevitas
......
......@@ -49,6 +49,7 @@ RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN rm requirements.txt
RUN pip install pygments==2.4.1
RUN pip install jupyter==1.0.0
RUN pip install matplotlib==3.3.1 --ignore-installed
RUN pip install pytest-dependency==0.5.1
......
......@@ -46,20 +46,6 @@ if [ ! -z "$VIVADO_PATH" ];then
export XILINX_VIVADO=$VIVADO_PATH
source $VIVADO_PATH/settings64.sh
fi
if [ ! -z "$VITIS_PATH" ];then
# source Vitis env.vars
export XILINX_VITIS=$VITIS_PATH
source $VITIS_PATH/settings64.sh
fi
if [ ! -z "$XILINX_XRT" ];then
# TODO install XRT dependencies?
# wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh
# apt-get update
# bash xrtdeps.sh
# rm xrtdeps.sh
# source XRT
source $XILINX_XRT/setup.sh
fi
# download PYNQ board files if not already there
if [ ! -d "/workspace/finn/board_files" ]; then
......@@ -80,4 +66,16 @@ if [ ! -d "/workspace/finn/board_files/ultra96v1" ]; then
mv /workspace/finn/bdf/* /workspace/finn/board_files/
rm -rf /workspace/finn/bdf
fi
if [ ! -z "$VITIS_PATH" ];then
# source Vitis env.vars
export XILINX_VITIS=$VITIS_PATH
source $VITIS_PATH/settings64.sh
if [ ! -z "$XILINX_XRT" ];then
gecho "For VitisBuild, please ensure the XRT dependencies are correctly installed"
gecho "by downloading and running:"
gecho "https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh"
# source XRT
source $XILINX_XRT/setup.sh
fi
fi
exec "$@"
---
layout: post
title: "FINN v0.4b (beta) is released"
author: "Yaman Umuroglu"
---
Version v0.4b (beta) of the FINN compiler is now available. As with the previous
release there's a whole lot of new features and bugfixes that have gone in,
but here are some highlights:
<img src="https://mma.prnewswire.com/media/752936/ALVEO_PRESS.jpg" width="300" align="center"/>
**Build support for Alveo/Vitis + more Zynq variants.** We now have a
`VitisBuild` transformation to provide a FINN flow that goes all the way to
bitfiles targeting Xilinx Alveo platforms. This transformation takes care of
FIFO, datawidth converter and DMA engine insertion so you can simply give it a
FINN model with HLS layers and let it run.
Similarly, we've simplified the Zynq build flow with `ZynqBuild` to provide a
similar experience, which should now be able to support most Zynq and Zynq
UltraScale+ platforms.
You can read more about the new hardware build transformations
<a href="https://finn.readthedocs.io/en/latest/hw_build.html">here</a>.
<img src="https://xilinx.github.io/finn/img/finn-dashboard.png" width="450" align="center"/>
**Fully-accelerated end-to-end examples + dashboard.** The FINN end-to-end example networks
are now fully accelerated on the FPGA, allowing raw images to be directly fed in
and top-1 indices to be retrieved.
We now also have a <a href="https://bit.ly/finn-end2end-dashboard">dashboard</a>
which gets automatically updated with the latest build results from end-to-end
examples, including FPGA resources and performance.
This also enables running full-performance accuracy validation on hardware,
which is now incorporated into the <a href="https://github.com/Xilinx/finn/blob/master/notebooks/end2end_example/tfc_end2end_example.ipynb#validation">end-to-end notebooks</a>.
<img src="https://xilinx.github.io/finn/img/finn-brevitas-debug.png" width="450" align="center"/>
**Brevitas-FINN co-debug support.** We can now export graphs from Brevitas with special DebugMarker nodes (like above) and PyTorch forward hooks to compare intermediate activations between the Brevitas version and FINN-ONNX exported version. This is handy for debugging especially larger networks when they don't export correctly. <a href="https://github.com/Xilinx/finn/blob/dev/tests/brevitas/test_brevitas_debug.py">Here</a> is an example of how to use this.
<img src="https://xilinx.github.io/finn/img/accumulator-minimization.png" width="450" align="center"/>
**Accumulator minimization.** When converting to HLS layers, FINN will now automatically try to pick a minimal bitwidth for each accumulator, based on the precision and size of the dot product it accumulates over. While prior accumulators were at a fixed bitwidth like
32-bits, the new approach can significantly save on resources by picking e.g. 10-bit accumulators (as per above) where possible. We've also expanded the range of DataTypes available in FINN to cover everything between 1-32 bits to provide more flexibility.
<img src="https://xilinx.github.io/finn/img/finn-cycle-estimate.png" width="450" align="center"/>
**New layers and cycle estimation.** We've been working on supporting more of the finn-hlslib layers in FINN and
<a href="https://github.com/Xilinx/finn/tree/dev/src/finn/custom_op/fpgadataflow">the list</a> has expanded significantly.
Many of these layers (and their accompanying conversion transformations) will be utilized for new FINN end-to-end example networks,
like MobileNet-v1, ResNet-50 and a QuartzNet, over the course of the next few releases. These layers also support <a href="https://github.com/Xilinx/finn/blob/dev/src/finn/analysis/fpgadataflow/exp_cycles_per_layer.py">clock cycle estimation</a>
based on workload and parallelization parameters, allowing the user to estimate performance without having to go to synthesis.
The release (tagged 0.4b) is now available on GitHub.
We're continuously working to improve FINN in terms of layer, network and
infrastructure.
If you'd like to help out, please check out the <a href="https://github.com/Xilinx/finn/blob/master/CONTRIBUTING.md">contribution guidelines</a> and
share your ideas on the <a href="https://gitter.im/xilinx-finn/community">FINN Gitter channel</a>!
......@@ -4,33 +4,22 @@
Example Networks
****************
FINN uses `several pre-trained QNNs <https://github.com/Xilinx/brevitas/tree/master/brevitas_examples/bnn_pynq>`_ that serve as examples and testcases.
You can find a status summary below for each network.
FINN uses `several pre-trained QNNs <https://github.com/Xilinx/brevitas/tree/master/brevitas_examples/bnn_pynq>`_
that serve as examples and testcases.
* TFC, SFC, LFC... are fully-connected networks trained on the MNIST dataset
* CNV is a convolutional network trained on the CIFAR-10 dataset
* w\_a\_ refers to the quantization used for the weights (w) and activations (a) in bits
The rows in the table are different steps of the FINN end-to-end flow.
If a particular network is supported for a particular step in the current FINN
version, this is indicated by an x mark in the table.
These networks are built end-to-end as part of the `FINN integration tests <https://github.com/Xilinx/finn/blob/master/tests/end2end/test_end2end_bnn_pynq.py>`_ ,
and the key performance indicators (FPGA resource, frames per second...) are
automatically posted to the dashboard below.
To implement a new network, you can use the `integration test code <https://github.com/Xilinx/finn/blob/dev/tests/end2end/test_end2end_bnn_pynq.py>`_
as a starting point, as well as the `relevant Jupyter notebooks
<https://github.com/Xilinx/finn/tree/master/notebooks/end2end_example>`_.
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| FINN step | Basic test | TFC-w1a1 | TFC-w1a2 | TFC-w2a2 | CNV-w1a1 | CNV-w1a2 | CNV-w2a2 |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| Export/Import | x | x | x | x | x | x | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| Streamlining | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| Convert to HLS layers | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| Stitched IP | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| Hardware test | x | x | x | | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| cppsim | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| rtlsim node-by-node | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
| rtlsim stitched IP | x | x | x | x | x | | x |
+-----------------------+------------+----------+----------+----------+----------+----------+----------+
.. image:: https://firebasestorage.googleapis.com/v0/b/drive-assets.google.com.a.appspot.com/o/Asset%20-%20Drive%20Icon512.png?alt=media
:width: 50px
:align: left
`FINN end-to-end dashboard on Google Drive <https://bit.ly/finn-end2end-dashboard>`_
......@@ -75,15 +75,21 @@ from the FINN root directory* as follows:
::
python setup.py test --addopts "-k test_end2end_tfc_w1a2"
python setup.py test --addopts "-k test_brevitas_debug"
Finally, if you want to run tests in parallel (e.g. to take advantage of a multi-core CPU)
If you want to run tests in parallel (e.g. to take advantage of a multi-core CPU)
you can use:
* pytest-parallel for any rtlsim tests, e.g. `python setup.py test --addopts "-k rtlsim --workers auto"`
* pytest-xdist for anything else, make sure to add `--dist=loadfile` if you have tests in the same file that have dependencies on each other e.g. `python setup.py test --addopts "-k mytest -n auto --dist=loadfile"`
Please see the pytest documentation for more about picking tests by marks or by name.
Finally, the full test suite with appropriate parallelization can be run inside the container by:
::
quicktest.sh full
Environment variables
**********************
......
......@@ -20,7 +20,7 @@ What is FINN?
:scale: 40%
:align: center
* The repository, this Read the Docs website corresponds to. It is about the FINN compiler, which is the centerpiece of the FINN project. Details can be looked up directly in the `FINN GitHub repository <https://github.com/Xilinx/finn>`_. To learn more about the FINN compiler, use this website and for a hands-on experience the repository contains some Jupyter notebooks which can be found under this `link <https://github.com/Xilinx/finn/tree/dev/notebooks>`_.
* The FINN compiler, which this Read the Docs website corresponds to and is the centerpiece of the FINN project. Details can be looked up directly in the `FINN GitHub repository <https://github.com/Xilinx/finn>`_. To learn more about the FINN compiler, use this website and for a hands-on experience the repository contains some Jupyter notebooks which can be found under this `link <https://github.com/Xilinx/finn/tree/dev/notebooks>`_.
More FINN Resources
===================
......
docs/img/accumulator-minimization.png

41.3 KiB

docs/img/finn-brevitas-debug.png

52.1 KiB

docs/img/finn-cycle-estimate.png

23.7 KiB

docs/img/finn-dashboard.png

33.7 KiB

This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -463,7 +463,11 @@ class ModelWrapper:
self.model.metadata_props.append(metadata_prop)
else:
metadata_prop.value = value
def get_nodes_by_name(self, op_name):
"""Returns a list of nodes with specified name."""
return list(filter(lambda x: x.name == op_name, self.graph.node))
def get_nodes_by_op_type(self, op_type):
"""Returns a list of nodes with specified op_type."""
return list(filter(lambda x: x.op_type == op_type, self.graph.node))
......
......@@ -106,9 +106,6 @@ class MergeONNXModels(Transformation):
output_a_shape == input_b_shape
), "Models can't be merged! Shapes don't match."
pre_model.save("pre.onnx")
post_model.save("post.onnx")
# connect output of one model to input of the other
for n in pre_model.graph.node:
if output_model_a == n.output[0]:
......
......@@ -44,7 +44,7 @@ def upload_to_end2end_dashboard(data_dict):
vals = list(data_dict.values())
# check against existing header
existing_keys = worksheet.row_values(1)
if existing_keys != keys:
if not set(existing_keys).issuperset(set(keys)):
# create new worksheet
dtstr = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
worksheet = spreadsheet.add_worksheet(
......@@ -55,6 +55,9 @@ def upload_to_end2end_dashboard(data_dict):
# freeze and make header bold
worksheet.freeze(rows=1)
worksheet.format("A1:1", {"textFormat": {"bold": True}})
# insert values into new row
# insert values into new row at appropriate positions
worksheet.insert_row([], index=2)
worksheet.update("A2:2", [vals])
for i in range(len(keys)):
colind = existing_keys.index(keys[i])
col_letter = chr(ord("A") + colind)
worksheet.update("%s2" % col_letter, vals[i])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment