Skip to content

Commit 5a7cc37

Browse files
author
Yaman Umuroglu
authored
Merge pull request #348 from Xilinx/dev
FINN v0.6
2 parents af783db + c8be504 commit 5a7cc37

124 files changed

Lines changed: 6786 additions & 1600 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/quicktest-dev-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111

1212
test:
1313
name: Run quicktest on PR branch
14-
runs-on: ubuntu-16.04
14+
runs-on: ubuntu-18.04
1515

1616
steps:
1717
- name: checkout

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ __pycache__/*
4242
*.ipynb_checkpoints*
4343

4444
# Project files
45+
.vscode
4546
.ropeproject
4647
.project
4748
.pydevproject

AUTHORS.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
Contributors
33
============
44

5-
* Yaman Umuroglu (@maltanar)
5+
* Yaman Umuroglu (@maltanar) (maintainer)
66
* Jakoba Petri-Koenig (@auphelia)
77
* Andrea Rigoni (@AndreaRigoni)
88
* Hendrik Borras (@HenniOVP)
99
* Lucian Petrica (@quetric)
1010
* Tobias Alonso (@Tobi-Alonso)
11+
* Felix Paul Jentzsch (@felixpj)
12+
* Mirza Mrahorovic (@mmrahorovic)
13+
* Suranga Mahesh (@surangamh)
14+
* Peter Lehnhardt (@pete-lennart)
15+
* Neil Kim Nielsen (@neilkimn)

docker/Dockerfile.finn_ci

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,50 @@
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

2929
FROM pytorch/pytorch:1.1.0-cuda10.0-cudnn7.5-devel
30-
MAINTAINER Yaman Umuroglu <yamanu@xilinx.com>
30+
LABEL maintainer="Yaman Umuroglu <yamanu@xilinx.com>"
3131

3232
WORKDIR /workspace
3333

34+
# some Vitis deps require a timezone to be specified, which hangs in Docker
35+
# use workaround from https://grigorkh.medium.com/fix-tzdata-hangs-docker-image-build-cdb52cc3360d
36+
ENV TZ="Europe/Dublin"
37+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
38+
3439
RUN apt-get update
3540
RUN apt-get -y upgrade
36-
RUN apt-get install -y build-essential libglib2.0-0 libsm6 libxext6 libxrender-dev
37-
RUN apt-get install -y verilator zsh nano
38-
RUN apt-get install -y sshpass wget unzip
41+
RUN apt-get install -y build-essential
42+
RUN apt-get install -y libglib2.0-0
43+
RUN apt-get install -y libsm6
44+
RUN apt-get install -y libxext6
45+
RUN apt-get install -y libxrender-dev
46+
RUN apt-get install -y verilator
47+
RUN apt-get install -y nano
48+
RUN apt-get install -y zsh
49+
RUN apt-get install -y rsync
50+
RUN apt-get install -y git
51+
RUN apt-get install -y sshpass
52+
RUN apt-get install -y wget
53+
RUN apt-get install -y unzip
54+
RUN apt-get install -y zip
3955
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
4056

4157
# XRT deps
42-
RUN wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh
43-
RUN apt-get update
44-
RUN bash xrtdeps.sh -docker
45-
RUN rm xrtdeps.sh
58+
# install vitis deps if required
59+
ARG INSTALL_XRT_DEPS="0"
60+
ARG XRT_DEB_VERSION="xrt_202010.2.7.766_18.04-amd64-xrt"
61+
RUN if [ "$INSTALL_XRT_DEPS" = "1" ] ; then \
62+
echo "Installing XRT: $XRT_DEB_VERSION"; \
63+
wget https://www.xilinx.com/bin/public/openDownload?filename=$XRT_DEB_VERSION.deb -O /tmp/$XRT_DEB_VERSION.deb; \
64+
apt install -y /tmp/$XRT_DEB_VERSION.deb; \
65+
else \
66+
echo "Skipping installation of XRT dependencies"; \
67+
fi
4668

4769
# cloning dependency repos
4870
# finn-base
4971
RUN git clone https://github.com/Xilinx/finn-base.git /workspace/finn-base
72+
# finn-experimental
73+
RUN git clone https://github.com/Xilinx/finn-experimental.git /workspace/finn-experimental
5074
# Brevitas
5175
RUN git clone https://github.com/Xilinx/brevitas.git /workspace/brevitas
5276
# CNPY

docker/Dockerfile.finn_dev

Lines changed: 35 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828

29-
FROM pytorch/pytorch:1.1.0-cuda10.0-cudnn7.5-devel
30-
MAINTAINER Yaman Umuroglu <yamanu@xilinx.com>
29+
FROM pytorch/pytorch:1.7.1-cuda11.0-cudnn8-runtime
30+
LABEL maintainer="Yaman Umuroglu <yamanu@xilinx.com>"
3131
ARG GID
3232
ARG GNAME
3333
ARG UNAME
@@ -36,11 +36,28 @@ ARG PASSWD
3636

3737
WORKDIR /workspace
3838

39+
# some Vitis deps require a timezone to be specified, which hangs in Docker
40+
# use workaround from https://grigorkh.medium.com/fix-tzdata-hangs-docker-image-build-cdb52cc3360d
41+
ENV TZ="Europe/Dublin"
42+
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
43+
44+
3945
RUN apt-get update
4046
RUN apt-get -y upgrade
41-
RUN apt-get install -y build-essential libglib2.0-0 libsm6 libxext6 libxrender-dev
42-
RUN apt-get install -y verilator nano zsh rsync
43-
RUN apt-get -y install sshpass wget unzip
47+
RUN apt-get install -y build-essential
48+
RUN apt-get install -y libglib2.0-0
49+
RUN apt-get install -y libsm6
50+
RUN apt-get install -y libxext6
51+
RUN apt-get install -y libxrender-dev
52+
RUN apt-get install -y verilator
53+
RUN apt-get install -y nano
54+
RUN apt-get install -y zsh
55+
RUN apt-get install -y rsync
56+
RUN apt-get install -y git
57+
RUN apt-get install -y sshpass
58+
RUN apt-get install -y wget
59+
RUN apt-get install -y unzip
60+
RUN apt-get install -y zip
4461
RUN echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config
4562

4663
COPY requirements.txt .
@@ -54,22 +71,29 @@ RUN pip install sphinx==3.1.2
5471
RUN pip install sphinx_rtd_theme==0.5.0
5572
RUN pip install pytest-xdist==2.0.0
5673
RUN pip install pytest-parallel==0.1.0
57-
RUN pip install netron
74+
RUN pip install netron>=4.7.9
75+
RUN pip install pandas==1.1.5
76+
RUN pip install scikit-learn==0.24.1
77+
RUN pip install tqdm==4.31.1
5878
RUN pip install -e git+https://github.com/fbcotter/dataset_loading.git@0.0.4#egg=dataset_loading
5979

80+
6081
# switch user
6182
RUN groupadd -g $GID $GNAME
6283
RUN useradd -M -u $UID $UNAME -g $GNAME
6384
RUN usermod -aG sudo $UNAME
6485
RUN echo "$UNAME:$PASSWD" | chpasswd
6586
RUN echo "root:$PASSWD" | chpasswd
87+
RUN chown -R $UNAME:$GNAME /workspace
6688
RUN ln -s /workspace /home/$UNAME
67-
RUN chown -R $UNAME:$GNAME /home/$UNAME
6889
USER $UNAME
6990

91+
7092
# cloning dependency repos (as user)
7193
# finn-base
7294
RUN git clone https://github.com/Xilinx/finn-base.git /workspace/finn-base
95+
# finn-experimental
96+
RUN git clone https://github.com/Xilinx/finn-experimental.git /workspace/finn-experimental
7397
# Brevitas
7498
RUN git clone https://github.com/Xilinx/brevitas.git /workspace/brevitas
7599
# CNPY
@@ -98,12 +122,11 @@ RUN chmod 755 /usr/local/bin/finn_entrypoint.sh
98122
RUN chmod 755 /usr/local/bin/quicktest.sh
99123
# install vitis deps if required
100124
ARG INSTALL_XRT_DEPS
125+
ARG XRT_DEB_VERSION
101126
RUN if [ "$INSTALL_XRT_DEPS" = "1" ] ; then \
102-
echo "Installing XRT dependencies"; \
103-
wget https://raw.githubusercontent.com/Xilinx/XRT/master/src/runtime_src/tools/scripts/xrtdeps.sh; \
104-
apt-get update; \
105-
bash xrtdeps.sh -docker; \
106-
rm xrtdeps.sh; \
127+
echo "Installing XRT: $XRT_DEB_VERSION"; \
128+
wget https://www.xilinx.com/bin/public/openDownload?filename=$XRT_DEB_VERSION.deb -O /tmp/$XRT_DEB_VERSION.deb; \
129+
apt install -y /tmp/$XRT_DEB_VERSION.deb; \
107130
else \
108131
echo "Skipping installation of XRT dependencies"; \
109132
fi

docker/finn_entrypoint.sh

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,39 @@ export SHELL=/bin/bash
44
export FINN_ROOT=/workspace/finn
55

66
GREEN='\033[0;32m'
7+
RED='\033[0;31m'
78
NC='\033[0m' # No Color
89

910
gecho () {
1011
echo -e "${GREEN}$1${NC}"
1112
}
1213

14+
recho () {
15+
echo -e "${RED}ERROR: $1${NC}"
16+
}
17+
1318
# checkout the correct dependency repo commits
1419
# the repos themselves are cloned in the Dockerfile
15-
FINN_BASE_COMMIT=1363981654009067790d5f2d0c3dd303b5fa05cb
16-
BREVITAS_COMMIT=aff49758ec445d77c75721c7de3091a2a1797ca8
20+
FINN_BASE_COMMIT=ac0b86a63eb937b869bfa453a996a8a8b8506546
21+
FINN_EXP_COMMIT=f82c0d9868bb88ea045dfadb28508d327d287221
22+
BREVITAS_COMMIT=d7ded80fa9557da2998ea310669edee7fb2d9526
1723
CNPY_COMMIT=4e8810b1a8637695171ed346ce68f6984e585ef4
18-
HLSLIB_COMMIT=cfafe11a93b79ab1af7529d68f08886913a6466e
24+
HLSLIB_COMMIT=4d74baefa79df48b5a0348d63f39a26df075de51
1925
PYVERILATOR_COMMIT=e2ff74030de3992dcac54bf1b6aad2915946e8cb
2026
OMX_COMMIT=1bae737669901e762f581af73348332b5c4b2ada
27+
AVNET_BDF_COMMIT=2d49cfc25766f07792c0b314489f21fe916b639b
2128

2229
gecho "Setting up known-good commit versions for FINN dependencies"
2330
# finn-base
2431
gecho "finn-base @ $FINN_BASE_COMMIT"
2532
git -C /workspace/finn-base pull --quiet
2633
git -C /workspace/finn-base checkout $FINN_BASE_COMMIT --quiet
2734
pip install --user -e /workspace/finn-base
35+
# finn-experimental
36+
gecho "finn-experimental @ $FINN_EXP_COMMIT"
37+
git -C /workspace/finn-experimental pull --quiet
38+
git -C /workspace/finn-experimental checkout $FINN_EXP_COMMIT --quiet
39+
pip install --user -e /workspace/finn-experimental
2840
# Brevitas
2941
gecho "brevitas @ $BREVITAS_COMMIT"
3042
git -C /workspace/brevitas pull --quiet
@@ -74,22 +86,26 @@ if [ ! -d "/workspace/finn/board_files" ]; then
7486
rm pynq-z2.zip
7587
cd $OLD_PWD
7688
fi
77-
if [ ! -d "/workspace/finn/board_files/ultra96v1" ]; then
78-
gecho "Downloading Avnet BDF files into board_files"
89+
if [ ! -d "/workspace/finn/board_files/ultra96v2" ]; then
90+
gecho "Downloading Avnet BDF files from known-good commit into board_files"
7991
OLD_PWD=$(pwd)
8092
cd /workspace/finn
8193
git clone https://github.com/Avnet/bdf.git
94+
git -C /workspace/finn/bdf checkout $AVNET_BDF_COMMIT --quiet
8295
mv /workspace/finn/bdf/* /workspace/finn/board_files/
8396
rm -rf /workspace/finn/bdf
8497
cd $OLD_PWD
8598
fi
8699
if [ ! -z "$VITIS_PATH" ];then
87100
# source Vitis env.vars
88101
export XILINX_VITIS=$VITIS_PATH
102+
export XILINX_XRT=/opt/xilinx/xrt
89103
source $VITIS_PATH/settings64.sh
90104
if [ ! -z "$XILINX_XRT" ];then
91105
# source XRT
92106
source $XILINX_XRT/setup.sh
107+
else
108+
recho "XRT not found on $XILINX_XRT, did the installation fail?"
93109
fi
94110
fi
95111
exec "$@"

docker/quicktest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
cd $FINN_ROOT
66
# check if command line argument is empty or not present
77
if [ -z $1 ]; then
8-
echo "Running quicktest: not (vivado or slow) with pytest-xdist"
9-
python setup.py test --addopts "-m 'not (vivado or slow or vitis)' --dist=loadfile -n $PYTEST_PARALLEL"
8+
echo "Running quicktest: not (vivado or slow or board) with pytest-xdist"
9+
python setup.py test --addopts "-m 'not (vivado or slow or vitis or board)' --dist=loadfile -n $PYTEST_PARALLEL"
1010
elif [ $1 = "main" ]; then
1111
echo "Running main test suite: not (rtlsim or end2end) with pytest-xdist"
1212
python setup.py test --addopts "-k 'not (rtlsim or end2end)' --dist=loadfile -n $PYTEST_PARALLEL"

docs/finn/command_line.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,22 @@ as it go through numerous steps:
6262
Building dataflow accelerator from /home/maltanar/sandbox/build_dataflow/model.onnx
6363
Outputs will be generated at output_tfc_w1a1_Pynq-Z1
6464
Build log is at output_tfc_w1a1_Pynq-Z1/build_dataflow.log
65-
Running step: step_tidy_up [1/15]
66-
Running step: step_streamline [2/15]
67-
Running step: step_convert_to_hls [3/15]
68-
Running step: step_create_dataflow_partition [4/15]
69-
Running step: step_target_fps_parallelization [5/15]
70-
Running step: step_apply_folding_config [6/15]
71-
Running step: step_generate_estimate_reports [7/15]
72-
Running step: step_hls_ipgen [8/15]
73-
Running step: step_set_fifo_depths [9/15]
74-
Running step: step_create_stitched_ip [10/15]
75-
Running step: step_measure_rtlsim_performance [11/15]
76-
Running step: step_make_pynq_driver [12/15]
77-
Running step: step_out_of_context_synthesis [13/15]
78-
Running step: step_synthesize_bitfile [14/15]
79-
Running step: step_deployment_package [15/15]
65+
Running step: step_tidy_up [1/16]
66+
Running step: step_streamline [2/16]
67+
Running step: step_convert_to_hls [3/16]
68+
Running step: step_create_dataflow_partition [4/16]
69+
Running step: step_target_fps_parallelization [5/16]
70+
Running step: step_apply_folding_config [6/16]
71+
Running step: step_generate_estimate_reports [7/16]
72+
Running step: step_hls_codegen [8/16]
73+
Running step: step_hls_ipgen [9/16]
74+
Running step: step_set_fifo_depths [10/16]
75+
Running step: step_create_stitched_ip [11/16]
76+
Running step: step_measure_rtlsim_performance [12/16]
77+
Running step: step_make_pynq_driver [13/16]
78+
Running step: step_out_of_context_synthesis [14/16]
79+
Running step: step_synthesize_bitfile [15/16]
80+
Running step: step_deployment_package [16/16]
8081
8182
8283
You can read a brief description of what each step does on

0 commit comments

Comments
 (0)