Skip to content
Open
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a82b43f
refactor: clean cmake architecture and external deps
allnes Feb 5, 2026
481a688
chore: drop redundant comment in perf cmake
allnes Feb 5, 2026
3749b9f
chore: remove redundant note in test cmake
allnes Feb 5, 2026
6d64a63
style: wrap perf benchmarking lines
allnes Feb 5, 2026
ab529f9
fix: multi-config imports for external deps
allnes Feb 5, 2026
70b4db8
ci: fetch test data in all presets
allnes Feb 5, 2026
b509f49
ci: ensure test data & openmp flags
allnes Feb 5, 2026
886750f
build: apply OpenMP flags to targets only
allnes Feb 5, 2026
3187625
Fix MSVC external deps build
allnes Feb 6, 2026
09722f1
Make presets compiler-agnostic and align external deps
allnes Feb 6, 2026
5777222
Disable warnings-as-errors for external projects
allnes Feb 6, 2026
6e96609
Make tests self-contained and copy runtime DLLs
allnes Feb 6, 2026
9513353
build: fix external builds and OpenMP linkage
allnes Feb 6, 2026
8fdff9c
refactor: isolate third-party and simplify cmake
allnes Feb 6, 2026
098a95c
build: auto-glob sources in cmake
allnes Feb 6, 2026
3256e78
refactor: standardize cmake target naming
allnes Feb 6, 2026
2ed8dbc
chore: rename unit test binary
allnes Feb 6, 2026
521f06d
cmake: simplify external project wiring
allnes Feb 6, 2026
d1639aa
ci: sync workflows with upstream and new binary name
allnes Feb 6, 2026
8e24def
ci: align artifact packaging with external deps
allnes Feb 6, 2026
195d89d
ci: fetch test data in all build jobs
allnes Feb 6, 2026
4dce952
revert: restore app, include, src, test, README to upstream
allnes Feb 6, 2026
f5ac779
docs: restore cmake-related README updates
allnes Feb 6, 2026
667537b
fix: silence unused option in omp fallback
allnes Feb 6, 2026
78c1204
revert: restore sources and headers to upstream
allnes Feb 6, 2026
1346a68
revert: sync sources and tests to upstream/main
allnes Feb 6, 2026
c4e0adc
chore: drop stray onednn test files
allnes Feb 6, 2026
2bef137
revert: drop parallel backend tweak
allnes Feb 6, 2026
06bf5db
docs: keep cmake-related readme content
allnes Feb 6, 2026
e501f2e
refactor: update cmake build and fix omp warning
allnes Feb 6, 2026
ea94ea0
Fix indentation in CI workflow for artifact upload
allnes Feb 6, 2026
4021267
ci: fix TBB debug link and fetch test data
allnes Feb 10, 2026
4bc9639
ci: rely on cmake default test-data fetch
allnes Feb 11, 2026
851d617
build: normalize executable names and sync docs/ci
allnes Feb 11, 2026
f2a4802
ci: limit codecov upload and clean cmake comment
allnes Feb 11, 2026
1e7bb37
test: restore onednn reduce test path
allnes Feb 11, 2026
756d1cf
build: remove unused internal cmake flags and fix ctest registration
allnes Feb 11, 2026
91d43d8
build: remove system deps mode and enforce vendored third-party
allnes Feb 11, 2026
2c7a564
cmake: simplify dependency wiring and validate debug/release builds
allnes Feb 11, 2026
c008bc6
cmake: modernize config architecture and align ci presets
allnes Feb 11, 2026
7807116
cmake: harden package config and align ci execution
allnes Feb 11, 2026
f89621b
ci: isolate ExternalProject installs and fix clang build
allnes Feb 12, 2026
483dacf
Merge branch 'main' into cmake-arch-cleanup
allnes Feb 12, 2026
2ddaa75
fix(tests): remove valgrind false positives in gtest params
allnes Feb 12, 2026
09e3ed9
ci: run perf tests in separate daily workflow
allnes Feb 12, 2026
e6c49b5
build(cmake): remove dead files, normalize presets, and move test dat…
allnes Feb 13, 2026
f596e65
build(cmake): bundle third-party deps into exported package
allnes Feb 13, 2026
90b3f63
build(cmake): add exported target aliases and prefer TBB::tbb
allnes Feb 13, 2026
647a2d0
build(cmake): standardize option/alias naming and simplify subdir CMa…
allnes Feb 13, 2026
ee494d3
build(cmake): split root configuration into focused modules
allnes Feb 13, 2026
371e8be
build(cmake): simplify deps wiring and remove unnecessary helper modules
allnes Feb 13, 2026
4ff4b5f
build(cmake): remove conditional deps and align CI presets
allnes Feb 13, 2026
013421c
ci: add package smoke test for Release preset
allnes Feb 13, 2026
54f8d9a
ci: run full ctest suite like main (valgrind stays unit-only)
allnes Feb 13, 2026
b66c92b
ci: keep main workflow, fix artifact paths
allnes Feb 13, 2026
7058586
cmake: ensure externals build before consumers
allnes Feb 13, 2026
236dc9a
cmake: simplify target wiring (no externals helper)
allnes Feb 13, 2026
55726a1
cmake: make defaults lightweight (features/openmp + global rpath)
allnes Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 57 additions & 53 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ jobs:
strategy:
matrix:
include:
- build_type: DEBUG
- build_type: RELEASE
stats: false
- build_type: RELEASE
stats: true
- preset: dev-debug
build_dir: build/debug
artifact_name: DEBUG
- preset: dev-release
build_dir: build/release
artifact_name: RELEASE
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why are they dev-debug and dev-release and not just debug and release?

