Skip to content

Commit 1f6e4b2

Browse files
Merge dev into main for release (#22)
* Remove hardcoded batch size from kernel execution * Implement setBatchSize for complete Stack * Remove RingBuffer from Synchronous Inference and add full batch mapping * Deduplicate batchsize in basedriver & fix unittests * Fix integrationtests * Change input kernel code to run concurrrently to output kernel code * Optimize inference of lower batch sizes * Increase packing performance * Further optimize OpenMP * Optimize Utils * Some small changes * Add example data * Small Amounts of cleanup * Change Driver to run without XRT managed kernels * Add more efficient version of execute method * Hotfix FPGA bricking * Simplify inference interface to speed up inference * Update unittest * Simplify code * Update CMake * Fix Release Build CMakeLists * Fix wrong old variable names in CMake * Fix formatting * Change format target * Add changes to paper version * Add final paper changes * Add basic host mem functionality * Add switch for Host Memory Access and fix unittests for User Managed Kernels support * Revert timing changes for paper * Formatting changes * Remove unneccesary benchmark * Small changes * Clean up and update dependencies * Merge dev into paperVersion * Fix setting of Host Mem Var and update cppcheck config * Update CI definition * Fix typo in CI * Remove hardcoded path from examples * Fix linting for json files * Expand integrationTests * Update FPGA PCIe signatures * Increase timelimits of jobs * Switch CI partition to HACC for testing * Bump Graphviz version * Optimize CI * Fix integrationtest path * Update CI and add performance benchmark * Fix paths * Change logger and add exptected performance results to synchronous inference benchmark * Update expected results * Add missing path change * Add regression tests * Add test condition to regression test * Fix broken bash script in CI * Fix broken bash script in CI * Update dependencies in CI pipeline * Fix missing boost lib * Fix missing libs * Change number of processors to be correct and simplify regression tests * Fix typo in ci * Fix floating point comparison * Add debug print to CI * Add debug print to CI * Filter colored output * Filter colored output * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Update remove shipped boost version and merge main to dev (#18) * Merge dev into main for v1.2 release (#13) * Remove hardcoded batch size from kernel execution * Implement setBatchSize for complete Stack * Remove RingBuffer from Synchronous Inference and add full batch mapping * Deduplicate batchsize in basedriver & fix unittests * Fix integrationtests * Change input kernel code to run concurrrently to output kernel code * Optimize inference of lower batch sizes * Increase packing performance * Further optimize OpenMP * Optimize Utils * Some small changes * Add example data * Small Amounts of cleanup * Change Driver to run without XRT managed kernels * Add more efficient version of execute method * Hotfix FPGA bricking * Simplify inference interface to speed up inference * Update unittest * Simplify code * Update CMake * Fix Release Build CMakeLists * Fix wrong old variable names in CMake * Fix formatting * Change format target * Add changes to paper version * Add final paper changes * Add basic host mem functionality * Add switch for Host Memory Access and fix unittests for User Managed Kernels support * Revert timing changes for paper * Formatting changes * Remove unneccesary benchmark * Small changes * Clean up and update dependencies * Merge dev into paperVersion * Fix setting of Host Mem Var and update cppcheck config * Update CI definition * Fix typo in CI * Remove hardcoded path from examples * Fix linting for json files * Expand integrationTests * Update FPGA PCIe signatures * Increase timelimits of jobs * Switch CI partition to HACC for testing * Bump Graphviz version * Optimize CI * Fix integrationtest path * Update CI and add performance benchmark * Fix paths * Change logger and add exptected performance results to synchronous inference benchmark * Update expected results * Add missing path change * Add regression tests * Add test condition to regression test * Fix broken bash script in CI * Fix broken bash script in CI * Update dependencies in CI pipeline * Fix missing boost lib * Fix missing libs * Change number of processors to be correct and simplify regression tests * Fix typo in ci * Fix floating point comparison * Add debug print to CI * Add debug print to CI * Filter colored output * Filter colored output * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Update .gitlab-ci.yml * Pending changes exported from your codespace * Remove boost form being shipped with the driver * Update CI * Refactor build configuration: remove mdspan submodule, update CMakeLists for output directories, and enhance FINNDriver with static configuration check * update README.md * Format FinnDatatypes.hpp * Fix linting * Update src/FINNCppDriver/FINNDriver.cpp Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]> * Update src/FINNCppDriver/core/DeviceBuffer/DeviceBuffer.hpp Co-authored-by: Copilot <[email protected]> * Update src/FINNCppDriver/FINNDriver.cpp Co-authored-by: Copilot <[email protected]> * Update readme * Remove boost from the driver (#20) * Remove boost logging and program options * Add SPSCQueue * Remove Ringbuffer * Remove boost completely * Update CI * Fix linting * Add missing includes * Fix Integrationtests * Fix ODR * Fix bug where batch size is not set correctly * Fix linting * Update dependencies * Bump module versions * Update include files * Fix Async Inference * Add Asynchronous Inference option (#21) * Disable FPGA resets when running unittests * Finish async implementation * Update CI * Add missing header * Fix aligned alloc * Increase timeout * Linting and CI timeout * Increase CI timeout * Fix warnings * Add unused annotion * Add missing doxygen documentation * Merge branch 'main' into dev * Fix small details * Merge main into dev * Update README.md --------- Co-authored-by: Copilot <[email protected]>
1 parent 3e67e3d commit 1f6e4b2

Some content is hidden

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

59 files changed

+6315
-1574
lines changed

.gitlab-ci.yml

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ workflow:
1616

1717
.load-modules:
1818
before_script:
19-
- ml vis/Graphviz/8.1.0-GCCcore-12.3.0 fpga xilinx/xrt/2.16 devel/Doxygen/1.9.7-GCCcore-12.3.0 compiler/GCC/12.3.0 devel/CMake/3.26.3-GCCcore-12.3.0 devel/Boost/1.82.0-GCC-12.3.0
20-
21-
build-dependencies:
19+
- ml vis/Graphviz/8.1.0-GCCcore-12.3.0 fpga xilinx/xrt/2.16 devel/Doxygen/1.9.8-GCCcore-13.2.0 compiler/GCC/13.3.0 devel/CMake/3.29.3-GCCcore-13.3.0
20+
init-repo:
2221
id_tokens:
2322
CI_JOB_JWT:
2423
aud: https://git.uni-paderborn.de
2524
stage: prepare
2625
variables:
2726
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 2:00:00 -N 1 -n 1 --cpus-per-task=128"
28-
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 2:00:00"
27+
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 0:05:00"
2928
extends: .load-modules
3029
script:
31-
- ./buildDependencies.sh
30+
- git submodule update --init --recursive
3231
artifacts:
3332
paths:
3433
- "deps/"
@@ -40,7 +39,7 @@ build-unittests:
4039
aud: https://git.uni-paderborn.de
4140
stage: build
4241
needs:
43-
- build-dependencies
42+
- init-repo
4443
variables:
4544
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 2:00:00 -N 1 -n 1 --cpus-per-task=128"
4645
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 2:00:00"
@@ -60,7 +59,7 @@ build-integrationtests:
6059
aud: https://git.uni-paderborn.de
6160
stage: build
6261
needs:
63-
- build-dependencies
62+
- init-repo
6463
variables:
6564
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 2:00:00 -N 1 -n 1 --cpus-per-task=128"
6665
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 2:00:00"
@@ -85,7 +84,7 @@ build-regressiontests:
8584
aud: https://git.uni-paderborn.de
8685
stage: build
8786
needs:
88-
- build-dependencies
87+
- init-repo
8988
variables:
9089
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 2:00:00 -N 1 -n 1 --cpus-per-task=128"
9190
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 2:00:00"
@@ -122,13 +121,13 @@ run-unittests:
122121
stage: test
123122
needs:
124123
- build-unittests
125-
- build-dependencies
124+
- init-repo
126125
variables:
127126
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 0:30:00 -N 1 -n 1 --cpus-per-task=2 --mem-per-cpu=2G"
128127
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 2:00:00"
129128
extends: .load-modules
130129
script:
131-
- export LD_LIBRARY_PATH="$(pwd)/deps/finn_boost/stage/lib/boost/:$LD_LIBRARY_PATH"
130+
- export LD_LIBRARY_PATH="$(pwd)/build/libs:$LD_LIBRARY_PATH"
132131
- cd build
133132
- ctest --output-on-failure --output-junit ctest-results.xml
134133
artifacts:
@@ -146,12 +145,12 @@ run-integrationtests:
146145
stage: test
147146
needs:
148147
- build-integrationtests
149-
- build-dependencies
148+
- init-repo
150149
variables:
151150
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 0:30:00"
152151
extends: .load-modules
153152
script:
154-
- export LD_LIBRARY_PATH="$(pwd)/deps/finn_boost/stage/lib/boost/:$LD_LIBRARY_PATH"
153+
- export LD_LIBRARY_PATH="$(pwd)/build/libs:$LD_LIBRARY_PATH"
155154
# Reset FPGAs and setup Host Memory Access
156155
- ml xilinx/u55c/u55c_gen3x16_xdma_3_202210_1
157156
- xbutil reset -d 0000:c1:00.1
@@ -165,6 +164,7 @@ run-integrationtests:
165164
# Test Synchronous Inference with Host memory
166165
- cp ../../example_networks/jet-structure-classification-with-host-mem/* .
167166
- ./SyncInference
167+
- ./AsyncInference
168168

169169
# Reset FPGAs again
170170
- xbutil reset -d 0000:c1:00.1
@@ -174,8 +174,7 @@ run-integrationtests:
174174
- cd ../../build-no-host-mem/integrationtest
175175
- cp ../../example_networks/jet-structure-classification-without-host-mem/* .
176176
- ./SyncInference
177-
178-
# TODO: Run regression tests + asynchronous inference
177+
- ./AsyncInference
179178

180179
run-regressiontests:
181180
id_tokens:
@@ -184,13 +183,13 @@ run-regressiontests:
184183
stage: test
185184
needs:
186185
- build-regressiontests
187-
- build-dependencies
186+
- init-repo
188187
variables:
189188
#SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p normal -t 0:30:00 -N 1 -n 1 --cpus-per-task=2 --mem-per-cpu=2G"
190-
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 0:30:00"
189+
SCHEDULER_PARAMETERS: "-A hpc-prf-ekiapp -p hacc -t 10:00:00"
191190
extends: .load-modules
192191
script:
193-
- export LD_LIBRARY_PATH="$(pwd)/deps/finn_boost/stage/lib/boost/:$LD_LIBRARY_PATH"
192+
- export LD_LIBRARY_PATH="$(pwd)/build/libs:$LD_LIBRARY_PATH"
194193
# Reset FPGAs and setup Host Memory Access
195194
- ml xilinx/u55c/u55c_gen3x16_xdma_3_202210_1
196195
- xbutil reset -d 0000:c1:00.1
@@ -202,7 +201,7 @@ run-regressiontests:
202201

203202
- cd build/benchmarks
204203
- cp ../../example_networks/jet-structure-classification-with-host-mem/* .
205-
- ../_deps/googlebenchmark-src/tools/compare.py -a -d results.json benchmarks ../../benchmarks/expectedPerformance.json ./SynchronousInferenceBenchmark | tee benchmark_output.txt
204+
- ../_deps/googlebenchmark-src/tools/compare.py -a -d results.json benchmarks ../../benchmarks/expectedPerformance.json ./RegressionTest | tee benchmark_output.txt
206205
# Extract the OVERALL_GEOMEAN p-value and check if it exceeds the threshold
207206
- THRESHOLD=0.05
208207
- GEOMEAN=$(grep "OVERALL_GEOMEAN" benchmark_output.txt)

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,9 @@
1010
[submodule "external/xsimd"]
1111
path = external/xsimd
1212
url = https://github.com/xtensor-stack/xsimd.git
13+
[submodule "external/popl"]
14+
path = external/popl
15+
url = https://github.com/badaix/popl.git
16+
[submodule "external/plog"]
17+
path = external/plog
18+
url = https://github.com/SergiusTheBest/plog.git

CMakeLists.txt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ set(BENCHMARK_ENABLE_TESTING OFF)
4444
include(cmake/CheckSubmodules.cmake)
4545

4646
# Doxygen
47-
4847
if (CMAKE_BUILD_TYPE STREQUAL "Release")
4948
option(FINN_BUILD_DOC "Build documentation" ON)
5049
else()
@@ -72,14 +71,6 @@ endif()
7271

7372
#INCLUDES
7473

75-
#Set Boost policies for compatibility
76-
if(POLICY CMP0167)
77-
cmake_policy(SET CMP0167 OLD)
78-
endif()
79-
if(POLICY CMP0144)
80-
cmake_policy(SET CMP0144 NEW)
81-
endif()
82-
8374
#Threads
8475
set(THREADS_PREFER_PTHREAD_FLAG ON)
8576
find_package(Threads REQUIRED)
@@ -92,8 +83,11 @@ find_package(XRT REQUIRED)
9283
#OpenMP
9384
find_package(OpenMP REQUIRED)
9485

95-
#Boost
96-
find_package(Boost 1.79.0 COMPONENTS system log log_setup program_options filesystem ${BOOST_THREAD} REQUIRED)
86+
#popl
87+
include_directories(SYSTEM external/popl/include)
88+
89+
#plog
90+
include_directories(SYSTEM external/plog/include)
9791

9892
#xsimd
9993
add_subdirectory(external/xsimd)

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,20 @@ FINN+ on the other hand will configure and build the driver for you completely a
1919

2020
### Using the driver
2121

22+
You can either use the driver as a standalone executable or as a library. For the use of the C++ driver as a library, please have a look at the section for [library use](#using-the-driver-as-a-library).
23+
If you just want to use the C++ driver for FINN as an alternative for the default PYNQ driver, it is now possible to directly generate the C++ driver and all of its configutation files from [FINN](https://github.com/Xilinx/finn) and [FINN+](https://github.com/eki-project/finn-plus)!
24+
25+
Just select `build_cfg.DataflowOutputType.CPP_DRIVER` instead of `build_cfg.DataflowOutputType.PYNQ_DRIVER` in your build script in `generate_outputs`.
26+
27+
FINN will then generate all config files for you. For FINN it is then necessary to build the driver yourself. See section [Building the Driver](#building-the-driver).
28+
29+
FINN+ on the other hand will configure and build the driver for you completely automatically. We would therefore recommend using FINN+ instead of standard FINN.
30+
31+
### Using the driver
32+
2233
You can either use the driver as a standalone executable or as a library. For the use of the C++ driver as a library, please have a look at the section for [library use](#using-the-driver-as-a-library).
2334

24-
If you ever need help on which arguments the driver requires, simply use the ```--help``` flag on the driver.
35+
If you ever need help on which arguments the driver requires, simply use the ```--help``` flag on the driver. The executable for the driver is, by default, located in the `build/bin` folder after compiling the driver.
2536

2637
The following options are supported by the C++ driver executable to match the PYNQ driver:
2738

@@ -37,7 +48,7 @@ Options:
3748
--check Outputs the compile time configuration
3849
```
3950

40-
If the execution of the C++ driver fails due to missing libraries such as `libfinnc_core.so`, it might be necessary to set the `LD_LIBRARY_PATH` environment variable:
51+
If the execution of the C++ driver fails due to missing libraries such as `libfinn_core.so`, it might be necessary to set the `LD_LIBRARY_PATH` environment variable:
4152

4253
```bash
4354
export LD_LIBRARY_PATH="$(pwd)/build/libs:$LD_LIBRARY_PATH"
@@ -51,7 +62,6 @@ export LD_LIBRARY_PATH="$(pwd)/build/libs:$LD_LIBRARY_PATH"
5162

5263
* Install XRT Runtime and development packages. You can find them here: [Download](https://www.xilinx.com/support/download/index.html/content/xilinx/en/downloadNav/alveo/u280.html)
5364
* If you use a non default install directory for XRT (default: ```/opt/xilinx/xrt```) set the XRT env var to your XRT development package installation ```export XILINX_XRT=<path>```.
54-
* Additionally, an installation of boost>=1.79.0 is required. You can install it on debian based sytems using `sudo apt install libboost-all-dev`
5565

5666
**General information for building and using the C++ driver**:
5767

@@ -72,7 +82,7 @@ It is assumed, that you used FINN and now want to build the generated driver. Co
7282
Building the driver is as easy as running:
7383

7484
```bash
75-
./buildDependencies.sh
85+
git submodule update --init --recursive
7686
mkdir build && cd build
7787
cmake -DCMAKE_BUILD_TYPE=Release -DFINN_ENABLE_SANITIZERS=OFF -DFINN_HEADER_LOCATION=../AcceleratorDatatypes.h -DFINN_USE_HOST_MEM=OFF ..
7888
make -j $(nprocs)
@@ -107,7 +117,7 @@ If left undefined, the path will be ```../../src/config/exampleConfig.json``` (a
107117
You will first have to load a few dependencies before being able to build the project:
108118

109119
```bash
110-
ml compiler/GCCcore/11.3.0 compiler/GCC/11.3.0 lib/pybind11/2.9.2-GCCcore-11.3.0 devel/Boost/1.79.0-GCC-11.3.0 lib/fmt/9.1.0-GCCcore-11.3.0
120+
ml compiler/GCCcore/11.3.0 compiler/GCC/11.3.0 lib/pybind11/2.9.2-GCCcore-11.3.0 lib/fmt/9.1.0-GCCcore-11.3.0
111121
ml devel Autoconf/2.71-GCCcore-11.3.0
112122
ml lang Bison/3.8.2-GCCcore-11.3.0 flex/2.6.4-GCCcore-11.3.0
113123
ml fpga xilinx/xrt/2.14
@@ -123,7 +133,7 @@ To execute the driver on the boards, write a job script. The job script should l
123133
#SBATCH -o cpp-finn_out_%j.out
124134
#SBATCH --constraint=xilinx_u280_xrt2.14
125135

126-
ml compiler/GCCcore/11.3.0 compiler/GCC/11.3.0 lib/pybind11/2.9.2-GCCcore-11.3.0 devel/Boost/1.79.0-GCC-11.3.0 lib/fmt/9.1.0-GCCcore-11.3.0
136+
ml compiler/GCCcore/11.3.0 compiler/GCC/11.3.0 lib/pybind11/2.9.2-GCCcore-11.3.0 lib/fmt/9.1.0-GCCcore-11.3.0
127137
ml devel Autoconf/2.71-GCCcore-11.3.0
128138
ml lang Bison/3.8.2-GCCcore-11.3.0 flex/2.6.4-GCCcore-11.3.0
129139
ml fpga xilinx/xrt/2.14
@@ -148,8 +158,8 @@ add_subdirectory(external/finn-cpp-driver)
148158
#Link an example application against the finn driver
149159
add_executable(example example.cpp)
150160
target_include_directories(example SYSTEM PRIVATE ${XRT_INCLUDE_DIRS} ${FINN_SRC_DIR})
151-
target_link_directories(example PRIVATE ${XRT_LIB_CORE_LOCATION} ${XRT_LIB_OCL_LOCATION} ${BOOST_LIBRARYDIR})
152-
target_link_libraries(example PRIVATE finnc_core finnc_options Threads::Threads OpenCL xrt_coreutil uuid finnc_utils finn_config ${Boost_LIBRARIES} nlohmann_json::nlohmann_json OpenMP::OpenMP_CXX)
161+
target_link_directories(example PRIVATE ${XRT_LIB_CORE_LOCATION} ${XRT_LIB_OCL_LOCATION})
162+
target_link_libraries(example PRIVATE finnc_core finnc_options Threads::Threads OpenCL xrt_coreutil uuid finnc_utils finn_config nlohmann_json::nlohmann_json OpenMP::OpenMP_CXX)
153163
```
154164

155165
### Known Issues

0 commit comments

Comments
 (0)