You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+55-1Lines changed: 55 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,6 +29,60 @@ Please follow the steps below and be sure that your contribution complies with o
29
29
1. The <a href="https://github.com/Xilinx/finn" target="_blank">main branch</a> should always be treated as stable and clean. Only hot fixes are allowed to be pull-requested. The hot fix is supposed to be very important such that without this fix, a lot of things will break.
30
30
2. For new features, smaller bug fixes, doc updates, and many other fixes, users should pull request against the <a href="https://github.com/Xilinx/finn/tree/dev" target="_blank">development branch</a>.
31
31
32
-
3. We will review your contribution and, if any additional fixes or modifications are
32
+
3. Sign Your Work
33
+
34
+
Please use the *Signed-off-by* line at the end of your patch which indicates that you accept the Developer Certificate of Origin (DCO) defined by https://developercertificate.org/ reproduced below::
35
+
36
+
```
37
+
Developer Certificate of Origin
38
+
Version 1.1
39
+
40
+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
41
+
1 Letterman Drive
42
+
Suite D4700
43
+
San Francisco, CA, 94129
44
+
45
+
Everyone is permitted to copy and distribute verbatim copies of this
46
+
license document, but changing it is not allowed.
47
+
48
+
49
+
Developer's Certificate of Origin 1.1
50
+
51
+
By making a contribution to this project, I certify that:
52
+
53
+
(a) The contribution was created in whole or in part by me and I
54
+
have the right to submit it under the open source license
55
+
indicated in the file; or
56
+
57
+
(b) The contribution is based upon previous work that, to the best
58
+
of my knowledge, is covered under an appropriate open source
59
+
license and I have the right under that license to submit that
60
+
work with modifications, whether created in whole or in part
61
+
by me, under the same open source license (unless I am
62
+
permitted to submit under a different license), as indicated
63
+
in the file; or
64
+
65
+
(c) The contribution was provided directly to me by some other
66
+
person who certified (a), (b) or (c) and I have not modified
67
+
it.
68
+
69
+
(d) I understand and agree that this project and the contribution
70
+
are public and that a record of the contribution (including all
71
+
personal information I submit with it, including my sign-off) is
72
+
maintained indefinitely and may be redistributed consistent with
73
+
this project or the open source license(s) involved.
74
+
```
75
+
76
+
You can enable Signed-off-by automatically by adding the `-s` flag to the `git commit` command.
77
+
78
+
Here is an example Signed-off-by line which indicates that the contributor accepts DCO:
FINN is an experimental framework from Xilinx Research Labs to explore deep neural network
11
-
inference on FPGAs.
10
+
FINN is an experimental framework from Integrated Communications and AI Lab of AMD Research & Advanced Development to explore deep neural network inference on FPGAs.
12
11
It specifically targets <ahref="https://github.com/maltanar/qnn-inference-examples"target="_blank">quantized neural
13
12
networks</a>, with emphasis on
14
13
generating dataflow-style architectures customized for each network.
@@ -28,7 +27,7 @@ Please see the [Getting Started](https://finn.readthedocs.io/en/latest/getting_s
28
27
29
28
## Documentation
30
29
31
-
You can view the documentation on [readthedocs](https://finn.readthedocs.io) or build them locally using `python setup.py doc` from inside the Docker container. Additionally, there is a series of [Jupyter notebook tutorials](https://github.com/Xilinx/finn/tree/main/notebooks), which we recommend running from inside Docker for a better experience.
30
+
You can view the documentation on [readthedocs](https://finn.readthedocs.io). Additionally, there is a series of [Jupyter notebook tutorials](https://github.com/Xilinx/finn/tree/main/notebooks), which we recommend running from inside Docker for a better experience.
Copy file name to clipboardExpand all lines: docs/finn/brevitas_export.rst
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ Brevitas Export
8
8
:scale:70%
9
9
:align:center
10
10
11
-
FINN expects an ONNX model as input. This can be a model trained with `Brevitas <https://github.com/Xilinx/brevitas>`_. Brevitas is a PyTorch library for quantization-aware training and the FINN Docker image comes with several `example Brevitas networks <https://github.com/Xilinx/brevitas/tree/master/src/brevitas_examples/bnn_pynq>`_. Brevitas provides an export of a quantized network in ONNX representation in several flavors.
12
-
Two of the Brevitas-exported ONNX variants can be ingested by FINN:
13
-
14
-
* FINN-ONNX: Quantized weights exported as tensors with additional attributes to mark low-precision datatypes. Quantized activations exported as MultiThreshold nodes.
15
-
* QONNX: All quantization is represented using Quant, BinaryQuant or Trunc nodes. QONNX must be converted into FINN-ONNX by :py:mod:`finn.transformation.qonnx.convert_qonnx_to_finn`
11
+
FINN expects an ONNX model as input. This can be a model trained with `Brevitas <https://github.com/Xilinx/brevitas>`_. Brevitas is a PyTorch library for quantization-aware training and the FINN Docker image comes with several `example Brevitas networks <https://github.com/Xilinx/brevitas/tree/master/src/brevitas_examples/bnn_pynq>`_.
12
+
Brevitas provides an export of a quantized network in QONNX representation, which is the format that can be ingested by FINN.
13
+
In a QONNX graph, all quantization is represented using Quant, BinaryQuant or Trunc nodes.
14
+
QONNX must be converted into FINN-ONNX by :py:mod:`finn.transformation.qonnx.convert_qonnx_to_finn`. FINN-ONNX is the intermediate representation (IR) FINN uses internally.
15
+
In this IR, quantized weights are indicated through tensors with additional attributes to mark low-precision datatypes and quantized activations are expressed as MultiThreshold nodes.
16
16
17
17
To work with either type of ONNX model, it is loaded into a :ref:`modelwrapper` provided by FINN.
You can read a brief description of what each step does on
@@ -99,6 +104,7 @@ The following outputs will be generated regardless of which particular outputs a
99
104
* ``build_dataflow.log`` is the build logfile that will contain any warnings/errors
100
105
* ``time_per_step.json`` will report the time (in seconds) each build step took
101
106
* ``final_hw_config.json`` will contain the final (after parallelization, FIFO sizing etc) hardware configuration for the build
107
+
* ``template_specialize_layers_config.json`` is an example json file that can be used to set the specialize layers config
102
108
* ``intermediate_models/`` will contain the ONNX file(s) produced after each build step
103
109
104
110
@@ -206,3 +212,5 @@ You can launch the desired custom build flow using:
206
212
This will mount the specified folder into the FINN Docker container and launch
207
213
the build flow. If ``<name-of-build-flow>`` is not specified it will default to ``build``
208
214
and thus execute ``build.py``. If it is specified, it will be ``<name-of-build-flow>.py``.
215
+
216
+
If you would like to learn more about advance builder settings, please have a look at `our tutorial about this topic <https://github.com/Xilinx/finn/blob/main/notebooks/advanced/4_advanced_builder_settings.ipynb>`_.
Copy file name to clipboardExpand all lines: docs/finn/developers.rst
+12-19Lines changed: 12 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ Power users may also find this information useful.
10
10
Prerequisites
11
11
================
12
12
13
-
Before starting to do development on FINN it's a good idea to start
13
+
Before starting to do development on FINN it is a good idea to start
14
14
with understanding the basics as a user. Going through all of the
15
15
:ref:`tutorials` is strongly recommended if you haven't already done so.
16
16
Additionally, please review the documentation available on :ref:`internals`.
@@ -61,7 +61,7 @@ further detailed below:
61
61
Docker images
62
62
===============
63
63
64
-
If you want to add new dependencies (packages, repos) to FINN it's
64
+
If you want to add new dependencies (packages, repos) to FINN it is
65
65
important to understand how we handle this in Docker.
66
66
67
67
The finn.dev image is built and launched as follows:
@@ -70,7 +70,7 @@ The finn.dev image is built and launched as follows:
70
70
71
71
2. run-docker.sh launches the build of the Docker image with `docker build` (unless ``FINN_DOCKER_PREBUILT=1``). Docker image is built from docker/Dockerfile.finn using the following steps:
72
72
73
-
* Base: PyTorch dev image
73
+
* Base: Ubuntu 22.04 LTS image
74
74
* Set up apt dependencies: apt-get install a few packages for verilator and
75
75
* Set up pip dependencies: Python packages FINN depends on are listed in requirements.txt, which is copied into the container and pip-installed. Some additional packages (such as Jupyter and Netron) are also installed.
76
76
* Install XRT deps, if needed: For Vitis builds we need to install the extra dependencies for XRT. This is only triggered if the image is built with the INSTALL_XRT_DEPS=1 argument.
@@ -84,9 +84,9 @@ The finn.dev image is built and launched as follows:
84
84
85
85
4. Entrypoint script (docker/finn_entrypoint.sh) upon launching container performs the following:
86
86
87
-
* Source Vivado settings64.sh from specified path to make vivado and vivado_hls available.
88
-
* Download PYNQ board files into the finn root directory, unless they already exist.
89
-
* Source Vitits settings64.sh if Vitis is mounted.
87
+
* Source Vivado settings64.sh from specified path to make vivado and vitis_hls available.
88
+
* Download board files into the finn root directory, unless they already exist or ``FINN_SKIP_BOARD_FILES=1``.
89
+
* Source Vitis settings64.sh if Vitis is mounted.
90
90
91
91
5. Depending on the arguments to run-docker.sh a different application is launched. run-docker.sh notebook launches a Jupyter server for the tutorials, whereas run-docker.sh build_custom and run-docker.sh build_dataflow trigger a dataflow build (see documentation). Running without arguments yields an interactive shell. See run-docker.sh for other options.
92
92
@@ -106,7 +106,7 @@ Linting
106
106
We use a pre-commit hook to auto-format Python code and check for issues.
107
107
See https://pre-commit.com/ for installation. Once you have pre-commit, you can install
108
108
the hooks into your local clone of the FINN repo.
109
-
It's recommended to do this **on the host** and not inside the Docker container:
109
+
It is recommended to do this **on the host** and not inside the Docker container:
110
110
111
111
::
112
112
@@ -119,7 +119,7 @@ you may have to fix it manually, then run `git commit` once again.
119
119
The checks are configured in .pre-commit-config.yaml under the repo root.
120
120
121
121
Testing
122
-
=======
122
+
========
123
123
124
124
Tests are vital to keep FINN running. All the FINN tests can be found at https://github.com/Xilinx/finn/tree/main/tests.
125
125
These tests can be roughly grouped into three categories:
@@ -132,7 +132,7 @@ These tests can be roughly grouped into three categories:
132
132
133
133
Additionally, qonnx, brevitas and finn-hlslib also include their own test suites.
134
134
The full FINN compiler test suite
135
-
(which will take several hours to run and require a PYNQ board) can be executed
135
+
(which will take several hours to run) can be executed
136
136
by:
137
137
138
138
::
@@ -146,7 +146,7 @@ requiring Vivado or as slow-running tests:
146
146
147
147
bash ./run-docker.sh quicktest
148
148
149
-
When developing a new feature it's useful to be able to run just a single test,
149
+
When developing a new feature it is useful to be able to run just a single test,
150
150
or a group of tests that e.g. share the same prefix.
151
151
You can do this inside the Docker container
152
152
from the FINN root directory as follows:
@@ -178,16 +178,9 @@ FINN provides two types of documentation:
178
178
* manually written documentation, like this page
179
179
* autogenerated API docs from Sphinx
180
180
181
-
Everything is built using Sphinx, which is installed into the finn.dev
182
-
Docker image. You can build the documentation locally by running the following
183
-
inside the container:
184
-
185
-
::
186
-
187
-
python setup.py docs
181
+
Everything is built using Sphinx.
188
182
189
-
You can view the generated documentation on build/html/index.html.
190
-
The documentation is also built online by readthedocs:
183
+
The documentation is built online by readthedocs:
191
184
192
185
* finn.readthedocs.io contains the docs from the master branch
193
186
* finn-dev.readthedocs.io contains the docs from the dev branch
0 commit comments