- preset: ci-stats
build_dir: build/ci-stats
artifact_name: RELEASE-stats
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -32,48 +36,41 @@ jobs:
- name: Set binary paths
id: set_binaries
run: |
echo "ACC_BINARY=build/bin/ACC" >> $GITHUB_OUTPUT
echo "ACC_BINARY=${{ matrix.build_dir }}/bin/itlabai_acc" >> $GITHUB_OUTPUT
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}-${{ matrix.build_type }}
key: ccache-${{ github.job }}-${{ matrix.preset }}
max-size: 2G
- name: Build
run: |
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DOPENCV_PATH=build/3rdparty/opencv_build \
${{ matrix.stats && '-DENABLE_STATISTIC_TENSORS=ON' || '' }} \
${{ matrix.stats && '-DENABLE_STATISTIC_TIME=ON' || '' }} \
${{ matrix.stats && '-DENABLE_STATISTIC_WEIGHTS=ON' || '' }}
cmake --build build --parallel
cmake --preset ${{ matrix.preset }} \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset ${{ matrix.preset }} --parallel
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Prepare ALL libs
run: |
mkdir -p build/bin/all_libs
cp -a build/3rdparty/opencv_build/lib/* build/bin/all_libs/ 2>/dev/null || true
ldd build/bin/ACC | grep "=> /" | awk '{print $3}' | xargs -I {} cp {} build/bin/all_libs/ 2>/dev/null || true
mkdir -p ${{ matrix.build_dir }}/bin/all_libs
find ${{ matrix.build_dir }}/_external/install -type f \( -name "*.so" -o -name "*.so.*" -o -name "*.dylib" \) -exec cp {} ${{ matrix.build_dir }}/bin/all_libs/ \; 2>/dev/null || true
ldd ${{ matrix.build_dir }}/bin/itlabai_acc | grep "=> /" | awk '{print $3}' | xargs -I {} cp {} ${{ matrix.build_dir }}/bin/all_libs/ 2>/dev/null || true
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Consider simplifying it

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mnist-${{ matrix.build_type }}${{ matrix.stats && '-stats' || '' }}
name: mnist-${{ matrix.artifact_name }}
path: |
${{ steps.set_binaries.outputs.ACC_BINARY }}
build/bin/all_libs/*
build/bin/opencv_libs/*
build/setenv.sh
${{ matrix.build_dir }}/bin/all_libs/*
- name: Test
run: cmake --build build -t test
run: ctest --preset ${{ matrix.preset }} --output-on-failure -L unit
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Test (valgrind)
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind cmake --build build -t test
valgrind --error-exitcode=1 ${{ matrix.build_dir }}/bin/itlabai_run_test --gtest_filter=-convlayer_parall.*
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add TODO to re-enable the tests

env:
CTEST_OUTPUT_ON_FAILURE: 1
build-linux-clang:
Expand All @@ -91,21 +88,21 @@ jobs:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build -G Ninja \
cmake --preset dev-release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang \
-DCMAKE_CXX_COMPILER=clang++
cmake --build build --parallel
cmake --build --preset dev-release --parallel
- name: Test
run: cmake --build build -t test
run: ctest --preset dev-release --output-on-failure -L unit
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Test (valgrind)
run: |
sudo apt-get update
sudo apt-get install -y valgrind
valgrind cmake --build build -t test
valgrind --error-exitcode=1 build/release/bin/itlabai_run_test --gtest_filter=-convlayer_parall.*
env:
CTEST_OUTPUT_ON_FAILURE: 1
build-macos:
Expand All @@ -126,7 +123,7 @@ jobs:
run: |
OPENMP_PATH=$(brew --prefix libomp)
echo "OpenMP path: $OPENMP_PATH"
cmake -S . -B build -G Ninja \
cmake --preset dev-release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_PREFIX_PATH=$OPENMP_PATH \
Expand All @@ -139,12 +136,12 @@ jobs:
-DOpenMP_omp_LIBRARY="$OPENMP_PATH/lib/libomp.dylib" \
-DCMAKE_EXE_LINKER_FLAGS="-L$OPENMP_PATH/lib -lomp" \
-DCMAKE_SHARED_LINKER_FLAGS="-L$OPENMP_PATH/lib -lomp"
cmake --build build --parallel
cmake --build --preset dev-release --parallel
env:
LDFLAGS: "-L$(brew --prefix libomp)/lib -lomp"
CPPFLAGS: "-I$(brew --prefix libomp)/include"
- name: Test
run: cmake --build build -t test
run: ctest --preset dev-release --output-on-failure -L unit
env:
CTEST_OUTPUT_ON_FAILURE: 1
build-windows:
Expand All @@ -167,12 +164,10 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1
- name: Build
run: |
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel --config Release
cmake --preset dev-release -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset dev-release --parallel --config Release
- name: Test
run: |
cd build
ctest --output-on-failure
run: ctest --preset dev-release --output-on-failure -L unit
build-linux-arm64:
runs-on: ubuntu-24.04-arm
steps:
Expand All @@ -187,12 +182,11 @@ jobs:
key: ccache-${{ github.job }}
- name: Build and Test
run: |
cmake -S . -B build -G Ninja \
cmake --preset dev-release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel
cmake --build build -t test
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset dev-release --parallel
ctest --preset dev-release --output-on-failure -L unit
env:
CTEST_OUTPUT_ON_FAILURE: 1
codecov:
Expand All @@ -206,19 +200,16 @@ jobs:
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}-${{ matrix.build_type }}
key: ccache-${{ github.job }}
max-size: 2G
- name: Build
run: |
cmake -S . -B build -G Ninja \
cmake --preset coverage \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="--coverage" \
-DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build --parallel
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset coverage --parallel
- name: Test
run: cmake --build build -t test
run: ctest --preset coverage --output-on-failure -L unit
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Generate Coverage Data
Expand All @@ -228,6 +219,8 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: embedded-dev-research/ITLabAI
files: coverage.xml
disable_search: true

evaluate-model:
runs-on: ubuntu-latest
Expand All @@ -249,7 +242,12 @@ jobs:
- name: Set binary path
id: set_eval_binary
run: |
echo "EVAL_BINARY=build/bin/ACC" >> $GITHUB_OUTPUT
EVAL_BINARY=$(find build -type f -name itlabai_acc | head -n1)
if [ -z "$EVAL_BINARY" ]; then
echo "Failed to locate itlabai_acc in downloaded artifact"
exit 1
fi
echo "EVAL_BINARY=$EVAL_BINARY" >> $GITHUB_OUTPUT

- name: Install system dependencies
run: |
Expand Down Expand Up @@ -284,12 +282,18 @@ jobs:

- name: Prepare environment
run: |
LIB_DIR=$(find build -type d -name all_libs | head -n1)
if [ -z "$LIB_DIR" ]; then
echo "Failed to locate all_libs directory in downloaded artifact"
exit 1
fi
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please, remove

chmod +x "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}"
export LD_LIBRARY_PATH=$PWD/build/bin/all_libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$PWD/$LIB_DIR:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH

- name: Run evaluation
run: |
export LD_LIBRARY_PATH=$PWD/build/bin/all_libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
LIB_DIR=$(find build -type d -name all_libs | head -n1)
export LD_LIBRARY_PATH=$PWD/$LIB_DIR:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This should be simplified

"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --model alexnet_mnist > accuracy.txt 2>&1
if [ $? -ne 0 ]; then
exit 1
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/perf-daily.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Perf Daily
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need it?


on:
schedule:
- cron: '0 8 * * *'
workflow_dispatch:

jobs:
perf-daily-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake --preset dev-release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
cmake --build --preset dev-release --parallel
- name: Run Perf Tests
run: ctest --preset dev-release --output-on-failure -L perf
env:
CTEST_OUTPUT_ON_FAILURE: 1
111 changes: 43 additions & 68 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,86 +1,61 @@
cmake_minimum_required(VERSION 3.20)

project(ITLabAI)
project(ITLabAI VERSION 0.1.0 LANGUAGES CXX)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/ProjectDefaults.cmake)

set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type" FORCE)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Options.cmake)

option(ENABLE_STATISTIC_TENSORS "Enable statistic tensors" OFF)

if(ENABLE_STATISTIC_TENSORS)
add_definitions(-DENABLE_STATISTIC_TENSORS)
endif()

option(ENABLE_STATISTIC_TIME "Enable statistic time" OFF)

if(ENABLE_STATISTIC_TIME)
add_definitions(-DENABLE_STATISTIC_TIME)
endif()

option(ENABLE_STATISTIC_WEIGHTS "Enable statistic weights" OFF)

if(ENABLE_STATISTIC_WEIGHTS)
add_definitions(-DENABLE_STATISTIC_WEIGHTS)
if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why do we check for CMAKE_CONFIGURATION_TYPES?

set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?


enable_testing()

find_package(OpenMP REQUIRED)

if(OpenMP_FOUND)
message(STATUS "OpenMP found - enabling parallel support")
add_definitions(-DHAS_OPENMP)
link_libraries(OpenMP::OpenMP_CXX)
else()
message(STATUS "OpenMP not found - parallel features disabled")
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/Features.cmake)

include_directories("include")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")

list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/TargetsCommon.cmake)

add_subdirectory(3rdparty)
# External dependencies
include(cmake/deps.cmake)

include(cmake/opencv_config.cmake)
include(cmake/kokkos_config.cmake)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/TestData.cmake)

include_directories("${KOKKOS_INSTALL_DIR}/include")
add_subdirectory(src)
if(ITLABAI_BUILD_APPS)
add_subdirectory(app)
endif()
if(BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()

add_library(Kokkos_imported INTERFACE)
add_dependencies(Kokkos_imported kokkos_external)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/InTreeAliases.cmake)

target_include_directories(Kokkos_imported INTERFACE
"${KOKKOS_INSTALL_DIR}/include"
# Aggregate interface target
if(NOT TARGET itlabai)
add_library(itlabai INTERFACE)
add_library(ITLabAI::itlabai ALIAS itlabai)
endif()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is that? Aggregates are an overkill in all the cases for such a small lib

target_include_directories(itlabai INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_directories(Kokkos_imported INTERFACE
"${KOKKOS_INSTALL_DIR}/lib"
target_link_libraries(itlabai INTERFACE itlabai_options)

# Install/export
target_link_libraries(itlabai INTERFACE
itlabai_graph_lib
itlabai_graph_transformations_lib
itlabai_layers_lib
itlabai_layers_onednn_lib
itlabai_perf_lib
itlabai_reader_lib
)


target_link_libraries(Kokkos_imported INTERFACE kokkoscore kokkoscontainers)


if(MSVC)
add_compile_options(/wd4267 /wd4244 /wd4127 /wd4324)
endif()

if (NOT WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4 /wd4996 /wd4190 /wd4189 /WX")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4996 /wd4190 /wd4189 /WX")
endif()

foreach(CONFIG "" _DEBUG _RELEASE)
set("CMAKE_ARCHIVE_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/lib")
set("CMAKE_LIBRARY_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/lib")
set("CMAKE_RUNTIME_OUTPUT_DIRECTORY${CONFIG}" "${CMAKE_BINARY_DIR}/bin")
endforeach()

add_subdirectory(app)
add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(test)
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Packaging.cmake")
Loading
Loading