Skip to content

Commit 311ac68

Browse files
committed
Merge remote-tracking branch 'eki-project/dev' into feature/attention-streamline
2 parents 15a9daa + 957b5c1 commit 311ac68

Some content is hidden

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

54 files changed

+4456
-613
lines changed

.gitlab-ci.yml

Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
1+
stages:
2+
- sync
3+
- singularity_build
4+
- load_deps
5+
- test
6+
7+
variables:
8+
PIPELINE_NAME:
9+
description: "Optional name to better identify this pipeline"
10+
value: ""
11+
TEST_SUITE:
12+
description: "Select test suite to run"
13+
value: "full"
14+
options:
15+
- "none"
16+
- "quicktest"
17+
- "full"
18+
CPU_CORES:
19+
description: "Select number of CPU cores and test workers"
20+
value: "8"
21+
PARALLEL_JOBS:
22+
description: "Number of parallel Slurm array jobs per Benchmark job"
23+
value: "2"
24+
SLURM_TIMEOUT:
25+
description: "Select SLURM timeout"
26+
value: "3-0" # [days-hours]
27+
SLURM_PARTITION:
28+
description: "Slurm partition (e.g., normal, largemem, fpga, gpu)"
29+
value: "normal"
30+
SLURM_QOS:
31+
description: "Optional QoS option (include --qos, e.g., --qos express)"
32+
value: ""
33+
MANUAL_CFG_PATH:
34+
description: "Use this config file instead of configs stored in the repo. Path must be accessible to runner"
35+
value: ""
36+
FINN_XILINX_VERSION:
37+
value: "2022.2"
38+
39+
workflow:
40+
name: '$PIPELINE_NAME'
41+
rules:
42+
# Run pipeline for GitHub PRs to dev (does not support PRs from forks)
43+
- if: $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "dev"
44+
# Run pipeline for pushes to dev
45+
- if: $CI_COMMIT_BRANCH == "dev"
46+
# Run pipeline if manually triggered via API or web GUI
47+
- if: $CI_PIPELINE_SOURCE == "api"
48+
- if: $CI_PIPELINE_SOURCE == "web"
49+
# Run pipeline if scheduled (only for nightly sync of finn-dev)
50+
- if: $CI_PIPELINE_SOURCE == "schedule"
51+
52+
Sync finn-dev:
53+
id_tokens:
54+
CI_JOB_JWT:
55+
aud: https://git.uni-paderborn.de
56+
stage: sync
57+
tags:
58+
# Run where full Docker + Singularity is available
59+
- image_build
60+
rules:
61+
# Only run on a schedule
62+
- if: $CI_PIPELINE_SOURCE == "schedule"
63+
script:
64+
- mkdir -p ../github_clone && cd ../github_clone
65+
- rm -rf finn-plus # Ensure we do a fresh clone (TODO: better way to handle this on job level?)
66+
- git clone git@github.com:eki-project/finn-plus.git && cd finn-plus
67+
- git remote add upstream https://github.com/Xilinx/finn.git
68+
- git checkout finn-dev
69+
- git pull upstream dev
70+
- git push origin finn-dev
71+
72+
Singularity Image Build:
73+
id_tokens:
74+
CI_JOB_JWT:
75+
aud: https://git.uni-paderborn.de
76+
stage: singularity_build
77+
tags:
78+
# Run where full Docker + Singularity is available
79+
- image_build
80+
rules:
81+
# Do not run on a schedule
82+
- if: $CI_PIPELINE_SOURCE == "schedule"
83+
when: never
84+
# Always run for dev branch to ensure default image is up to date
85+
- if: $CI_COMMIT_REF_SLUG == "dev"
86+
# For other branches only run if relevant files changed relative to dev branch
87+
- changes:
88+
paths:
89+
- requirements.txt
90+
- docker/Dockerfile.finn
91+
- docker/finn_entrypoint.sh
92+
- docker/quicktest.sh
93+
compare_to: "dev"
94+
script:
95+
- docker build --no-cache -f docker/Dockerfile.finn --tag=finn_docker_export .
96+
- apptainer build --force finn_singularity_image.sif docker-daemon://finn_docker_export:latest
97+
- rsync -vh finn_singularity_image.sif $PATH_SINGULARITY_IMG_BUILD/finn-plus/finn_$CI_COMMIT_REF_SLUG.sif
98+
- echo SINGULARITY_IMG_SELECT=finn_$CI_COMMIT_REF_SLUG.sif > FINN_environment.env
99+
after_script: # Clean caches
100+
- echo 'y' | docker image prune
101+
- echo 'y' | docker builder prune
102+
- echo 'y' | apptainer cache clean
103+
# Save env var selecting Singularity image to be used in subsequent jobs
104+
artifacts:
105+
reports:
106+
dotenv: FINN_environment.env
107+
108+
Fetch Repos:
109+
id_tokens:
110+
CI_JOB_JWT:
111+
aud: https://git.uni-paderborn.de
112+
stage: load_deps
113+
tags:
114+
- login
115+
rules:
116+
# Do not run on a schedule
117+
- if: $CI_PIPELINE_SOURCE == "schedule"
118+
when: never
119+
# Otherwise run
120+
- when: always
121+
cache:
122+
key: $CI_COMMIT_SHA
123+
paths:
124+
- deps
125+
variables:
126+
SINGULARITY_IMG_SELECT: "finn_dev.sif" # default, may be overwritten by dotenv artifact
127+
script:
128+
- ./fetch-repos.sh
129+
# Workaround for https://gitlab.com/gitlab-org/gitlab/-/issues/349538
130+
# Passing artifacts from optional parent jobs to child pipelines is not supported
131+
# Therefore, we pass the dotenv artifact from "Singularity Image Build" through this job
132+
- echo SINGULARITY_IMG_SELECT=$SINGULARITY_IMG_SELECT > FINN_environment_passthrough.env
133+
artifacts:
134+
reports:
135+
dotenv: FINN_environment_passthrough.env
136+
137+
FINN Test Suite 2022.2:
138+
id_tokens:
139+
CI_JOB_JWT:
140+
aud: https://git.uni-paderborn.de
141+
stage: test
142+
rules:
143+
# Do not run on a schedule
144+
- if: $CI_PIPELINE_SOURCE == "schedule"
145+
when: never
146+
# Do not run if test suite has been deselected
147+
- if: $TEST_SUITE == "none"
148+
when: never
149+
# Always run, as long as there was no prior failure
150+
- when: on_success
151+
cache:
152+
key: $CI_COMMIT_SHA
153+
policy: pull
154+
paths:
155+
- deps
156+
variables:
157+
SCHEDULER_PARAMETERS: "-A $PROJECT_ACCOUNT -p $SLURM_PARTITION -t $SLURM_TIMEOUT $SLURM_QOS --nodes 1 --ntasks 1 --cpus-per-task $CPU_CORES --exclusive"
158+
PYTEST_PARALLEL: "$CPU_CORES"
159+
FINN_XILINX_VERSION: "2022.2"
160+
before_script:
161+
- cp -dfR .. $PATH_WORKDIR # Copy to working directory (e.g. RAMdisk)
162+
- cd $PATH_WORKDIR/finn-plus
163+
- chmod 755 ./test.sh
164+
- module load system singularity
165+
- ulimit -s unlimited # Increase stack size limit
166+
- export FINN_SINGULARITY=$PATH_SINGULARITY_IMG/finn-plus/$SINGULARITY_IMG_SELECT
167+
script:
168+
- ./run-docker.sh ./test.sh $TEST_SUITE
169+
artifacts:
170+
name: "test_reports"
171+
when: always
172+
paths:
173+
- reports/
174+
reports:
175+
junit: reports/*.xml
176+
177+
FINN Test Suite 2024.1:
178+
extends: FINN Test Suite 2022.2
179+
variables:
180+
FINN_XILINX_VERSION: "2024.1"

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
exclude: '^docs/conf.py'
3030

3131
default_language_version:
32-
python: python3.10
32+
python: python3
3333

3434
repos:
3535
- repo: https://github.com/pre-commit/pre-commit-hooks
@@ -63,7 +63,7 @@ repos:
6363
args: [--line-length=100]
6464

6565
- repo: https://github.com/PyCQA/flake8
66-
rev: 6.0.0
66+
rev: 6.1.0
6767
hooks:
6868
- id: flake8
6969
# black-compatible flake-8 config

docker/Dockerfile.finn

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ RUN if [ -z "$LOCAL_XRT" ] && [ -z "$SKIP_XRT" ];then \
8686
COPY requirements.txt $XRT_DEB_VERSION.* /tmp/
8787

8888
RUN if [ -z "$SKIP_XRT" ];then \
89-
apt install -y /tmp/$XRT_DEB_VERSION.deb && \
89+
apt update && apt install -y /tmp/$XRT_DEB_VERSION.deb && \
9090
rm /tmp/$XRT_DEB_VERSION.deb; fi
9191

9292
# versioned Python package requirements for FINN compiler
@@ -103,21 +103,23 @@ RUN pip install ipykernel==6.21.2
103103
RUN pip install jupyter==1.0.0 --ignore-installed
104104
RUN pip install markupsafe==2.0.1
105105
RUN pip install matplotlib==3.7.0 --ignore-installed
106-
RUN pip install pytest-dependency==0.5.1
107-
RUN pip install pytest-xdist[setproctitle]==3.2.0
108-
RUN pip install pytest-parallel==0.1.1
106+
RUN pip install pytest-dependency==0.6.0
107+
RUN pip install pytest-xdist[setproctitle]==3.6.1
109108
RUN pip install "netron>=5.0.0"
110109
RUN pip install pandas==1.5.3
111110
RUN pip install scikit-learn==1.2.1
112111
RUN pip install tqdm==4.64.1
113112
RUN pip install -e git+https://github.com/fbcotter/dataset_loading.git@0.0.4#egg=dataset_loading
114113
# these versions of pytest and associated plugins allow for stable collection of
115114
# test reports and code coverage reports in HTML
116-
RUN pip install pytest==6.2.5
117-
RUN pip install pytest-metadata==1.7.0
118-
RUN pip install pytest-html==3.0.0
119-
RUN pip install pytest-html-merger==0.0.8
120-
RUN pip install pytest-cov==4.1.0
115+
RUN pip install pytest==8.3.4
116+
RUN pip install pytest-metadata==3.1.1
117+
RUN pip install pytest-html==4.1.1
118+
RUN pip install pytest-html-merger==0.1.0
119+
RUN pip install pytest-cov==6.0.0
120+
RUN pip install pytest-forked==1.6.0
121+
RUN pip install pytest-rerunfailures==15.0
122+
RUN pip install pyyaml==6.0.1
121123

122124
# extra dependencies from other FINN deps
123125
# installed in Docker image to make entrypoint script go faster

docker/quicktest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ elif [ $1 = "main" ]; then
1111
echo "Running main test suite: not (rtlsim or end2end) with pytest-xdist"
1212
pytest -k 'not (rtlsim or end2end)' --dist=loadfile -n $PYTEST_PARALLEL
1313
elif [ $1 = "rtlsim" ]; then
14-
echo "Running rtlsim test suite with pytest-parallel"
15-
pytest -k rtlsim --workers $PYTEST_PARALLEL
14+
echo "Running rtlsim test suite with pytest-xdist"
15+
pytest -k rtlsim --dist=loadfile -n $PYTEST_PARALLEL
1616
elif [ $1 = "end2end" ]; then
1717
echo "Running end2end test suite with no parallelism"
1818
pytest -k end2end

fetch-repos.sh

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

30-
QONNX_COMMIT="1a4957ebf2aaf139217fd56109386d4518dd6127"
30+
QONNX_COMMIT="4b731dbf3120316f11ae1c4b298ceaf9e73f21b3"
3131
FINN_EXP_COMMIT="0724be21111a21f0d81a072fccc1c446e053f851"
3232
BREVITAS_COMMIT="d4834bd2a0fad3c1fbc0ff7e1346d5dcb3797ea4"
3333
PYVERILATOR_COMMIT="ce0a08c20cb8c1d1e84181d6f392390f846adbd1"
3434
CNPY_COMMIT="4e8810b1a8637695171ed346ce68f6984e585ef4"
35-
HLSLIB_COMMIT="16e5847a5e3ef76cffe84c8fad2f010d593457d3"
35+
HLSLIB_COMMIT="5c5ad631e3602a8dd5bd3399a016477a407d6ee7"
3636
OMX_COMMIT="0b59762f9e4c4f7e5aa535ee9bc29f292434ca7a"
3737
AVNET_BDF_COMMIT="2d49cfc25766f07792c0b314489f21fe916b639b"
3838
XIL_BDF_COMMIT="8cf4bb674a919ac34e3d99d8d71a9e60af93d14e"
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/******************************************************************************
2+
* Copyright (C) 2024, Advanced Micro Devices, Inc.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
*
15+
* 3. Neither the name of the copyright holder nor the names of its
16+
* contributors may be used to endorse or promote products derived from
17+
* this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26+
* OR BUSINESS INTERRUPTION). HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*
31+
* @author Thomas B. Preußer <thomas.preusser@amd.com>
32+
* @brief Wiring-only pass-thru AXI-Stream connector.
33+
*/
34+
35+
module passthru_axi #(
36+
int unsigned DATA_WIDTH
37+
)(
38+
// Global Control - NOT USED
39+
input logic ap_clk,
40+
input logic ap_rst_n,
41+
42+
// Input Stream
43+
input logic [DATA_WIDTH-1:0] s_axis_tdata,
44+
input logic s_axis_tvalid,
45+
output logic s_axis_tready,
46+
47+
// Output Stream
48+
output logic [DATA_WIDTH-1:0] m_axis_tdata,
49+
output logic m_axis_tvalid,
50+
input logic m_axis_tready
51+
);
52+
// Simple pass-through Connection
53+
assign m_axis_tdata = s_axis_tdata;
54+
assign m_axis_tvalid = s_axis_tvalid;
55+
assign s_axis_tready = m_axis_tready;
56+
57+
endmodule : passthru_axi
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/******************************************************************************
2+
* Copyright (C) 2024, Advanced Micro Devices, Inc.
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without
6+
* modification, are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice,
9+
* this list of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form must reproduce the above copyright
12+
* notice, this list of conditions and the following disclaimer in the
13+
* documentation and/or other materials provided with the distribution.
14+
*
15+
* 3. Neither the name of the copyright holder nor the names of its
16+
* contributors may be used to endorse or promote products derived from
17+
* this software without specific prior written permission.
18+
*
19+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21+
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22+
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23+
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
26+
* OR BUSINESS INTERRUPTION). HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27+
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
28+
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
29+
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
*
31+
* @author Thomas B. Preußer <thomas.preusser@amd.com>
32+
* @brief Verilog wrapper for IP packaging.
33+
*/
34+
35+
module $MODULE_NAME_AXI_WRAPPER$ #(
36+
int unsigned DATA_WIDTH = $DATA_WIDTH$
37+
)(
38+
// Global Control - NOT USED
39+
(* X_INTERFACE_PARAMETER = "ASSOCIATED_BUSIF s_axis:m_axis, ASSOCIATED_RESET ap_rst_n" *)
40+
(* X_INTERFACE_INFO = "xilinx.com:signal:clock:1.0 ap_clk CLK" *)
41+
input ap_clk,
42+
(* X_INTERFACE_PARAMETER = "POLARITY ACTIVE_LOW" *)
43+
input ap_rst_n,
44+
45+
// Input Stream
46+
input logic [DATA_BITS-1:0] s_axis_tdata,
47+
input logic s_axis_tvalid,
48+
output logic s_axis_tready,
49+
50+
// Output Stream
51+
output logic [DATA_BITS-1:0] m_axis_tdata,
52+
output logic m_axis_tvalid,
53+
input logic m_axis_tready
54+
);
55+
56+
passthru_axi #(.DATA_BITS(DATA_BITS)) core (
57+
.ap_clk(ap_clk), .ap_rst_n(ap_rst_n),
58+
.s_axis_tdata(s_axis_tdata), .s_axis_tvalid(s_axis_tvalid), .s_axis_tready(s_axis_tready),
59+
.m_axis_tdata(m_axis_tdata), .m_axis_tvalid(m_axis_tvalid), .m_axis_tready(m_axis_tready)
60+
);
61+
62+
endmodule // $MODULE_NAME_AXI_WRAPPER$

0 commit comments

Comments
 (0)