diff --git a/.github/workflows/ci_test.yml b/.github/workflows/ci_test.yml deleted file mode 100644 index 4108a5d..0000000 --- a/.github/workflows/ci_test.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: CI test for vx-delegate - -on: - pull_request: - branches: [main] - push: - branches: [main] - schedule: - - cron: '0 16 * * 4' - -env: - # CodeQl and AddressSanitizer needs more memory - BUILD_TYPE: Release - LD_LIBRARY_PATH: ${{github.workspace}}/build/_deps/tim-vx-src/prebuilt-sdk/x86_64_linux/lib:${{github.workspace}}/build/_deps/tim-vx-install/build/lib - VIVANTE_SDK_DIR: ${{github.workspace}}/build/_deps/tim-vx-src/prebuilt-sdk/x86_64_linux/ - CODEQL_CHECK: Off - -jobs: - - vx-delegate-build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Initialize CodeQL - if: ${{ env.CODEQL_CHECK != 'Off' }} - uses: github/codeql-action/init@v2 - with: - languages: cpp, python - - - name: Fetching tensorflow - run: | - git config --global user.email "xiang.zhang@verisilicon.com" - git config --global user.name "xiang.zhang" - git clone https://github.com/tensorflow/tensorflow.git ${{github.workspace}}/3rd-party/tensorflow - cd ${{github.workspace}}/3rd-party/tensorflow && git checkout v2.11.0 - patch -p1 < ${{github.workspace}}/patches/tf_2_11_kernel_test.patch - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: | - cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTFLITE_KERNEL_TEST=ON -DTFLITE_ENABLE_XNNPACK=OFF -DFETCHCONTENT_SOURCE_DIR_TENSORFLOW=${{github.workspace}}/3rd-party/tensorflow - - name: Perform CodeQL Analysis - if: ${{ env.CODEQL_CHECK != 'Off' }} - uses: github/codeql-action/analyze@v2 - - - name: build - # Build your program with the given configuration - run: | - cd ${{github.workspace}}/build && make all -j12 - - name: do kernel test - id: kernel_test - run: | - cd ${{github.workspace}}/script - chmod u+x ${{github.workspace}}/script/KernelTest.sh - ./KernelTest.sh diff --git a/cmake/modules/Findtensorflow.cmake b/cmake/modules/Findtensorflow.cmake index ba84a52..f148d10 100644 --- a/cmake/modules/Findtensorflow.cmake +++ b/cmake/modules/Findtensorflow.cmake @@ -23,7 +23,7 @@ include(FetchContent) FetchContent_Declare( tensorflow GIT_REPOSITORY https://github.com/tensorflow/tensorflow.git - GIT_TAG v2.11.0 + GIT_TAG v2.14.0 ) FetchContent_GetProperties(tensorflow) if(NOT tensorflow_POPULATED) diff --git a/patches/tf_2_14_kernel_test.patch b/patches/tf_2_14_kernel_test.patch new file mode 100644 index 0000000..a564cf6 --- /dev/null +++ b/patches/tf_2_14_kernel_test.patch @@ -0,0 +1,82 @@ +commit 7e36b6163224da7fc0a2aa4721892a48da85fbed +Author: Feiyue Chen +Date: Mon Dec 18 07:29:04 2023 +0000 + + fixed kerneltest building error + +diff --git a/tensorflow/lite/kernels/CMakeLists.txt b/tensorflow/lite/kernels/CMakeLists.txt +index 57ed10d7e64..d3e10a7de1a 100644 +--- a/tensorflow/lite/kernels/CMakeLists.txt ++++ b/tensorflow/lite/kernels/CMakeLists.txt +@@ -91,6 +91,7 @@ set(TEST_FRAMEWORK_SRC + ${TFLITE_SOURCE_DIR}/tools/optimize/operator_property.cc + ${TFLITE_SOURCE_DIR}/tools/optimize/quantization_utils.cc + ${TFLITE_SOURCE_DIR}/tools/tool_params.cc ++ ${TFLITE_SOURCE_DIR}/tools/versioning/op_signature.cc + ${TFLITE_SOURCE_DIR}/tools/versioning/op_version.cc + ${TF_SOURCE_DIR}/tsl/platform/default/env_time.cc + ${TF_SOURCE_DIR}/tsl/platform/default/logging.cc +diff --git a/tensorflow/lite/kernels/if_test.cc b/tensorflow/lite/kernels/if_test.cc +index 5fd734bba86..580a54e3e43 100644 +--- a/tensorflow/lite/kernels/if_test.cc ++++ b/tensorflow/lite/kernels/if_test.cc +@@ -20,7 +20,11 @@ limitations under the License. + + #include + #include "tensorflow/lite/core/interpreter.h" ++ ++#ifdef TFLITE_BUILD_WITH_XNNPACK_DELEGATE + #include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h" ++#endif ++ + #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" + #include "tensorflow/lite/kernels/kernel_util.h" + #include "tensorflow/lite/kernels/subgraph_test_util.h" +@@ -162,6 +166,7 @@ TEST_F(DynamicSubgraphIfTest, TestIfFalse) { + + class IfTest : public ControlFlowOpTest {}; + ++#ifdef TFLITE_BUILD_WITH_XNNPACK_DELEGATE + TEST_F(IfTest, TestWithXNNPACK) { + interpreter_ = std::make_unique(); + AddSubgraphs(2); +@@ -203,6 +208,7 @@ TEST_F(IfTest, TestWithXNNPACK) { + ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); + TfLiteXNNPackDelegateDelete(xnnpack_delegate); + } ++#endif + + TEST_F(IfTest, TestInputIsOutput) { + interpreter_ = std::make_unique(); +diff --git a/tensorflow/lite/kernels/while_test.cc b/tensorflow/lite/kernels/while_test.cc +index 0e0a3e43a72..90c55a55525 100644 +--- a/tensorflow/lite/kernels/while_test.cc ++++ b/tensorflow/lite/kernels/while_test.cc +@@ -18,7 +18,11 @@ limitations under the License. + #include + + #include "tensorflow/lite/core/interpreter.h" ++ ++#ifdef TFLITE_BUILD_WITH_XNNPACK_DELEGATE + #include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h" ++#endif ++ + #include "tensorflow/lite/kernels/internal/tensor_ctypes.h" + #include "tensorflow/lite/kernels/subgraph_test_util.h" + #include "tensorflow/lite/profiling/memory_info.h" +@@ -36,6 +40,7 @@ namespace { + + class WhileTest : public ControlFlowOpTest {}; + ++#ifdef TFLITE_BUILD_WITH_XNNPACK_DELEGATE + TEST_F(WhileTest, TestWithXNNPACK) { + interpreter_ = std::make_unique(); + AddSubgraphs(2); +@@ -73,6 +78,7 @@ TEST_F(WhileTest, TestWithXNNPACK) { + ASSERT_EQ(interpreter_->Invoke(), kTfLiteOk); + TfLiteXNNPackDelegateDelete(xnnpack_delegate); + } ++#endif + + TEST_F(WhileTest, TestInputIsOutput) { + interpreter_ = std::make_unique();