1+ include : ci/.gitlab-setup.yml
2+
13stages :
24 - sync
35 - build
@@ -17,6 +19,9 @@ variables:
1719 CPU_CORES :
1820 description : " Select number of CPU cores and test workers"
1921 value : " 32"
22+ CPU_CORES_BENCH :
23+ description : " Select number of CPU cores for benchmark runs"
24+ value : " 8"
2025 PARALLEL_JOBS :
2126 description : " Number of parallel Slurm array jobs per Benchmark job"
2227 value : " 1"
@@ -30,15 +35,14 @@ variables:
3035 description : " Optional QoS option (include --qos, e.g., --qos express)"
3136 value : " "
3237 MANUAL_CFG_PATH :
33- description : " Use this config file instead of configs stored in the repo. Path must be accessible to runner "
38+ description : " Name (in ci/cfg/) or path (relative to LOCAL_CFG_DIR) of benchmarking config to run "
3439 value : " "
3540
3641workflow :
3742 name : ' $PIPELINE_NAME'
3843 rules :
39- # Run pipeline for GitHub PRs to dev or main (does not support PRs from forks)
44+ # Run pipeline for GitHub PRs to dev (does not support PRs from forks)
4045 - if : $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "dev"
41- - if : $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "main"
4246 # Run pipeline for pushes to dev or main
4347 - if : $CI_COMMIT_BRANCH == "dev" || $CI_COMMIT_BRANCH == "main"
4448 # Run pipeline if manually triggered via API or web GUI
@@ -67,38 +71,6 @@ Sync finn-dev:
6771 - git pull upstream dev
6872 - git push origin finn-dev
6973
70- .n2_setup_general : &n2_setup_general
71- - module load lang/Python/3.10.4-GCCcore-11.3.0
72- - module load devel/Autoconf/2.71-GCCcore-11.3.0
73- - module load lang/Bison/3.8.2-GCCcore-11.3.0
74- - module load lang/flex/2.6.4-GCCcore-11.3.0
75- - module load compiler/GCC/11.3.0
76- - module load lib/pybind11/2.9.2-GCCcore-11.3.0
77- - module load devel/Boost/1.79.0-GCC-11.3.0
78- - module load lib/fmt/9.1.0-GCCcore-11.3.0
79- - ulimit -s unlimited # Increase stack size limit
80-
81- .n2_setup_xilinx_2022_2 : &n2_setup_xilinx_2022_2
82- - module load fpga
83- - module load xilinx/xrt/2.14 # includes Vitis/Vivado 2022.2
84- # module load will set PLATFORM_REPO_PATHS to one specific platform, revert to top-level PLATFORM_PATH
85- - export PLATFORM_REPO_PATHS=$PLATFORM_PATH
86-
87- .n2_setup_xilinx_2024_2 : &n2_setup_xilinx_2024_2
88- - module load fpga
89- - module load xilinx/xrt/2.14 # includes Vitis/Vivado 2022.2
90- - module swap xilinx/vitis/24.2 # switch to Vitis/Vivado 2024.2
91- # module load will set PLATFORM_REPO_PATHS to one specific platform, revert to top-level PLATFORM_PATH
92- - export PLATFORM_REPO_PATHS=$PLATFORM_PATH
93-
94- .setup_venv_from_whl : &setup_venv_from_whl
95- # Move everything to working directory (e.g., RAMdisk)
96- - cp -dfR . $PATH_WORKDIR
97- - cd $PATH_WORKDIR
98- # Create fresh virtual environment and install finn-plus from .whl (artifact)
99- - python3 -m venv finn-plus-venv
100- - finn-plus-venv/bin/pip install dist/*.whl
101-
10274Build :
10375 id_tokens :
10476 CI_JOB_JWT :
@@ -113,8 +85,8 @@ Build:
11385 # Otherwise run
11486 - when : always
11587 before_script :
116- - * n2_setup_general
117- - * n2_setup_xilinx_2022_2
88+ - !reference [. n2_setup_general, before_script]
89+ - !reference [. n2_setup_xilinx_2022_2, before_script]
11890 # Install current version of Poetry
11991 - python3 -m venv poetry-install
12092 - poetry-install/bin/pip install poetry
@@ -151,6 +123,9 @@ FINN Test Suite 2022.2:
151123 # Do not run if test suite has been deselected
152124 - if : $TEST_SUITE == "none"
153125 when : never
126+ # Do not run for PRs to dev (run only for pushes)
127+ - if : $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "dev"
128+ when : never
154129 # Always run, as long as there was no prior failure
155130 - when : on_success
156131 cache :
@@ -159,13 +134,10 @@ FINN Test Suite 2022.2:
159134 paths :
160135 - deps
161136 variables :
162- GIT_STRATEGY : empty # Do not pull repository, use PyPI installation instead
137+ GIT_STRATEGY : empty # Do not pull repository, install from wheel (artifact) instead
163138 SCHEDULER_PARAMETERS : " -A $PROJECT_ACCOUNT -p $SLURM_PARTITION -t $SLURM_TIMEOUT $SLURM_QOS --nodes 1 --ntasks 1 --cpus-per-task $CPU_CORES --exclusive"
164139 PYTEST_PARALLEL : " $CPU_CORES"
165- before_script :
166- - *n2_setup_general
167- - *n2_setup_xilinx_2022_2
168- - *setup_venv_from_whl
140+ extends : .setup_full_2022_2
169141 script :
170142 # Launch additional monitoring
171143 - $JOB_MONITORING_DIR/monitor.sh $JOB_MONITORING_DIR/$CI_PIPELINE_ID/$HOSTNAME.log &
@@ -182,8 +154,71 @@ FINN Test Suite 2022.2:
182154 junit : reports/*.xml
183155
184156FINN Test Suite 2024.2 :
185- extends : FINN Test Suite 2022.2
186- before_script :
187- - *n2_setup_general
188- - *n2_setup_xilinx_2024_2
189- - *setup_venv_from_whl
157+ extends :
158+ - FINN Test Suite 2022.2
159+ - .setup_full_2024_2
160+ rules :
161+ # Do not run on a schedule
162+ - if : $CI_PIPELINE_SOURCE == "schedule"
163+ when : never
164+ # Do not run if test suite has been deselected
165+ - if : $TEST_SUITE == "none"
166+ when : never
167+ # Always run, as long as there was no prior failure
168+ - when : on_success
169+
170+ Bench (Manual) :
171+ stage : test
172+ rules :
173+ # Do not run on a schedule
174+ - if : $CI_PIPELINE_SOURCE == "schedule"
175+ when : never
176+ - if : $MANUAL_CFG_PATH != ""
177+ trigger :
178+ include : ci/.gitlab-bench.yml
179+ strategy : depend
180+ forward :
181+ pipeline_variables : true
182+ variables :
183+ PARENT_PIPELINE_ID : $CI_PIPELINE_ID
184+ BENCH_CFG : " manual"
185+
186+ Bench (Basic) :
187+ stage : test
188+ rules :
189+ # Do not run on a schedule
190+ - if : $CI_PIPELINE_SOURCE == "schedule"
191+ when : never
192+ - if : $MANUAL_CFG_PATH == ""
193+ trigger :
194+ include : ci/.gitlab-bench.yml
195+ strategy : depend
196+ forward :
197+ pipeline_variables : true
198+ variables :
199+ PARENT_PIPELINE_ID : $CI_PIPELINE_ID
200+ parallel :
201+ matrix :
202+ - BENCH_CFG : [regression_basic]
203+
204+ Bench (Extended) :
205+ stage : test
206+ rules :
207+ # Do not run on a schedule
208+ - if : $CI_PIPELINE_SOURCE == "schedule"
209+ when : never
210+ # Do not run for PRs to dev (run only for pushes)
211+ - if : $CI_PIPELINE_SOURCE == "external_pull_request_event" && $CI_EXTERNAL_PULL_REQUEST_TARGET_BRANCH_NAME == "dev"
212+ when : never
213+ - if : $MANUAL_CFG_PATH == ""
214+ trigger :
215+ include : ci/.gitlab-bench.yml
216+ strategy : depend
217+ forward :
218+ pipeline_variables : true
219+ variables :
220+ PARENT_PIPELINE_ID : $CI_PIPELINE_ID
221+ PARALLEL_JOBS : " 4"
222+ parallel :
223+ matrix :
224+ - BENCH_CFG : [regression_extended, microbenchmark_basic]
0 commit comments