-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e9e17f
commit e9d55ca
Showing
4 changed files
with
114 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,17 +51,10 @@ jobs: | |
repository: tensorflow/tflite-micro | ||
ref: 0cc2e49fd96eca29761b323a16f41683fe112fc6 | ||
|
||
- name: '⏳ Checkout Ethos-U' | ||
run: | | ||
git clone --branch 24.05 --depth 1 \ | ||
https://review.mlplatform.org/ml/ethos-u/ethos-u-core-driver \ | ||
tflite-micro/tensorflow/lite/micro/tools/make/downloads/ethos_u_core_driver/ | ||
- name: '🩹 Apply patches' | ||
run: | | ||
cd tflite-micro/tensorflow/lite/micro/tools/make/downloads/ethos_u_core_driver/ | ||
git log -1 | ||
git apply --verbose ${GITHUB_WORKSPACE}/patches/ethosu_driver.patch | ||
cd tflite-micro | ||
git apply --verbose ${GITHUB_WORKSPACE}/patches/tflite_micro.patch | ||
- name: '♻ Caching dependencies' | ||
uses: actions/[email protected] | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
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 | ||
--- /dev/null | ||
+++ b/tensorflow/lite/micro/tools/make/ethos_u_core_driver_download.sh | ||
@@ -0,0 +1,64 @@ | ||
+#!/bin/bash | ||
+# Copyright 2024 The TensorFlow Authors. All Rights Reserved. | ||
+# | ||
+# Licensed under the Apache License, Version 2.0 (the "License"); | ||
+# you may not use this file except in compliance with the License. | ||
+# You may obtain a copy of the License at | ||
+# | ||
+# http://www.apache.org/licenses/LICENSE-2.0 | ||
+# | ||
+# Unless required by applicable law or agreed to in writing, software | ||
+# distributed under the License is distributed on an "AS IS" BASIS, | ||
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
+# See the License for the specific language governing permissions and | ||
+# limitations under the License. | ||
+# ============================================================================== | ||
+# | ||
+# Called with following arguments: | ||
+# 1 - Path to the downloads folder which is typically | ||
+# tensorflow/lite/micro/tools/make/downloads | ||
+# | ||
+# This script is called from the Makefile and uses the following convention to | ||
+# enable determination of sucess/failure: | ||
+# | ||
+# - If the script is successful, the only output on stdout should be SUCCESS. | ||
+# The makefile checks for this particular string. | ||
+# | ||
+# - Any string on stdout that is not SUCCESS will be shown in the makefile as | ||
+# the cause for the script to have failed. | ||
+# | ||
+# - Any other informational prints should be on stderr. | ||
+ | ||
+set -e | ||
+ | ||
+TENSORFLOW_ROOT=${2} | ||
+source ${TENSORFLOW_ROOT}tensorflow/lite/micro/tools/make/bash_helpers.sh | ||
+ | ||
+DOWNLOADS_DIR=${1} | ||
+if [ ! -d ${DOWNLOADS_DIR} ]; then | ||
+ echo "The top-level downloads directory: ${DOWNLOADS_DIR} does not exist." | ||
+ exit 1 | ||
+fi | ||
+ | ||
+DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH=${DOWNLOADS_DIR}/ethos_u_core_driver | ||
+ | ||
+if [ -d ${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} ]; then | ||
+ echo >&2 "${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} already exists, skipping the download." | ||
+else | ||
+ UNAME_S=`uname -s` | ||
+ if [ ${UNAME_S} != Linux ]; then | ||
+ echo "OS type ${UNAME_S} not supported." | ||
+ 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" \ | ||
+ ${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} >&2 | ||
+ pushd ${DOWNLOADED_ETHOS_U_CORE_DRIVER_PATH} > /dev/null | ||
+ rm -rf .git | ||
+ create_git_repo ./ | ||
+ popd > /dev/null | ||
+ | ||
+fi | ||
+ | ||
+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 | ||
--- 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 | ||
ETHOSU_DEFAULT_DOWNLOAD_DRIVER_PATH := $(MAKEFILE_DIR)/downloads/ethos_u_core_driver | ||
ETHOSU_DRIVER_PATH := $(ETHOSU_DEFAULT_DOWNLOAD_DRIVER_PATH) | ||
ifeq ($(ETHOSU_DRIVER_PATH), $(ETHOSU_DEFAULT_DOWNLOAD_DRIVER_PATH)) | ||
- $(call $(or $(shell $(DOWNLOAD_SCRIPT) $(ETHOSU_URL) $(ETHOSU_MD5) $(ETHOSU_DRIVER_PATH) >&2 && echo SUCCESS), $(error $(DOWNLOAD_SCRIPT) failed))) | ||
+DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ethos_u_core_driver_download.sh $(DOWNLOADS_DIR) $(TENSORFLOW_ROOT)) | ||
+ ifneq ($(DOWNLOAD_RESULT), SUCCESS) | ||
+ $(error $(DOWNLOAD_SCRIPT) failed) | ||
+ endif | ||
endif | ||
|
||
THIRD_PARTY_CC_HDRS += $(shell find $(ETHOSU_DRIVER_PATH)/include -name "*.h") | ||
@@ -67,8 +70,8 @@ else ifeq ($(ETHOSU_ARCH), u65) | ||
else | ||
$(error "ETHOSU_ARCH=$(ETHOSU_ARCH) is not supported") | ||
endif | ||
-CCFLAGS += ${ETHOSU_FLAGS} | ||
-CXXFLAGS += ${ETHOSU_FLAGS} | ||
+CCFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_CFLAGS} | ||
+CXXFLAGS += ${ETHOSU_FLAGS} ${ETHOSU_EXTRA_CXXFLAGS} | ||
|
||
# Convert downloaded person detect int8 model. | ||
$(GENERATED_SRCS_DIR)tensorflow/lite/micro/models/person_detect_model_data_vela.cc: | ||
diff --git a/tensorflow/lite/micro/tools/make/third_party_downloads.inc b/tensorflow/lite/micro/tools/make/third_party_downloads.inc | ||
index 6bee8ce8..902206d4 100644 | ||
--- a/tensorflow/lite/micro/tools/make/third_party_downloads.inc | ||
+++ b/tensorflow/lite/micro/tools/make/third_party_downloads.inc | ||
@@ -40,5 +40,3 @@ EMBARC_MLI_PRE_COMPILED_URL := "https://github.com/foss-for-synopsys-dwc-arc-pro | ||
EMBARC_MLI_PRE_COMPILED_MD5 := "173990c2dde4efef6a2c95b92d1f0244" | ||
|
||
# Skip md5sum-check since ethos-u-core-driver download link is non-deterministic, see https://github.com/google/gitiles/issues/84 | ||
-ETHOSU_URL := "https://review.mlplatform.org/plugins/gitiles/ml/ethos-u/ethos-u-core-driver/+archive/24455eedb9e8939f8a28ca0101a6f2d171e1b2f9.tar.gz" | ||
-ETHOSU_MD5 := "SKIP_MD5_CHECK" | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters