Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
cdcc047
add submodule
Semyon1104 Oct 21, 2025
a514899
add EWLayer_oneDNN
Semyon1104 Oct 22, 2025
1b844c2
Update .gitmodules
Semyon1104 Oct 22, 2025
499ed46
fix
Semyon1104 Oct 22, 2025
9a6af4b
clang
Semyon1104 Oct 22, 2025
d86e1c1
Update ci.yml
Semyon1104 Oct 22, 2025
00d79bb
fix unused
Semyon1104 Oct 22, 2025
b3cdf0c
fix cmake, default with err
Semyon1104 Oct 23, 2025
b57dba8
Update ci.yml
Semyon1104 Oct 23, 2025
d09f86f
fix parallel in cmake
Semyon1104 Oct 28, 2025
96ccc43
Update ci.yml
Semyon1104 Oct 28, 2025
60f5e61
fix parallel in cmake
Semyon1104 Oct 28, 2025
7d2afb5
fix parallel in cmake
Semyon1104 Oct 28, 2025
2ac1d8f
fix parallel in cmake
Semyon1104 Oct 28, 2025
b252d6c
fix parallel in cmake
Semyon1104 Oct 28, 2025
9e879fe
Update ci.yml
Semyon1104 Oct 28, 2025
09099ac
fix parallel in cmake
Semyon1104 Oct 28, 2025
38f4588
Update ci.yml
Semyon1104 Oct 28, 2025
a44af97
fix parallel in cmake
Semyon1104 Oct 28, 2025
9e16ac0
Merge branch 'Semyon1104/IntegrateOneDNN' of https://github.com/embed…
Semyon1104 Oct 28, 2025
24d7e52
Update ci.yml
Semyon1104 Oct 28, 2025
9393e7b
Update ci.yml
Semyon1104 Oct 28, 2025
070a477
fix parallel in cmake
Semyon1104 Oct 28, 2025
d00b0d4
fix parallel in cmake
Semyon1104 Oct 28, 2025
1fbb7cf
Update static-analysis.yml
Semyon1104 Oct 28, 2025
cfa6aea
Update ci.yml
Semyon1104 Oct 29, 2025
4e56912
check evaluate
Semyon1104 Oct 29, 2025
8cb7a2c
Update ci.yml
Semyon1104 Oct 29, 2025
920a377
analisys, add int
Semyon1104 Oct 29, 2025
c0def70
Merge branch 'Semyon1104/IntegrateOneDNN' of https://github.com/embed…
Semyon1104 Oct 29, 2025
0352eb9
check evaluate
Semyon1104 Oct 29, 2025
afbf56b
add tests
Semyon1104 Oct 29, 2025
d660ff5
Merge branch 'Semyon1104/IntegrateOneDNN' of https://github.com/embed…
Semyon1104 Oct 29, 2025
89ef1ae
fix
Semyon1104 Oct 29, 2025
cc68ec8
clean ci.yml
Semyon1104 Oct 29, 2025
a4ce91e
rename files
Semyon1104 Oct 29, 2025
cfd1d58
Merge branch 'Semyon1104/IntegrateOneDNN' of https://github.com/embed…
Semyon1104 Oct 29, 2025
3566fd4
try macos
Semyon1104 Oct 29, 2025
c6ac48e
macos
Semyon1104 Oct 29, 2025
24a4934
clean
Semyon1104 Nov 2, 2025
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
124 changes: 55 additions & 69 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
max-size: 2G
- name: Build
run: |
cmake -S . -B build \
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
Expand All @@ -51,19 +51,18 @@ jobs:
cmake --build build --parallel
env:
CTEST_OUTPUT_ON_FAILURE: 1
- name: Prepare OpenCV libs
- name: Prepare ALL libs
run: |
mkdir -p build/bin/opencv_libs
cp -a build/3rdparty/opencv_build/lib/libopencv_* build/bin/opencv_libs/
echo "Library permissions after copy:"
stat -c "%A %n" build/bin/opencv_libs/libopencv_imgcodecs.so*

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
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mnist-${{ matrix.build_type }}${{ matrix.stats && '-stats' || '' }}
path: |
${{ steps.set_binaries.outputs.ACC_BINARY }}
build/bin/all_libs/*
build/bin/opencv_libs/*
build/setenv.sh
- name: Test
Expand Down Expand Up @@ -92,7 +91,7 @@ jobs:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build \
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang \
Expand All @@ -117,20 +116,33 @@ jobs:
submodules: true
- name: Install prerequisites
run: |
brew install libomp
brew install libomp ninja
brew link libomp --overwrite --force
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build \
OPENMP_PATH=$(brew --prefix libomp)
echo "OpenMP path: $OPENMP_PATH"
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="-I$(brew --prefix libomp)/include" \
-DCMAKE_CXX_FLAGS="-I$(brew --prefix libomp)/include"
-DCMAKE_PREFIX_PATH=$OPENMP_PATH \
-DCMAKE_INCLUDE_PATH=$OPENMP_PATH/include \
-DCMAKE_LIBRARY_PATH=$OPENMP_PATH/lib \
-DOpenMP_C_FLAGS="-Xclang -fopenmp -I$OPENMP_PATH/include" \
-DOpenMP_CXX_FLAGS="-Xclang -fopenmp -I$OPENMP_PATH/include" \
-DOpenMP_C_LIB_NAMES="omp" \
-DOpenMP_CXX_LIB_NAMES="omp" \
-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
env:
LDFLAGS: "-L$(brew --prefix libomp)/lib -lomp"
CPPFLAGS: "-I$(brew --prefix libomp)/include"
- name: Test
run: cmake --build build -t test
env:
Expand Down Expand Up @@ -175,7 +187,7 @@ jobs:
key: ccache-${{ github.job }}
- name: Build and Test
run: |
cmake -S . -B build \
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_BUILD_TYPE=Release
Expand All @@ -201,7 +213,7 @@ jobs:
max-size: 2G
- name: Build
run: |
cmake -S . -B build \
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_FLAGS="--coverage" \
Expand All @@ -222,32 +234,36 @@ jobs:
slug: embedded-dev-research/ITLabAI

evaluate-model:
runs-on: ubuntu-latest
needs: [build-linux]
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build-linux]
permissions:
contents: write

steps:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download binary and libs
uses: actions/download-artifact@v4
with:
name: mnist-RELEASE
path: build/

- name: Set binary path
id: set_eval_binary
run: |
echo "EVAL_BINARY=build/bin/ACC" >> $GITHUB_OUTPUT

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libgtk-3-0 \
libtbb12 \
libjpeg-dev \
libpng-dev \
libtiff-dev
sudo apt-get install -y libgtk-3-0 libtbb12 libjpeg-dev libpng-dev libtiff-dev libopenjp2-7 libdnnl3
sudo ldconfig

- name: Generate model JSON
run: |
cd docs && mkdir jsons
cd docs && mkdir -p jsons
cd ..
cd app/Converters
pip install -r requirements.txt
Expand All @@ -264,76 +280,46 @@ jobs:
- name: Download MNIST test dataset
if: steps.cache-mnist.outputs.cache-hit != 'true'
run: |
set -e
mkdir -p docs/mnist/mnist/test
echo "Downloading test images..."
wget -q https://github.com/DeepTrackAI/MNIST_dataset/archive/main.zip -O main.zip
unzip -q main.zip
cp MNIST_dataset-main/mnist/test/*.png docs/mnist/mnist/test/
rm -rf main.zip MNIST_dataset-main
echo "Downloaded $(ls docs/mnist/mnist/test | wc -l) images"

- name: Download binary and libs
uses: actions/download-artifact@v4
with:
name: mnist-RELEASE
path: build/

- name: Prepare environment
run: |
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/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
echo "Final LD_LIBRARY_PATH: $LD_LIBRARY_PATH"

- name: Verify library integrity
run: |
echo "### Library verification ###"
file build/bin/opencv_libs/libopencv_imgcodecs.so.4.12.0 | grep "shared object"

- name: Run evaluation
run: |
echo "### Pre-run checks ###"
export LD_LIBRARY_PATH=$PWD/build/bin/opencv_libs:/usr/lib/x86_64-linux-gnu
echo "LD_LIBRARY_PATH: $LD_LIBRARY_PATH"

LD_DEBUG=files "${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --model alexnet_mnist 2> ld_debug.log
echo "### Library loading debug ###"
grep -i "opencv_imgcodecs" ld_debug.log

"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" > accuracy.txt
echo "Accuracy: $(cat accuracy.txt)"
export LD_LIBRARY_PATH=$PWD/build/bin/all_libs:/usr/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
"${{ steps.set_eval_binary.outputs.EVAL_BINARY }}" --model alexnet_mnist > accuracy.txt 2>&1
if [ $? -ne 0 ]; then
exit 1
fi

- name: Extract accuracy value
run: |
ACCURACY=$(grep -oE '[0-9]+\.?[0-9]*%' accuracy.txt | head -1 || echo "0%")
echo "$ACCURACY" > accuracy_value.txt

- name: Update README (master only)
if: github.ref == 'refs/heads/master'
run: |
ACCURACY=$(cat accuracy.txt | sed 's/%//g')
ACCURACY=$(cat accuracy_value.txt | sed 's/%//g')
DATE=$(date '+%Y-%m-%d')

echo "Updating README with:"
echo "Accuracy: $ACCURACY"
echo "Date: $DATE"

echo "Current README content:"
grep -A 2 -B 2 "ACCURACY_PLACEHOLDER" README.md || echo "Placeholder not found"

sed -i "s/<!--ACCURACY_PLACEHOLDER-->.*<!--END_ACCURACY-->/<!--ACCURACY_PLACEHOLDER-->Accuracy: ${ACCURACY}% (updated: ${DATE})<!--END_ACCURACY-->/" README.md

echo "Updated README content:"
grep -A 2 -B 2 "ACCURACY_PLACEHOLDER" README.md

- name: Commit and push changes (master only)
if: github.ref == 'refs/heads/master'
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"

git add README.md

if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m "[CI] Update accuracy: $(cat accuracy.txt)%"
git commit -m "[CI] Update accuracy: $(cat accuracy_value.txt)"
git push origin master
echo "Changes pushed to master branch"
fi
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
key: ccache-${{ github.job }}
- name: Build
run: |
cmake -S . -B build \
cmake -S . -B build -G Ninja \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_C_COMPILER=clang \
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "3rdparty/Json"]
path = 3rdparty/Json
url = https://github.com/nlohmann/json
[submodule "3rdparty/oneDNN"]
path = 3rdparty/oneDNN
url = https://github.com/uxlfoundation/oneDNN
2 changes: 2 additions & 0 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
add_subdirectory(googletest)

add_subdirectory(oneDNN)

# Unified TBB Configuration
option(TBB_TEST "Build TBB tests" OFF)
option(TBB_EXAMPLES "Build TBB examples" OFF)
Expand Down
1 change: 1 addition & 0 deletions 3rdparty/oneDNN
Submodule oneDNN added at ceb0d6
1 change: 1 addition & 0 deletions app/Graph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ target_link_libraries(BuildGraph PUBLIC ${OpenCV_LIBS})
target_link_libraries(BuildGraph PUBLIC reader_lib)
target_link_libraries(BuildGraph PUBLIC TBB_unified)
target_link_libraries(BuildGraph PUBLIC layers_lib)
target_link_libraries(BuildGraph PUBLIC layers_oneDNN_lib)
target_link_libraries(BuildGraph PUBLIC gtest_main)

target_include_directories(BuildGraph PUBLIC ${CMAKE_SOURCE_DIR}/3rdparty/Json/include)
Expand Down
8 changes: 5 additions & 3 deletions app/Graph/acc_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ using namespace it_lab_ai;
int main(int argc, char* argv[]) {
std::string model_name = "alexnet_mnist";
bool parallel = false;

bool onednn = false;
for (int i = 1; i < argc; ++i) {
if (std::string(argv[i]) == "--parallel") {
parallel = true;
} else if (std::string(argv[i]) == "--model" && i + 1 < argc) {
model_name = argv[++i];
} else if (std::string(argv[i]) == "--onednn") {
onednn = true;
}
}

Expand Down Expand Up @@ -78,7 +80,7 @@ int main(int argc, char* argv[]) {
Shape sh({static_cast<size_t>(count_pic), 1, 28, 28});
Tensor t = make_tensor<float>(res, sh);
input = t;
build_graph_linear(input, output, false, parallel);
build_graph_linear(input, output, false, parallel, onednn);
std::vector<std::vector<float>> tmp_output =
softmax<float>(*output.as<float>(), 10);
std::vector<size_t> indices;
Expand Down Expand Up @@ -185,7 +187,7 @@ int main(int argc, char* argv[]) {
it_lab_ai::Tensor output =
it_lab_ai::Tensor(output_shape, it_lab_ai::Type::kFloat);

build_graph(input, output, json_path, false, parallel);
build_graph(input, output, json_path, false, parallel, onednn);
std::vector<std::vector<float>> processed_outputs;
const std::vector<float>& raw_output = *output.as<float>();

Expand Down
Loading
Loading