diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6d8679a2f43e30dccc43966313fe68f49b8e68b5..3c86cdadc64ee4184ba2fd6686ed07f324f658a3 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -25,6 +25,7 @@ jobs: - name: build run: cmake --build build -j 2 + android-armv8-cpu: runs-on: ubuntu-latest steps: @@ -34,154 +35,75 @@ jobs: - name: build run: cmake --build build -j 2 - # linux-armv7-cpu-gcc: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v3 - - # - name: cache-qemu - # id: cache-qemu - # uses: actions/cache@v3 - # with: - # path: qemu-install - # key: qemu-arm-install-1 - # - name: checkout-qemu - # if: steps.cache-qemu.outputs.cache-hit != 'true' - # uses: actions/checkout@v3 - # with: - # repository: qemu/qemu - # path: qemu - # ref: 8746309137ba470d1b2e8f5ce86ac228625db940 - # - name: qemu - # if: steps.cache-qemu.outputs.cache-hit != 'true' - # run: | - # cd qemu - # ./configure --prefix=install --target-list=arm-linux-user --disable-system - # make -j2 - # make install - # cp -r arm-linux-user/install $GITHUB_WORKSPACE/qemu-install - - # - name: arm-gnu-toolchain - # run: | - # sudo apt-get update - # sudo apt-get install g++-arm-linux-gnueabi - - # - name: configure - # run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DTENGINE_BUILD_TESTS=ON .. - # - name: build - # run: cmake --build build -j 2 - # - name: models - # run: | - # cd build - # wget -c http://8.136.149.78/download/ci_data/images.zip && unzip images.zip && rm images.zip - # wget -c http://8.136.149.78/download/ci_data/data_arm32.zip && unzip data_arm32.zip && rm data_arm32.zip && mv data_arm32 data - # wget -c http://8.136.149.78/download/ci_data/model_test.zip && unzip model_test.zip && rm model_test.zip && mv model_test model - # - name: test - # run: | - # export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - # chmod +x ./tests/test_arm32.sh - # cd build - # ../tests/test_arm32.sh - - # linux-armv8-cpu-gcc: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v3 - - # - name: cache-qemu - # id: cache-qemu - # uses: actions/cache@v3 - # with: - # path: qemu-install - # key: qemu-aarch64-install-1 - # - name: checkout-qemu - # if: steps.cache-qemu.outputs.cache-hit != 'true' - # uses: actions/checkout@v3 - # with: - # repository: qemu/qemu - # path: qemu - # ref: 8746309137ba470d1b2e8f5ce86ac228625db940 - # - name: qemu - # if: steps.cache-qemu.outputs.cache-hit != 'true' - # run: | - # cd qemu - # ./configure --prefix=install --target-list=aarch64-linux-user --disable-system - # make -j2 - # make install - # cp -r aarch64-linux-user/install $GITHUB_WORKSPACE/qemu-install - - # - name: aarch64-gnu-toolchain - # run: | - # sudo apt-get update - # sudo apt-get install g++-aarch64-linux-gnu - # - name: configure - # run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DTENGINE_BUILD_TESTS=ON .. - # - name: build - # run: cmake --build build -j 2 - # - name: models - # run: | - # cd build - # wget -c http://8.136.149.78/download/ci_data/images.zip && unzip images.zip && rm images.zip - # wget -c http://8.136.149.78/download/ci_data/data_arm64.zip && unzip data_arm64.zip && rm data_arm64.zip && mv data_arm64 data - # wget -c http://8.136.149.78/download/ci_data/model_test.zip && unzip model_test.zip && rm model_test.zip && mv model_test model - - # - name: test - # run: | - # export PATH=$GITHUB_WORKSPACE/qemu-install/bin:$PATH - # chmod +x ./tests/test_arm64.sh - # cd build - # ../tests/test_arm64.sh - - linux-armv8-cpu-gcc-timvx: - runs-on: khadas-vim3 + linux-armv7-cpu-gcc: + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - name: tim-vx + - name: cache-qemu + id: cache-qemu + uses: actions/cache@v3 + with: + path: qemu-install + key: qemu-arm-install-1 + - name: checkout-qemu + if: steps.cache-qemu.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: qemu/qemu + path: qemu + ref: 8746309137ba470d1b2e8f5ce86ac228625db940 + - name: qemu + if: steps.cache-qemu.outputs.cache-hit != 'true' run: | - git clone https://github.com/VeriSilicon/TIM-VX.git - cp -rvf ./TIM-VX/include ./source/device/tim-vx/ - cp -rvf ./TIM-VX/src ./source/device/tim-vx/ - rm ./source/device/tim-vx/src/tim/vx/*_test.cc - rm ./source/device/tim-vx/src/tim/vx/ops/*_test.cc + cd qemu + ./configure --prefix=install --target-list=arm-linux-user --disable-system + make -j2 + make install + cp -r arm-linux-user/install $GITHUB_WORKSPACE/qemu-install + - name: arm-gnu-toolchain + run: | + sudo apt-get update + sudo apt-get install g++-arm-linux-gnueabi - name: configure - run: mkdir build && cd build && cmake -GNinja -DTENGINE_BUILD_TESTS=ON -DTENGINE_ENABLE_TIM_VX=ON .. + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/arm-linux-gnueabi.toolchain.cmake -DTENGINE_BUILD_TESTS=ON .. - name: build - run: cmake --build build -j 6 - - name: models - run: | - cd build - actions=/home/khadas/actions-runner - ln -s ${actions}/ci_test/models_test/ models - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/data_arm64/ data - - name: test - run: | - chmod +x ./tests/test_arm64_real.sh - cd build - ../tests/test_arm64_real.sh - - linux-armv8-cpu-gcc-AGX-Xaiver: - runs-on: AGX-xaiver + run: cmake --build build -j 2 + + + linux-armv8-cpu-gcc: + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 - - name: configure - run: mkdir build && cd build && cmake -GNinja -DTENGINE_BUILD_TESTS=ON -DTENGINE_ENABLE_TENSORRT=ON .. - - name: build - run: cmake --build build -j 8 - - name: models + - name: cache-qemu + id: cache-qemu + uses: actions/cache@v3 + with: + path: qemu-install + key: qemu-aarch64-install-1 + - name: checkout-qemu + if: steps.cache-qemu.outputs.cache-hit != 'true' + uses: actions/checkout@v3 + with: + repository: qemu/qemu + path: qemu + ref: 8746309137ba470d1b2e8f5ce86ac228625db940 + - name: qemu + if: steps.cache-qemu.outputs.cache-hit != 'true' run: | - cd build - actions=/home/nvidia/actions-runner - ln -s ${actions}/ci_test/models_test/ models - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/data_arm64/ data - - name: test + cd qemu + ./configure --prefix=install --target-list=aarch64-linux-user --disable-system + make -j2 + make install + cp -r aarch64-linux-user/install $GITHUB_WORKSPACE/qemu-install + - name: aarch64-gnu-toolchain run: | - chmod +x ./tests/test_arm64_*.sh - cd build - ../tests/test_arm64_real.sh - ../tests/test_arm64_trt.sh + sudo apt-get update + sudo apt-get install g++-aarch64-linux-gnu + - name: configure + run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/aarch64-linux-gnu.toolchain.cmake -DTENGINE_BUILD_TESTS=ON .. + - name: build + run: cmake --build build -j 2 linux-gcc-mipsisa64r6el: runs-on: ubuntu-20.04 @@ -191,7 +113,6 @@ jobs: with: access_token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/checkout@v3 - - name: cache-qemu id: cache-qemu uses: actions/cache@v3 @@ -213,17 +134,16 @@ jobs: make -j2 make install cp -r mips64el-linux-user/install $GITHUB_WORKSPACE/qemu-install - - name: mipsisa64r6el-gnuabi64-toolchain run: | sudo apt-get update sudo apt-get install g++-mipsisa64r6el-linux-gnuabi64 - - name: configure run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../toolchains/mipsisa64r6el-linux-gnuabi64.toolchain.cmake -DTENGINE_BUILD_EXAMPLES=OFF .. - name: build run: cmake --build build -j 2 + windows-x64-cpu-vs2017: runs-on: windows-2016 steps: @@ -234,6 +154,7 @@ jobs: cmake -T v141,host=x64 -A x64 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF .. cmake --build . --config Release -j 2 + windows-x64-cpu-vs2019: runs-on: windows-latest steps: @@ -244,6 +165,7 @@ jobs: cmake -A x64 -DTENGINE_BUILD_EXAMPLES=OFF .. cmake --build . --config Release -j 2 + windows-x86-cpu-vs2017: runs-on: windows-2016 steps: @@ -254,6 +176,7 @@ jobs: cmake -T v141,host=x64 -A Win32 -DTENGINE_OPENMP=OFF -DTENGINE_BUILD_EXAMPLES=OFF .. cmake --build . --config Release -j 2 + windows-x86-cpu-vs2019: runs-on: windows-latest steps: @@ -264,6 +187,7 @@ jobs: cmake -T v142,host=x64 -A Win32 -DTENGINE_BUILD_EXAMPLES=OFF .. cmake --build . --config Release -j 2 + linux-x64-cpu-timvx-gcc: runs-on: ubuntu-latest steps: @@ -289,224 +213,61 @@ jobs: - name: build run: cmake --build build -j 2 + linux-x64-cpu-gcc: - runs-on: x86-server-build-test + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - name: update - # run: sudo apt-get update - # - name: depends - # run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev + - name: update + run: sudo apt-get update + - name: depends + run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DTENGINE_BUILD_TESTS=ON .. + run: mkdir build && cd build && cmake .. - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: optest - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/onnx_op_test_data/ onnx_node - export TG_DEBUG_REF=1 - ctest --output-on-failure - - name: test-data - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/model_test/ models - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/data_x86/ data - - name: test-models - run: | - chmod +x ./tests/test.sh - cd build - ../tests/test.sh - - name: test-op - run: | - cd build - export TG_DEBUG_REF=1 - ctest --output-on-failure + run: cmake --build build -j 2 + linux-x64-cpu-clang: - runs-on: x86-server-build-test + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - name: update - # run: sudo apt-get update - # - name: depends - # run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev + - name: update + run: sudo apt-get update + - name: depends + run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev - name: configure env: CC: clang CXX: clang++ - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DTENGINE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX .. + run: mkdir build && cd build && cmake -DTENGINE_BUILD_TESTS=ON -DCMAKE_C_COMPILER=$CC -DCMAKE_CXX_COMPILER=$CXX .. - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: test-data - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/onnx_op_test_data/ onnx_node - ln -s ${actions}/ci_test/model_test/ models - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/data_x86/ data - - name: test-models - run: | - chmod +x ./tests/test.sh - cd build - ../tests/test.sh - - name: test-op - run: | - cd build - export TG_DEBUG_REF=1 - ctest --output-on-failure + run: cmake --build build -j 2 + linux-x64-cpu-tools-convert: - runs-on: x86-server-build-test + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - name: update - # run: | - # sudo apt-get update - # sudo apt-get install libopencv-dev + - name: update + run: | + sudo apt-get update + sudo apt-get install libprotobuf-dev protobuf-compiler - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DTENGINE_BUILD_CONVERT_TOOL=ON -DTENGINE_BUILD_TESTS=ON .. + run: mkdir build && cd build && cmake -DTENGINE_BUILD_CONVERT_TOOL=ON .. - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: depends - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/model_test_convert/models models - ln -s ${actions}/ci_test/model_test_convert/outputs outputs - - name: Run tests - run: | - chmod +x ./tests/test_onnx_model.sh - cd build - ../tests/test_onnx_model.sh - - # linux-x64-cpu-tools-convert: - # runs-on: x86-server-build-test - # steps: - # - uses: actions/checkout@v3 - # with: - # repository: protocolbuffers/protobuf - # ref: v3.17.3 - # path: protobuf - # submodules: recursive - # - name: Build AppImage - # run: | - # docker run --network=host --env PROTOBUF_REPO_DIR=$PWD/protobuf -v $PWD:$PWD -w $PWD --privileged --ipc=host centos:7 $PWD/.github/workflows/build-package-and-test-convert-tools.sh - # - name: Install dependencies for test - # run: | - # sudo apt-get update - # sudo apt-get install libopencv-dev - # - name: Configure - # run: mkdir build && cd build && /home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake -DTENGINE_BUILD_TESTS=ON .. - # - name: Build test - # run: /home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake --build build -j 2 - # - name: Download and unzip test data - # run: | - # cd build - # actions=/home/dongdong - # ln -s ${actions}/ci_test/model_test_convert/onnx_models.zip onnx_models.zip - # unzip onnx_models.zip - # ln -s ${actions}/ci_test/model_test_convert/onnx_models_output.zip onnx_models_output.zip - # unzip onnx_models_output.zip - # - name: Run tests - # run: | - # chmod +x ./tests/test_onnx_model.sh - # cd build - # ../tests/test_onnx_model.sh ../convert_tool-x86_64.AppImage - # - name: Upload AppImage - # uses: actions/upload-artifact@v2 - # with: - # name: convert_tool_AppImage - # path: convert_tool-x86_64.AppImage + run: cmake --build build -j 2 linux-x64-cpu-tools-quant: - runs-on: x86-server-build-test + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - # - name: update - # run: | - # sudo apt-get update - # sudo apt-get install libopencv-dev + - name: update + run: | + sudo apt-get update + sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DTENGINE_BUILD_QUANT_TOOL=ON -DTENGINE_BUILD_EXAMPLES=ON .. + run: mkdir build && cd build && cmake -DTENGINE_BUILD_QUANT_TOOL=ON .. - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: depends - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/tengine_test_data/mobilenet.tmfile mobilenet.tmfile - ln -s ${actions}/ci_test/tengine_test_data/dataset dataset - ln -s ${actions}/ci_test/images/ images - - name: quant-tools-test - run: | - cd build - ./tools/quantize/quant_tool_uint8 -m mobilenet.tmfile -o mobilenet_uint8.tmfile -i ./dataset -g 3,224,224 -s 0.017,0.017,0.017 -c 1 - - name: uint8-model-test - run: | - cd build - ./examples/tm_classification_uint8 -m mobilenet_uint8.tmfile -i images/cat.jpg -g 224,224 -s 0.017,0.017,0.017 - - # linux-x64-cpu-tools-quant: - # runs-on: x86-server-build-test - # steps: - # - uses: actions/checkout@v3 - # with: - # repository: opencv/opencv - # ref: 4.5.3 - # path: opencv - # submodules: recursive - # - name: Build AppImage - # run: | - # docker run --network=host --env OPENCV_REPO_DIR=$PWD/opencv -v $PWD:$PWD -w $PWD --privileged --ipc=host centos:7 $PWD/.github/workflows/build-quant-tool-appimage.sh - # - name: update - # run: sudo apt-get update - # - name: opencv - # run: sudo apt-get install libopencv-dev - # - name: configure - # run: mkdir build && cd build && /home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake -DTENGINE_BUILD_EXAMPLES=ON .. - # - name: build - # run: /home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake --build build -j 2 - # - name: depends - # run: | - # actions=/home/dongdong - # ln -s ${actions}/ci_test/tengine_test_data/mobilenet.tmfile mobilenet.tmfile - # ln -s ${actions}/ci_test/tengine_test_data/dataset dataset - # ln -s ${actions}/ci_test/images/ images - # - name: quant-tools-test - # run: | - # ./quant_tool_uint8-x86_64.AppImage -m mobilenet.tmfile -o mobilenet_uint8.tmfile -i ./dataset -g 3,224,224 -s 0.017,0.017,0.017 -c 1 - # - name: uint8-model-test - # run: | - # ./build/examples/tm_classification_uint8 -m mobilenet_uint8.tmfile -i images/cat.jpg -g 224,224 -s 0.017,0.017,0.017 - # - name: Upload AppImage - # uses: actions/upload-artifact@v2 - # with: - # name: quant_tool_AppImage - # path: quant_tool_uint8-x86_64.AppImage - - # publish-releases: - # runs-on: x86-server-build-test - # if: github.ref == 'refs/heads/tengine-lite' - # needs: [linux-x64-cpu-tools-convert, linux-x64-cpu-tools-quant] - # steps: - # - uses: actions/checkout@v3 - # - uses: actions/download-artifact@v2 - # with: - # path: artifacts - # - name: Display structure of downloaded files - # run: ls -R - # working-directory: artifacts - # - uses: "marvinpinto/action-automatic-releases@latest" - # with: - # repo_token: "${{ secrets.GITHUB_TOKEN }}" - # automatic_release_tag: "latest" - # prerelease: true - # title: "Development Build" - # files: | - # artifacts/**/*.AppImage - + run: cmake --build build -j2 + diff --git a/.github/workflows/build-package-and-test-convert-tools.sh b/.github/workflows/build-package-and-test-convert-tools.sh deleted file mode 100755 index c0e84b48612a509107174e0210039d5d5f3b10cf..0000000000000000000000000000000000000000 --- a/.github/workflows/build-package-and-test-convert-tools.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -yum install -y centos-release-scl -yum install -y devtoolset-7 python3 python3-pip ImageMagick file fuse-libs -# pip3 install -U --user pip -# python3 -m pip install cmake - -source /opt/rh/devtoolset-7/enable - -PROTOBUF_REPO_DIR=${PROTOBUF_REPO_DIR:-protobuf} -PROTOBUF_BUILD_DIR=build-for-ci -TENGINE_BUILD_DIR=build-for-ci - -pushd $PROTOBUF_REPO_DIR -mkdir -p $PROTOBUF_BUILD_DIR -pushd $PROTOBUF_BUILD_DIR -/home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake -Dprotobuf_BUILD_TESTS=OFF ../cmake -/home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake --build . -j`nproc` -/home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake -DCMAKE_INSTALL_PREFIX=install -P cmake_install.cmake -popd -popd - -export CMAKE_PREFIX_PATH=$PROTOBUF_REPO_DIR/$PROTOBUF_BUILD_DIR/install -mkdir -p $TENGINE_BUILD_DIR -pushd $TENGINE_BUILD_DIR -/home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake -DTENGINE_BUILD_CONVERT_TOOL=ON .. -/home/dongdong/actions-runners-x86/build_and_test/help/cmake-3.21.2-linux-x86_64/bin/cmake --build . -j`nproc` -popd - -SCRIPT_DIR=`dirname "$0"` - -source $SCRIPT_DIR/generate-appimage.sh $TENGINE_BUILD_DIR/tools/convert_tool/convert_tool diff --git a/.github/workflows/build-quant-tool-appimage.sh b/.github/workflows/build-quant-tool-appimage.sh deleted file mode 100755 index 28b148ab7bb118bb9b1bc56f2c389b68710ccdf0..0000000000000000000000000000000000000000 --- a/.github/workflows/build-quant-tool-appimage.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash - -set -ex - -# yum install -y centos-release-scl -# yum install -y devtoolset-7 python3 python3-pip ImageMagick file fuse-libs -# pip3 install -U --user pip -# python3 -m pip install cmake - -source /opt/rh/devtoolset-7/enable - -OPENCV_REPO_DIR=${OPENCV_REPO_DIR:-opencv} -OPENCV_BUILD_DIR=build-for-ci - -# Build opencv by self to avoid depending on libEGL.so -pushd $OPENCV_REPO_DIR -mkdir -p $OPENCV_BUILD_DIR -pushd $OPENCV_BUILD_DIR -/home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake -DWITH_IPP=OFF -DWITH_GTK=OFF -DWITH_OPENCL=OFF -DBUILD_PERF_TESTS=OFF -DBUILD_TESTS=OFF .. -/home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake --build . -j`nproc` -/home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake -DCMAKE_INSTALL_PREFIX=install -P cmake_install.cmake -popd -popd - -export CMAKE_PREFIX_PATH=$OPENCV_REPO_DIR/$OPENCV_BUILD_DIR/install -TENGINE_BUILD_DIR=build-for-ci -mkdir -p $TENGINE_BUILD_DIR -pushd $TENGINE_BUILD_DIR -/home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake -DTENGINE_BUILD_BENCHMARK=OFF -DTENGINE_BUILD_EXAMPLES=OFF -DTENGINE_BUILD_QUANT_TOOL=ON .. -/home/dongdong/actions-runners-x86/test_coverage/help/cmake-3.21.2-linux-x86_64/bin/cmake --build . -j`nproc` -popd - -SCRIPT_DIR=`dirname "$0"` - -source $SCRIPT_DIR/generate-appimage.sh $TENGINE_BUILD_DIR/tools/quantize/quant_tool_uint8 diff --git a/.github/workflows/generate-appimage.sh b/.github/workflows/generate-appimage.sh deleted file mode 100644 index 8512b5d4480b5a939eaf78358ee226e8206959fe..0000000000000000000000000000000000000000 --- a/.github/workflows/generate-appimage.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -set -eux - -if [ ! -f linuxdeploy-x86_64.AppImage ] -then - curl -L -O https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -fi -if [ ! -f linuxdeploy-plugin-appimage-x86_64.AppImage ] -then - curl -L -O https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/download/continuous/linuxdeploy-plugin-appimage-x86_64.AppImage -fi - -chmod +x linuxdeploy-*.AppImage -rm -rf appimage/appdir -mkdir -p appimage/appdir/usr/bin -cp $1 appimage/appdir/usr/bin/ - -bn=`basename $1` - -echo "[Desktop Entry] -Name=$bn -Exec=$bn -Icon=$bn -Type=Application -Terminal=true -Categories=Development;" > appimage/$bn.desktop - -curl -L -o appimage/$bn.png https://gist.github.com/daquexian/cd140d70b1772daa4a736c0642a68e9d/raw/da2b026ac950623700ddfb199d987c55215fc9cb/white-icon.png - -./linuxdeploy-x86_64.AppImage --appdir appimage/appdir -d appimage/$bn.desktop -i appimage/$bn.png --output appimage - -rm -rf appimage/appdir -rm -rf linuxdeploy-*.AppImage diff --git a/.github/workflows/test-coverage.yml b/.github/workflows/test-coverage.yml deleted file mode 100644 index 2dc741a96352b2b1529ef37564627cc3f718a9eb..0000000000000000000000000000000000000000 --- a/.github/workflows/test-coverage.yml +++ /dev/null @@ -1,251 +0,0 @@ -name: test-coverage - -on: - push: - branches: [tengine-lite] - paths: - paths-ignore: - - 'doc/**' - - 'README.md' - - 'README_EN.md' - pull_request: - branches: [tengine-lite] - paths-ignore: - - 'doc/**' - - 'README.md' - - 'README_EN.md' - -jobs: - linux-x64-cpu-gcc: - runs-on: test-coverage - steps: - - uses: actions/checkout@v3 - # - name: update - # run: sudo apt-get update - # - name: depends - # run: sudo apt-get install libprotobuf-dev protobuf-compiler libopencv-dev - # - name: lcov - # run: sudo apt-get install lcov - - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=debug -DTENGINE_BUILD_EXAMPLES=OFF -DTENGINE_BUILD_TESTS=ON -DTENGINE_COVERAGE=ON .. - - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: test-data - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/onnx_op_test_data/ onnx_node - ln -s ${actions}/ci_test/model_test/ models - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/data_x86/ data - - name: test-models - run: | - chmod +x ./tests/test.sh - cd build - ../tests/test.sh - - name: test-op - run: | - cd build - export TG_DEBUG_REF=1 - ctest --output-on-failure - - name: lcov-collect - run: | - cd build - lcov -d ./source -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov -r lcov.info '*fp16*' -o lcov.info - lcov -r lcov.info '*int8*' -o lcov.info - lcov -r lcov.info '*uint8*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - - linux-x64-cpu-tools-quant: - runs-on: test-coverage - steps: - - uses: actions/checkout@v3 - # - name: update - # run: sudo apt-get update - # - name: depends - # run: sudo apt-get install libopencv-dev - # - name: lcov - # run: sudo apt-get install lcov - - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=debug -DTENGINE_BUILD_EXAMPLES=ON -DTENGINE_COVERAGE=ON -DTENGINE_BUILD_QUANT_TOOL=ON .. - - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: test-data - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/tengine_test_data/mobilenet.tmfile mobilenet.tmfile - ln -s ${actions}/ci_test/tengine_test_data/dataset dataset - ln -s ${actions}/ci_test/images/ images - - name: test-tools-quant - run: | - cd build - ./tools/quantize/quant_tool_uint8 -m mobilenet.tmfile -o mobilenet_uint8.tmfile -i ./dataset -g 3,224,224 -s 0.017,0.017,0.017 -c 1 -a 1 - ./tools/quantize/quant_tool_int8 -m mobilenet.tmfile -o mobilenet_int8.tmfile -i ./dataset -g 3,224,224 -s 0.017,0.017,0.017 -c 1 -a 0 - ./examples/tm_classification_uint8 -m mobilenet_uint8.tmfile -i images/cat.jpg -g 224,224 -s 0.017,0.017,0.017 - ./examples/tm_classification_int8 -m mobilenet_uint8.tmfile -i images/cat.jpg -g 224,224 -s 0.017,0.017,0.017 - - name: lcov-collect - run: | - cd build - lcov -d ./tools -c -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - - linux-gcc-x86-timvx-simulator: - runs-on: test-coverage - steps: - - uses: actions/checkout@v3 - # - name: update - # run: sudo apt-get update - # - name: depends - # run: sudo apt-get install libopencv-dev - # - name: lcov - # run: sudo apt-get install lcov - - name: tim-vx - run: | - git clone https://github.com/VeriSilicon/TIM-VX.git - export LD_LIBRARY_PATH=${PWD}/3rdparty/tim-vx/lib/x86_64 - mkdir -p ./3rdparty/tim-vx/include - mkdir -p ./3rdparty/tim-vx/lib/x86_64 - cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/include/* ./3rdparty/tim-vx/include/ - cp -rvf ./TIM-VX/prebuilt-sdk/x86_64_linux/lib/* ./3rdparty/tim-vx/lib/x86_64/ - cp -rvf ./TIM-VX/include ./source/device/tim-vx/ - cp -rvf ./TIM-VX/src ./source/device/tim-vx/ - rm ./source/device/tim-vx/src/tim/vx/*_test.cc - rm ./source/device/tim-vx/src/tim/vx/ops/*_test.cc - - name: configure - run: mkdir build && cd build && /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake -DCMAKE_BUILD_TYPE=debug -DTENGINE_ENABLE_TIM_VX=ON -DTENGINE_ENABLE_TIM_VX_INTEGRATION=ON -DTENGINE_COVERAGE=ON -DTENGINE_BUILD_TESTS=ON .. - - name: build - run: /usr/local/cmake-3.19.8-Linux-x86_64/bin/cmake --build build -j 8 - - name: models - run: | - cd build - actions=/home/dongdong - ln -s ${actions}/ci_test/images/ images - ln -s ${actions}/ci_test/tengine_test_data/ tengine_test_data - ln -s ${actions}/ci_test/onnx_op_test_data/ onnx_node - - name: test-timvx-simulator - run: | - cd build - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../3rdparty/tim-vx/lib/x86_64/ - cp -v ../3rdparty/tim-vx/include/CL/cl_viv_vx_ext.h ./tests/ - cp -v ../3rdparty/tim-vx/include/CL/cl_viv_vx_ext.h ./ - ./examples/tm_classification_timvx -m ./tengine_test_data/mobilenet_uint8.tmfile -i ./images/cat.jpg -g 224,224, -s 0.017,0.017,0.017 - ./examples/tm_classification_timvx -m ./tengine_test_data/squeezenet_uint8.tmfile -i ./images/cat.jpg -g 227,227, -s 0.017,0.017,0.017 - ./examples/tm_yolov5s_timvx -m ./tengine_test_data/yolov5s_uint8.tmfile -i ./images/ssd_dog.jpg - - name: test-op - run: | - cd build - export TG_DEBUG_REF=1 - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../3rdparty/tim-vx/lib/x86_64/ - ctest --output-on-failure - - name: lcov-collect - run: | - cd build - lcov -d ./source -c -o lcov.info - lcov -r lcov.info '*3rdparty*' -o lcov.info - lcov -r lcov.info '*/source/device/cpu/*' -o lcov.info - lcov -r lcov.info '*/source/device/tim-vx/src/*' -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-arm64-timvx-khadas: - runs-on: khadas-vim3 - steps: - - uses: actions/checkout@v3 - - name: tim-vx - run: | - git clone https://github.com/VeriSilicon/TIM-VX.git - cp -rvf ./TIM-VX/include ./source/device/tim-vx/ - cp -rvf ./TIM-VX/src ./source/device/tim-vx/ - rm ./source/device/tim-vx/src/tim/vx/*_test.cc - rm ./source/device/tim-vx/src/tim/vx/ops/*_test.cc - - name: configure - run: mkdir build && cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=debug -DTENGINE_ENABLE_TIM_VX=ON -DTENGINE_ENABLE_TIM_VX_INTEGRATION=ON -DTENGINE_COVERAGE=ON -DTENGINE_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 6 - - name: models - run: | - cd build - actions=/home/khadas/actions-runner - ln -s ${actions}/ci_test/images/ images - git clone https://github.com/BUG1989/tengine_test_data.git - git clone https://github.com/BUG1989/onnx_op_test_data.git onnx_node - - name: test-timvx - run: | - cd build - ./examples/tm_yolov5s_timvx -m ./tengine_test_data/yolov5s_uint8.tmfile -i ./images/ssd_dog.jpg - ./examples/tm_classification_timvx -m ./tengine_test_data/mobilenet_uint8.tmfile -i ./images/cat.jpg -g 224,224, -s 0.017,0.017,0.017 - ./examples/tm_classification_timvx -m ./tengine_test_data/squeezenet_uint8.tmfile -i ./images/cat.jpg -g 227,227, -s 0.017,0.017,0.017 - - name: test-op - run: | - cd build - ctest --output-on-failure - - name: lcov-collect - run: | - cd build - lcov -d ./source -c -o lcov.info - lcov -r lcov.info '*/source/device/cpu/*' -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info - - linux-gcc-arm64-AGX-xaiver: - runs-on: AGX-xaiver - steps: - - uses: actions/checkout@v3 - - name: configure - run: mkdir build && cd build && cmake -GNinja -DCMAKE_BUILD_TYPE=debug -DTENGINE_ENABLE_TENSORRT=ON -DTENGINE_COVERAGE=ON -DTENGINE_BUILD_TESTS=ON .. - - name: build - run: cmake --build build -j 6 - - name: models - run: | - cd build - actions=/home/nvidia/actions-runner - ln -s ${actions}/ci_test/images/ images - git clone https://github.com/BUG1989/tengine_test_data.git - git clone https://github.com/BUG1989/onnx_op_test_data.git onnx_node - - name: test-tensorrt - run: | - cd build - ./examples/tm_classification_trt -m ./tengine_test_data/mobilenet.tmfile -i ./images/cat.jpg -g 224,224, -s 0.017,0.017,0.017 - - name: test-op - run: | - cd build - export TG_DEBUG_REF=1 - ctest --output-on-failure - - name: lcov-collect - run: | - cd build - lcov -d ./source -c -o lcov.info - lcov -r lcov.info '*/source/device/cpu/*' -o lcov.info - lcov -r lcov.info '/usr/*' -o lcov.info - lcov --list lcov.info - - name: codecov - uses: codecov/codecov-action@v3 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: build/lcov.info diff --git a/examples/tm_yolov5s_timvx.cpp b/examples/tm_yolov5s_timvx.cpp index 9099be2e3b9666a97f834b31f10721e89200c645..ff6ce9b6d32064ecaee45f46f450fec39180522a 100644 --- a/examples/tm_yolov5s_timvx.cpp +++ b/examples/tm_yolov5s_timvx.cpp @@ -344,7 +344,7 @@ void get_input_data_focus_uint8(const char* image_file, uint8_t* input_data, int } void get_input_data_nofocus_uint8(const char* image_file, uint8_t* input_data, int letterbox_rows, int letterbox_cols, const float* mean, - const float* scale, float input_scale, int zero_point) + const float* scale, float input_scale, int zero_point) { cv::Mat sample = cv::imread(image_file, 1); cv::Mat img; @@ -403,7 +403,6 @@ void get_input_data_nofocus_uint8(const char* image_file, uint8_t* input_data, i } } } - } int main(int argc, char* argv[]) @@ -545,10 +544,9 @@ int main(int argc, char* argv[]) #if YOLOV5_VERSION6 get_input_data_nofocus_uint8(image_file, input_data.data(), letterbox_rows, letterbox_cols, mean, scale, input_scale, input_zero_point); #else - get_input_data_focus_uint8(image_file, input_data.data(), letterbox_rows, letterbox_cols, mean, scale,input_scale, input_zero_point); + get_input_data_focus_uint8(image_file, input_data.data(), letterbox_rows, letterbox_cols, mean, scale, input_scale, input_zero_point); #endif - /* run graph */ double min_time = DBL_MAX; double max_time = DBL_MIN; diff --git a/source/device/tim-vx/timvx_executor.hpp b/source/device/tim-vx/timvx_executor.hpp index 0dd2adf34ac7e4d5387b9ade7fbb89cfa7c52b89..b6a5222052f89dee15a2b1043a7d70488ed3b492 100644 --- a/source/device/tim-vx/timvx_executor.hpp +++ b/source/device/tim-vx/timvx_executor.hpp @@ -89,7 +89,7 @@ extern "C" { #define SPEC_TYPE_SLICE 7 #define SPEC_TYPE_RESHAPE 8 #define SPEC_TYPE_INPUT 9 -#define SPEC_TYPE_DW_DECONV 10 +#define SPEC_TYPE_DW_DECONV 10 typedef std::map > dict_irt2vxt; typedef std::map > dict_irt2vxo; diff --git a/source/optimizer/split.c b/source/optimizer/split.c index 7b04a4d7875da426a56e2c7b841eb21d0802216a..971dc24a9c14b2e7549c6fea4b5d309e8c24af51 100644 --- a/source/optimizer/split.c +++ b/source/optimizer/split.c @@ -612,7 +612,7 @@ void add_sub_graph_to_ir_graph(struct graph* ir_graph) { for (int k = 0; k < ir_graph->output_num; k++) { - if(sub_graph->node_list[j] == ir_graph->output_nodes[k]) + if (sub_graph->node_list[j] == ir_graph->output_nodes[k]) { struct node* ir_node = ir_graph->node_list[ir_graph->output_nodes[k]]; for (int q = 0; q < ir_node->output_num; q++) @@ -621,7 +621,7 @@ void add_sub_graph_to_ir_graph(struct graph* ir_graph) int tensor_mask_as_out_flag = 0; for (int p = 0; p < sub_graph->output_num; p++) { - if(sub_graph->output_tensor_list[p] == ir_node->output_tensors[q]) + if (sub_graph->output_tensor_list[p] == ir_node->output_tensors[q]) { tensor_mask_as_out_flag = 1; break; diff --git a/tests/op/test_timvx_op_convolution_depthwise.cpp b/tests/op/test_timvx_op_convolution_depthwise.cpp index 40798477d12597ab1d43df5dc8cc354e9d6fd774..477bdb16cdb63e28573980a14443df59890f722f 100644 --- a/tests/op/test_timvx_op_convolution_depthwise.cpp +++ b/tests/op/test_timvx_op_convolution_depthwise.cpp @@ -101,29 +101,29 @@ int create_test_convolution_node(graph_t graph, const char* input_name, const ch * float32 = (uint8 - zero_point) * scale */ float input_fp32[18] = {1.0f, 1.0f, 1.0f, - 2.0f, 2.0f, 2.0f, - 3.0f, 3.0f, 3.0f, - 4.0f, 4.0f, 4.0f, - 5.0f, 5.0f, 5.0f, - 6.0f, 6.0f, 6.0f}; + 2.0f, 2.0f, 2.0f, + 3.0f, 3.0f, 3.0f, + 4.0f, 4.0f, 4.0f, + 5.0f, 5.0f, 5.0f, + 6.0f, 6.0f, 6.0f}; float input_scale = 1; int input_zero_point = 0; float weight_fp32[18] = {1.0f, 0.0f, 1.0f, - 0.0f, 1.0f, 0.0f, - 1.0f, 0.0f, 1.0f, - 0.0f, 1.0f, 0.0f, - 1.0f, 0.0f, 1.0f, - 0.0f, 1.0f, 0.0f}; + 0.0f, 1.0f, 0.0f, + 1.0f, 0.0f, 1.0f, + 0.0f, 1.0f, 0.0f, + 1.0f, 0.0f, 1.0f, + 0.0f, 1.0f, 0.0f}; float weight_scale = 1; int weight_zero_point = 0; float reference_out[18] = {3.0f, 5.0f, 3.0f, - 6.0f, 10.0f, 6.0f, - 5.0f, 7.0f, 5.0f, - 9.0f, 13.0f, 9.0f, - 15.0f, 20.0f, 15.0f, - 11.0f, 17.0f, 11.0f}; + 6.0f, 10.0f, 6.0f, + 5.0f, 7.0f, 5.0f, + 9.0f, 13.0f, 9.0f, + 15.0f, 20.0f, 15.0f, + 11.0f, 17.0f, 11.0f}; float output_scale = 1; int output_zero_point = 0; diff --git a/tests/op/test_timvx_op_deconv_depthwise.cpp b/tests/op/test_timvx_op_deconv_depthwise.cpp index 8421a3d33f9d0ae50023f39a6bc619590d92a466..83b71c57ae6e48ad0e8ed9bd69e747baf3747cdc 100644 --- a/tests/op/test_timvx_op_deconv_depthwise.cpp +++ b/tests/op/test_timvx_op_deconv_depthwise.cpp @@ -111,29 +111,29 @@ float input_fp32[18] = {3.0f, 8.0f, 1.0f, float input_scale = 1; int input_zero_point = 0; -float weight_fp32[18] ={9.0f, 0.0f, 3.0f, - 0.0f, 0.0f, 0.0f, - 1.0f, 0.0f, 2.0f, +float weight_fp32[18] = {9.0f, 0.0f, 3.0f, + 0.0f, 0.0f, 0.0f, + 1.0f, 0.0f, 2.0f, - 3.0f, 0.0f, 7.0f, - 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 8.0f}; + 3.0f, 0.0f, 7.0f, + 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 8.0f}; float weight_scale = 1; int weight_zero_point = 0; float reference_out[50] = { - 27.0f, 72.0f, 18.0f, 24.0f, 3.0f, - 81.0f, 45.0f, 90.0f, 15.0f, 21.0f, - 30.0f, 26.0f, 43.0f, 22.0f, 11.0f, - 9.0f, 5.0f, 25.0f, 10.0f, 14.0f, - 3.0f, 2.0f, 9.0f, 4.0f, 6.0f, - - 21.0f, 27.0f, 52.0f, 63.0f, 7.0f, - 15.0f, 6.0f, 44.0f, 14.0f, 21.0f, - 27.0f, 0.0f, 125.0f, 72.0f, 22.0f, - 0.0f, 0.0f, 40.0f, 16.0f, 24.0f, - 0.0f, 0.0f, 72.0f, 0.0f, 16.0f}; + 27.0f, 72.0f, 18.0f, 24.0f, 3.0f, + 81.0f, 45.0f, 90.0f, 15.0f, 21.0f, + 30.0f, 26.0f, 43.0f, 22.0f, 11.0f, + 9.0f, 5.0f, 25.0f, 10.0f, 14.0f, + 3.0f, 2.0f, 9.0f, 4.0f, 6.0f, + + 21.0f, 27.0f, 52.0f, 63.0f, 7.0f, + 15.0f, 6.0f, 44.0f, 14.0f, 21.0f, + 27.0f, 0.0f, 125.0f, 72.0f, 22.0f, + 0.0f, 0.0f, 40.0f, 16.0f, 24.0f, + 0.0f, 0.0f, 72.0f, 0.0f, 16.0f}; float output_scale = 1; int output_zero_point = 0;