|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Copyright 2024 The TensorFlow Authors. All Rights Reserved. |
| 3 | +# |
| 4 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +# you may not use this file except in compliance with the License. |
| 6 | +# You may obtain a copy of the License at |
| 7 | +# |
| 8 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +# |
| 10 | +# Unless required by applicable law or agreed to in writing, software |
| 11 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +# See the License for the specific language governing permissions and |
| 14 | +# limitations under the License. |
| 15 | +# ============================================================================== |
| 16 | +# Called with following arguments: |
| 17 | +# 1 - EXTERNAL or INTERNAL to signal how to run the script |
| 18 | +# 2 - (optional) TENSORFLOW_ROOT: path to root of the TFLM tree (relative to directory from where the script is called). |
| 19 | +# 3 - (optional) EXTERNAL_DIR: Path to the external directory that contains external code |
| 20 | + |
| 21 | +# CI test with compression enabled for hifi3z |
| 22 | + |
| 23 | +set -e |
| 24 | +set -x |
| 25 | +pwd |
| 26 | + |
| 27 | +export TENSORFLOW_ROOT=${2} |
| 28 | +export EXTERNAL_DIR=${3} |
| 29 | +export TARGET=xtensa |
| 30 | +export TARGET_ARCH=hifi3 |
| 31 | +export OPTIMIZED_KERNEL_DIR=xtensa |
| 32 | +export XTENSA_CORE=HIFI_190304_swupgrade |
| 33 | +export GENERIC_BENCHMARK_MODEL_PATH=${TENSORFLOW_ROOT}tensorflow/lite/micro/models/person_detect.tflite |
| 34 | +export USE_TFLM_COMPRESSION=yes |
| 35 | +MAKEFILE=${TENSORFLOW_ROOT}tensorflow/lite/micro/tools/make/Makefile |
| 36 | + |
| 37 | +make -f ${MAKEFILE} third_party_downloads # TODO(b/143904317): first to allow parallel builds |
| 38 | +make -f ${MAKEFILE} -j$(nproc) build |
| 39 | +make -f ${MAKEFILE} -j$(nproc) test |
| 40 | +make -f ${MAKEFILE} -j$(nproc) run_tflm_benchmark |
0 commit comments