Skip to content

Commit

Permalink
Merge pull request #1024 from Xilinx/dev
Browse files Browse the repository at this point in the history
Release merge for v0.10
  • Loading branch information
auphelia authored Apr 2, 2024
2 parents b3bdff1 + 766e9fb commit e3087ad
Show file tree
Hide file tree
Showing 344 changed files with 28,229 additions and 26,846 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ contact_links:
url: https://finn.readthedocs.io/en/latest/getting_started.html
about: Documentation about how to get up and running with FINN.
- name: Ask for help and get in touch with the community
url: https://gitter.im/xilinx-finn/community
about: Check out our gitter channel, if you have a question about FINN or a general problem that is likely not a bug.
url: https://github.com/Xilinx/finn/discussions
about: Check out our GitHub Discussions, if you have a question about FINN or a general problem that is likely not a bug.
2 changes: 0 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: DockerImage

on:
pull_request:
branches: [ dev ]
push:
branches: [ dev ]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.10'

- name: Run Lint
uses: pre-commit/[email protected]
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
line_length=88
indent=' '
skip=.tox,.venv,build,dist
known_standard_library=setuptools,pkg_resources
known_standard_library=setuptools
known_test=pytest
known_first_party=finn
sections=FUTURE,STDLIB,TEST,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
Expand Down
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@
exclude: '^docs/conf.py'

default_language_version:
python: python3.8
python: python3.10

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: trailing-whitespace
exclude: '\.dat$'
Expand All @@ -56,15 +56,16 @@ repos:
- id: isort

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.3.0
hooks:
- id: black
language_version: python3
args: [--line-length=100]

- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 6.0.0
hooks:
- id: flake8
# black-compatible flake-8 config
args: ['--max-line-length=88', # black default
args: ['--max-line-length=100', # black default
'--extend-ignore=E203'] # E203 is not PEP8 compliant
15 changes: 9 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2021, Xilinx
# Copyright (c) 2021-2022, Xilinx
# Copyright (C) 2023-2024, Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -31,13 +32,15 @@

version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.8"

sphinx:
configuration: docs/finn/conf.py

python:
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
- requirements: docs/requirements.txt
6 changes: 6 additions & 0 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ Contributors
* Matthias Gehre (@mgehre-amd)
* Hugo Le Blevec (@hleblevec)
* Patrick Geel (@patrickgeel)
* John Monks (@jmonks-amd)
* Tim Paine (@timkpaine)
* Linus Jungemann (@LinusJungemann)
* Shashwat Khandelwal (@shashwat1198)
* Ian Colbert (@i-colbert)
* Rachit Garg (@rstar900)
10 changes: 0 additions & 10 deletions CHANGELOG.rst

This file was deleted.

56 changes: 55 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,60 @@ Please follow the steps below and be sure that your contribution complies with o
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.
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>.

3. We will review your contribution and, if any additional fixes or modifications are
3. Sign Your Work

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::

```
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```

You can enable Signed-off-by automatically by adding the `-s` flag to the `git commit` command.

Here is an example Signed-off-by line which indicates that the contributor accepts DCO:

```
This is my commit message
Signed-off-by: Jane Doe <[email protected]>
```

4. We will review your contribution and, if any additional fixes or modifications are
necessary, may provide feedback to guide you. When accepted, your pull request will
be merged to the repository. If you have more questions please contact us.
3 changes: 2 additions & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Copyright (c) 2020, Xilinx
Copyright (C) 2020-2022, Xilinx, Inc.
Copyright (C) 2022-2024, Advanced Micro Devices, Inc.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@



<img align="left" src="https://raw.githubusercontent.com/Xilinx/finn/github-pages/docs/img/finn-stack.png" alt="drawing" style="margin-right: 20px" width="250"/>
<img align="left" src="https://raw.githubusercontent.com/Xilinx/finn/github-pages/docs/img/finn-stack.PNG" alt="drawing" style="margin-right: 20px" width="250"/>

[![GitHub Discussions](https://img.shields.io/badge/discussions-join-green)](https://github.com/Xilinx/finn/discussions)
[![ReadTheDocs](https://readthedocs.org/projects/finn/badge/?version=latest&style=plastic)](http://finn.readthedocs.io/)

FINN is an experimental framework from Xilinx Research Labs to explore deep neural network
inference on FPGAs.
FINN is an experimental framework from Integrated Communications and AI Lab of AMD Research & Advanced Development to explore deep neural network inference on FPGAs.
It specifically targets <a href="https://github.com/maltanar/qnn-inference-examples" target="_blank">quantized neural
networks</a>, with emphasis on
generating dataflow-style architectures customized for each network.
Expand All @@ -28,7 +27,7 @@ Please see the [Getting Started](https://finn.readthedocs.io/en/latest/getting_s

## Documentation

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.
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.

## Community

Expand Down
47 changes: 31 additions & 16 deletions docker/Dockerfile.finn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2021, Xilinx
# Copyright (C) 2021-2022, Xilinx, Inc.
# Copyright (C) 2022-2024, Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -26,10 +27,10 @@
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

FROM pytorch/pytorch:1.7.1-cuda11.0-cudnn8-runtime
LABEL maintainer="Yaman Umuroglu <yamanu@xilinx.com>"
FROM ubuntu:jammy-20230126
LABEL maintainer="Jakoba Petri-Koenig <[email protected]>, Yaman Umuroglu <yaman.umuroglu@amd.com>"

ARG XRT_DEB_VERSION="xrt_202210.2.13.466_18.04-amd64-xrt"
ARG XRT_DEB_VERSION="xrt_202220.2.14.354_22.04-amd64-xrt"

WORKDIR /workspace

Expand Down Expand Up @@ -57,12 +58,17 @@ RUN apt-get update && \
unzip \
zip \
locales \
lsb-core
lsb-core \
python3 \
python-is-python3 \
python3-pip \
python3-setuptools-scm \
python3-venv
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
RUN locale-gen "en_US.UTF-8"

# install Verilator from source to get the right version
RUN apt-get install -y git perl python3 make autoconf g++ flex bison ccache libgoogle-perftools-dev numactl perl-doc libfl2 libfl-dev zlibc zlib1g zlib1g-dev
RUN apt-get install -y git perl make autoconf g++ flex bison ccache libgoogle-perftools-dev numactl perl-doc libfl2 libfl-dev zlib1g zlib1g-dev
RUN git clone https://github.com/verilator/verilator
RUN cd verilator && \
git checkout v4.224 && \
Expand All @@ -81,22 +87,31 @@ RUN rm /tmp/$XRT_DEB_VERSION.deb
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN rm requirements.txt

# install PyTorch
RUN pip install torch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu116

# extra Python package dependencies (for testing and interaction)
RUN pip install pygments==2.4.1
RUN pip install ipykernel==5.5.5
RUN pip install pygments==2.14.0
RUN pip install ipykernel==6.21.2
RUN pip install jupyter==1.0.0 --ignore-installed
RUN pip install markupsafe==2.0.1
RUN pip install matplotlib==3.3.1 --ignore-installed
RUN pip install matplotlib==3.7.0 --ignore-installed
RUN pip install pytest-dependency==0.5.1
RUN pip install sphinx==5.0.2
RUN pip install sphinx_rtd_theme==0.5.0
RUN pip install pytest-xdist[setproctitle]==2.4.0
RUN pip install pytest-parallel==0.1.0
RUN pip install pytest-xdist[setproctitle]==3.2.0
RUN pip install pytest-parallel==0.1.1
RUN pip install "netron>=5.0.0"
RUN pip install pandas==1.1.5
RUN pip install scikit-learn==0.24.1
RUN pip install tqdm==4.31.1
RUN pip install pandas==1.5.3
RUN pip install scikit-learn==1.2.1
RUN pip install tqdm==4.64.1
RUN pip install -e git+https://github.com/fbcotter/[email protected]#egg=dataset_loading
# these versions of pytest and associated plugins allow for stable collection of
# test reports and code coverage reports in HTML
RUN pip install pytest==6.2.5
RUN pip install pytest-metadata==1.7.0
RUN pip install pytest-html==3.0.0
RUN pip install pytest-html-merger==0.0.8
RUN pip install pytest-cov==4.1.0

# extra dependencies from other FINN deps
# installed in Docker image to make entrypoint script go faster
Expand Down
28 changes: 26 additions & 2 deletions docker/finn_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,11 @@ recho () {
echo -e "${RED}ERROR: $1${NC}"
}

# qonnx
# qonnx (using workaround for https://github.com/pypa/pip/issues/7953)
# to be fixed in future Ubuntu versions (https://bugs.launchpad.net/ubuntu/+source/setuptools/+bug/1994016)
mv ${FINN_ROOT}/deps/qonnx/pyproject.toml ${FINN_ROOT}/deps/qonnx/pyproject.tmp
pip install --user -e ${FINN_ROOT}/deps/qonnx
mv ${FINN_ROOT}/deps/qonnx/pyproject.tmp ${FINN_ROOT}/deps/qonnx/pyproject.toml
# finn-experimental
pip install --user -e ${FINN_ROOT}/deps/finn-experimental
# brevitas
Expand Down Expand Up @@ -109,10 +112,31 @@ if [ -f "$HLS_PATH/settings64.sh" ];then
else
yecho "Unable to find $HLS_PATH/settings64.sh"
yecho "Functionality dependent on Vitis HLS will not be available."
yecho "Please note that FINN needs at least version 2020.2 for Vitis HLS support."
yecho "Please note that FINN needs at least version 2020.2 for Vitis HLS support. Our recommendation is to use version 2022.2"
yecho "If you need Vitis HLS, ensure HLS_PATH is set correctly and mounted into the Docker container."
fi

if [ -d "$FINN_ROOT/.Xilinx" ]; then
mkdir "$HOME/.Xilinx"
if [ -f "$FINN_ROOT/.Xilinx/HLS_init.tcl" ]; then
cp "$FINN_ROOT/.Xilinx/HLS_init.tcl" "$HOME/.Xilinx/"
gecho "Found HLS_init.tcl and copied to $HOME/.Xilinx/HLS_init.tcl"
else
yecho "Unable to find $FINN_ROOT/.Xilinx/HLS_init.tcl"
fi

if [ -f "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" ]; then
mkdir "$HOME/.Xilinx/Vivado/"
cp "$FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl" "$HOME/.Xilinx/Vivado/"
gecho "Found Vivado_init.tcl and copied to $HOME/.Xilinx/Vivado/Vivado_init.tcl"
else
yecho "Unable to find $FINN_ROOT/.Xilinx/Vivado/Vivado_init.tcl"
fi
else
echo "If you need to enable a beta device, ensure .Xilinx/HLS_init.tcl and/or .Xilinx/Vivado/Vivado_init.tcl are set correctly and mounted"
echo "See https://docs.xilinx.com/r/en-US/ug835-vivado-tcl-commands/Tcl-Initialization-Scripts"
fi

export PATH=$PATH:$HOME/.local/bin
# execute the provided command(s) as root
exec "$@"
Loading

0 comments on commit e3087ad

Please sign in to comment.