Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update library and patches. #42

Merged
merged 1 commit into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/tflm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
submodules: false
path: tflite-micro
repository: tensorflow/tflite-micro
ref: 0cc2e49fd96eca29761b323a16f41683fe112fc6
ref: 7a0249686f412551634a5058ddd6d2ec3f224203

- name: '🩹 Apply patches'
run: |
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:

- name: '🔄 Update headers'
run: |
rsync -av --delete --include='*/' --include='LICENSE' --include='*.h' --exclude='*' --delete *-headers/ include
rsync -av --delete --include='*/' --include='LICENSE' --include='COPYING' --include='*.h' --exclude='*' --delete *-headers/ include
rm -fr *-headers

- name: '🔀 Create Pull Request'
Expand Down
12 changes: 6 additions & 6 deletions patches/tflite_micro.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
diff --git a/tensorflow/lite/micro/tools/make/ethos_u_core_driver_download.sh b/tensorflow/lite/micro/tools/make/ethos_u_core_driver_download.sh
new file mode 100755
index 00000000..c4859466
index 00000000..e6c96c16
--- /dev/null
+++ b/tensorflow/lite/micro/tools/make/ethos_u_core_driver_download.sh
@@ -0,0 +1,64 @@
Expand Down Expand Up @@ -57,10 +57,10 @@ index 00000000..c4859466
+ exit 1
+ fi
+
+ git clone -c advice.detachedHead=false --depth 1 --branch 24.05 \
+ "https://review.mlplatform.org/ml/ethos-u/ethos-u-core-driver" \
+ git clone "https://review.mlplatform.org/ml/ethos-u/ethos-u-core-driver" \
+ ${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} >&2
+ pushd ${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} > /dev/null
+ git -c advice.detachedHead=false checkout 9622608a5cc318c0933bcce720b59737d03bfb6f
+ rm -rf .git
+ create_git_repo ./
+ popd > /dev/null
Expand All @@ -69,7 +69,7 @@ index 00000000..c4859466
+
+echo "SUCCESS"
diff --git a/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc b/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc
index c61aaff3..fba2bbde 100644
index c61aaff3..fda7d05d 100644
--- a/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc
+++ b/tensorflow/lite/micro/tools/make/ext_libs/ethos_u.inc
@@ -30,7 +30,10 @@ endif
Expand All @@ -90,8 +90,8 @@ index c61aaff3..fba2bbde 100644
endif
-CCFLAGS += ${ETHOSU_FLAGS}
-CXXFLAGS += ${ETHOSU_FLAGS}
+CCFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_CFLAGS}
+CXXFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_CXXFLAGS}
+CCFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_FLAGS}
+CXXFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_FLAGS}

# Convert downloaded person detect int8 model.
$(GENERATED_SRCS_DIR)tensorflow/lite/micro/models/person_detect_model_data_vela.cc:
Expand Down
4 changes: 2 additions & 2 deletions tools/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC}
${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \
KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \
TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \
ETHOSU_EXTRA_CFLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite"
ETHOSU_EXTRA_FLAGS=${ETHOSU_CONFIG} BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite"

make -j$(nproc) -f tensorflow/lite/micro/tools/make/Makefile \
TARGET=cortex_m_generic TARGET_ARCH=${TARGET_ARCH} CO_PROCESSOR=${TARGET_COPROC} \
${TARGET_ARGS} OPTIMIZED_KERNEL_DIR=${TARGET_KERNEL} CORE_OPTIMIZATION_LEVEL=-O2 \
KERNEL_OPTIMIZATION_LEVEL=-O2 THIRD_PARTY_KERNEL_OPTIMIZATION_LEVEL=-O2 \
TARGET_TOOLCHAIN_ROOT=${TOOLCHAIN_PATH}/bin/ TARGET_TOOLCHAIN_PREFIX=arm-none-eabi- \
ETHOSU_EXTRA_CFLAGS="${ETHOSU_CONFIG}" BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite
ETHOSU_EXTRA_FLAGS="${ETHOSU_CONFIG}" BUILD_TYPE=${TARGET_BUILD} MICROLITE_LIB_NAME=libtflm.a microlite
popd
mv ${TFLM_REPO_PATH}/gen/*/lib/libtflm.a libtflm-${TARGET_NAME}-${TARGET_BUILD}.a
}
Expand Down