Skip to content

Commit

Permalink
Update tensorflow support to v2.14.0
Browse files Browse the repository at this point in the history
tflite-vx-delegate can support v2.14.0 now

Type: Code Improvement
Signed-off-by: Feiyue Chen <[email protected]>
  • Loading branch information
chenfeiyue-cfy committed Dec 27, 2023
1 parent d8552f8 commit af32934
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 56 deletions.
55 changes: 0 additions & 55 deletions .github/workflows/ci_test.yml

This file was deleted.

2 changes: 1 addition & 1 deletion cmake/modules/Findtensorflow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
82 changes: 82 additions & 0 deletions patches/tf_2_14_kernel_test.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
commit 7e36b6163224da7fc0a2aa4721892a48da85fbed
Author: Feiyue Chen <[email protected]>
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 <gtest/gtest.h>
#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<Interpreter>();
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<Interpreter>();
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 <vector>

#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<Interpreter>();
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<Interpreter>();

0 comments on commit af32934

Please sign in to comment.