Skip to content

Conversation

@LinusJungemann
Copy link
Member

No description provided.

@LinusJungemann LinusJungemann requested a review from Copilot June 26, 2025 13:30
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes dependencies on Boost logging and the Boost-based ring buffer by introducing a PLog-based logger, replacing RingBuffer with SPSCQueue, and updating various size APIs to get… accessors.

  • Swap out Logger.h (Boost) for Logger.hpp (PLog) and update all FINN_LOG calls.
  • Replace custom RingBuffer with SPSCQueue for asynchronous buffers.
  • Deprecate size(SIZE_SPECIFIER) methods in favor of getSizeInBytes, getFeatureMapSize, etc.

Reviewed Changes

Copilot reviewed 50 out of 53 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/FINNCppDriver/utils/Logger.hpp Switched from Boost.Log to PLog and updated macros
src/FINNCppDriver/utils/SPSCQueue.hpp Added lock-free SPSCQueue implementation
src/FINNCppDriver/utils/RingBuffer.hpp Removed Boost-based RingBuffer entirely
src/FINNCppDriver/core/… Updated size(...) methods to get… accessors
unittests/utils/SPSCQueueTest.cpp Added tests for the new SPSCQueue
unittests/** Updated includes and logging calls in mocks and tests

#include <type_traits>
#include <vector>

using namespace std::literals::chrono_literals;
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid 'using namespace' directives in header files to prevent namespace pollution; consider qualifying chrono literals in implementation files or using declarations locally in source files.

Suggested change
using namespace std::literals::chrono_literals;
// Removed 'using namespace std::literals::chrono_literals;' to avoid namespace pollution.

Copilot uses AI. Check for mistakes.
Comment on lines 13 to 14
#ifndef LOGGING_H
#define LOGGING_H
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The header guard LOGGING_H is generic and may collide with other libraries; consider renaming it to LOGGER_HPP or using a project-specific prefix.

Suggested change
#ifndef LOGGING_H
#define LOGGING_H
#ifndef FINN_LOGGER_HPP
#define FINN_LOGGER_HPP

Copilot uses AI. Check for mistakes.
Comment on lines 33 to +41
template<typename T>
class AsyncBufferWrapper {
protected:
constexpr static size_t queueSize = 1024; ///< Default size of the internal queue
/**
* @brief Internal Ringbuffer used by all asynchronous buffers
* @brief Internal queue used by all asynchronous buffers
*
*/
RingBuffer<T, true> ringBuffer;
SPSCQueue<T, queueSize> queue;
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Hardcoding a default queue size may lead to warnings or dropped data if the expected workload exceeds 1024 elements; consider making the queue capacity configurable or exposing it as a template parameter.

Copilot uses AI. Check for mistakes.
@LinusJungemann LinusJungemann merged commit 9f45dbc into dev Jun 26, 2025
1 check passed
LinusJungemann added a commit that referenced this pull request Jul 24, 2025
* 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 <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/FINNCppDriver/core/DeviceBuffer/DeviceBuffer.hpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update src/FINNCppDriver/FINNDriver.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* 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 <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants