diff options
Diffstat (limited to 'infra/scripts')
21 files changed, 172 insertions, 540 deletions
diff --git a/infra/scripts/build-tcm.sh b/infra/scripts/build-tcm.sh index 38533c1f9..768cff762 100755 --- a/infra/scripts/build-tcm.sh +++ b/infra/scripts/build-tcm.sh @@ -2,13 +2,16 @@ # # STEP 1 # Download latest TCM tool from -# https://github.sec.samsung.net/RS-TCM/tca-standalone/releases/download/v0.0.8/tca-standalone-0.0.8.jar +# https://github.sec.samsung.net/RS-TCM/tca-standalone/releases/download/1.0.2/tca-standalone-1.0.2.jar # # STEP 2 # Create symbolic link `./src` for source directory to be analyzed which has `.ahub` configuration. # # STEP 3 -# run this `build-tcm.sh` script. +# run this script in `build-tcm.sh [test_target]` format. +# ex) $ build_tcm.sh # to analyze both NN Runtime and NN Compiler +# ex) $ build_tcm.sh NN_Runtime # to analyze NN Runtime only +# ex) $ build_tcm.sh NN_Compiler # to analyze NN Compiler only # # See the following link for additional details. # https://github.sec.samsung.net/RS-TCM/tca-standalone/wiki/Tutorials-CPP-Gtest @@ -16,9 +19,10 @@ echo ${PROJECT_DIR:=${PWD}} -java -jar $PROJECT_DIR/tca-standalone-0.0.8.jar \ +java -jar $PROJECT_DIR/tca-standalone-1.0.2.jar \ --outdir=$PROJECT_DIR/tcm-output \ --config=$PROJECT_DIR/src/.ahub/tcchecker-tca/config.yaml \ --local=$PROJECT_DIR/src \ --logfile=$PROJECT_DIR/tcm-output/tcm.log \ --debug + $@ diff --git a/infra/scripts/build_android_runtime_release.sh b/infra/scripts/build_android_runtime_release.sh deleted file mode 100755 index fe933c648..000000000 --- a/infra/scripts/build_android_runtime_release.sh +++ /dev/null @@ -1,21 +0,0 @@ -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare pre-built armcompute library -# android build requires pre-built armcompute library -if [ ! -n "$EXT_ACL_FOLDER" ]; then - echo "Please set EXT_ACL_FOLDER to use pre-built armcompute library" - exit 1 -fi - -# prepare ndk -if [ ! -n "$NDK_DIR" ]; then - export NDK_DIR=$ROOT_PATH/tools/cross/ndk/r20/ndk - echo "It will use default external path" -fi - -export TARGET_OS=android -export CROSS_BUILD=1 -make -f Makefile.template diff --git a/infra/scripts/common.sh b/infra/scripts/common.sh index a10aac271..0beaf6766 100755 --- a/infra/scripts/common.sh +++ b/infra/scripts/common.sh @@ -31,11 +31,11 @@ function CheckTestPrepared() { # Model download server setting if [[ -z "${MODELFILE_SERVER}" ]]; then - echo "[WARNING] Model file server is not set" - echo " Try to use pre-downloaed model" + echo "Model file server is not set. Try to use default setting." else echo "Model Server: ${MODELFILE_SERVER}" fi + $INSTALL_PATH/test/onert-test prepare-model } # $1: (required) backend @@ -50,10 +50,10 @@ function TFLiteModelVerification() export BACKENDS=$1 if [[ "$2" == "" ]]; then - $INSTALL_PATH/test/onert-test verify-tflite --api=nnapi \ + $INSTALL_PATH/test/onert-test verify-tflite \ --reportdir=$ROOT_PATH/$3 else - $INSTALL_PATH/test/onert-test verify-tflite --api=nnapi \ + $INSTALL_PATH/test/onert-test verify-tflite \ --list=$2 \ --reportdir=$ROOT_PATH/$3 fi @@ -74,7 +74,7 @@ function NNAPIGTest() # Backup original nnapi_gtest.skip # TODO Pass skiplist to test-driver.sh - SKIPLIST_FILE="${INSTALL_PATH}/unittest/nnapi_gtest.skip" + SKIPLIST_FILE="${INSTALL_PATH}/nnapi-gtest/nnapi_gtest.skip" BACKUP_FILE="${SKIPLIST_FILE}.backup" if [[ "$2" != "" ]]; then cp ${SKIPLIST_FILE} ${BACKUP_FILE} @@ -84,7 +84,7 @@ function NNAPIGTest() export BACKENDS=$1 $INSTALL_PATH/test/onert-test unittest \ --reportdir=$ROOT_PATH/$3 \ - --unittestdir=$INSTALL_PATH/unittest + --unittestdir=$INSTALL_PATH/nnapi-gtest unset BACKENDS # TODO Pass skiplist to test-driver.sh @@ -129,27 +129,3 @@ function NNPackageTest() popd > /dev/null } - -# $1: (required) backend -# $2: (required) test list file relative path from nnfw root directory -# pass empty string if there is no skiplist -# $3: (required) relative path to report from nnfw root directory -function TFLiteLoaderTest() -{ - [[ $# -ne 3 ]] && echo "TFLiteLoaderTest: Invalid function argument setting" && exit 1 - - pushd ${ROOT_PATH} > /dev/null - - export BACKENDS=$1 - if [[ "$2" == "" ]]; then - $INSTALL_PATH/test/onert-test verify-tflite --api=loader \ - --reportdir=$ROOT_PATH/$3 - else - $INSTALL_PATH/test/onert-test verify-tflite --api=loader \ - --list=$2 \ - --reportdir=$ROOT_PATH/$3 - fi - unset BACKENDS - - popd > /dev/null -} diff --git a/infra/scripts/compiler_modules.sh b/infra/scripts/compiler_modules.sh index a0323e0a0..8b361a7ea 100644 --- a/infra/scripts/compiler_modules.sh +++ b/infra/scripts/compiler_modules.sh @@ -1,23 +1,38 @@ #!/bin/bash +# NOTE this file is sourced from, for the purpose of +# - configure_compiler_coverage.sh: to get test coverage for release criteria + # Don't run this script [[ "${BASH_SOURCE[0]}" == "${0}" ]] && echo "Please don't execute ${BASH_SOURCE[0]}, source it" && return -DEBUG_BUILD_ITEMS="angkor;cwrap;pepper-str;pepper-strcast;pp;stdex" -DEBUG_BUILD_ITEMS+=";oops;pepper-assert" +DEBUG_BUILD_ITEMS="angkor;cwrap;pepper-str;pepper-strcast;pp" +DEBUG_BUILD_ITEMS+=";oops;pepper-assert;pepper-csv2vec" DEBUG_BUILD_ITEMS+=";hermes;hermes-std" DEBUG_BUILD_ITEMS+=";loco;locop;locomotiv;logo-core;logo" -DEBUG_BUILD_ITEMS+=";foder;souschef;arser;vconone" -DEBUG_BUILD_ITEMS+=";safemain;mio-circle;mio-tflite" +DEBUG_BUILD_ITEMS+=";foder;crew;souschef;arser;vconone" +DEBUG_BUILD_ITEMS+=";safemain;mio-circle05;mio-tflite280;mio-circle06;mio-tflite2121;dio-hdf5" +DEBUG_BUILD_ITEMS+=";luci-compute" DEBUG_BUILD_ITEMS+=";tflite2circle" DEBUG_BUILD_ITEMS+=";luci" DEBUG_BUILD_ITEMS+=";luci-interpreter" -DEBUG_BUILD_ITEMS+=";luci-value-test" +DEBUG_BUILD_ITEMS+=";luci-eval-driver;luci-pass-value-test;luci-value-test" DEBUG_BUILD_ITEMS+=";circle2circle;record-minmax;circle-quantizer" +DEBUG_BUILD_ITEMS+=";circle-eval-diff" +DEBUG_BUILD_ITEMS+=";circle-partitioner;circle-part-driver;circle-operator" DEBUG_BUILD_ITEMS+=";circle-verify" +DEBUG_BUILD_ITEMS+=";circle-tensordump;circle-opselector" DEBUG_BUILD_ITEMS+=";tflchef;circlechef" DEBUG_BUILD_ITEMS+=";common-artifacts" DEBUG_BUILD_ITEMS+=";circle2circle-dredd-recipe-test" DEBUG_BUILD_ITEMS+=";record-minmax-conversion-test" DEBUG_BUILD_ITEMS+=";tf2tfliteV2;tf2tfliteV2-conversion-test" DEBUG_BUILD_ITEMS+=";tflite2circle-conversion-test" +DEBUG_BUILD_ITEMS+=";pota-quantization-value-test;pics" +DEBUG_BUILD_ITEMS+=";circle-part-value-test" +DEBUG_BUILD_ITEMS+=";circle-quantizer-dredd-recipe-test" +DEBUG_BUILD_ITEMS+=";circle-operator-test" +DEBUG_BUILD_ITEMS+=";circle-interpreter;circle-interpreter-test" +DEBUG_BUILD_ITEMS+=";dalgona;dalgona-test" +DEBUG_BUILD_ITEMS+=";visq" +DEBUG_BUILD_ITEMS+=";circle-mpqsolver" diff --git a/infra/scripts/docker_build_cross_aarch64_runtime.sh b/infra/scripts/docker_build_cross_aarch64_runtime.sh deleted file mode 100755 index 011d14c18..000000000 --- a/infra/scripts/docker_build_cross_aarch64_runtime.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare rootfs -if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then - echo "It will use default rootfs path" -else - DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs" - DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs" -fi - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -DOCKER_ENV_VARS+=" -e TARGET_ARCH=aarch64" -DOCKER_ENV_VARS+=" -e CROSS_BUILD=1" - -set -e - -pushd $ROOT_PATH > /dev/null - -# TODO use command instead of makefile -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -CMD="cp -nv Makefile.template Makefile && \ - make all install build_test_suite" -./nnfw docker-run bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/docker_build_cross_arm_runtime.sh b/infra/scripts/docker_build_cross_arm_runtime.sh deleted file mode 100755 index 551fb5700..000000000 --- a/infra/scripts/docker_build_cross_arm_runtime.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare rootfs -if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then - echo "It will use default rootfs path" -else - DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs" - DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs" -fi - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l" -DOCKER_ENV_VARS+=" -e CROSS_BUILD=1" - -set -e - -pushd $ROOT_PATH > /dev/null - -# TODO use command instead of makefile -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -CMD="cp -nv Makefile.template Makefile && \ - make all install build_test_suite" -./nnfw docker-run bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/docker_build_cross_arm_runtime_release.sh b/infra/scripts/docker_build_cross_arm_runtime_release.sh deleted file mode 100755 index 876f318f4..000000000 --- a/infra/scripts/docker_build_cross_arm_runtime_release.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare rootfs -if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then - echo "It will use default rootfs path" -else - DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs" - DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs" -fi - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l" -DOCKER_ENV_VARS+=" -e CROSS_BUILD=1" -DOCKER_ENV_VARS+=" -e BUILD_TYPE=release" - -set -e - -pushd $ROOT_PATH > /dev/null - -# TODO use command instead of makefile -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -CMD="cp -nv Makefile.template Makefile && \ - make all install build_test_suite" -./nnfw docker-run bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/docker_build_cross_coverage.sh b/infra/scripts/docker_build_cross_coverage.sh deleted file mode 100755 index f42251baa..000000000 --- a/infra/scripts/docker_build_cross_coverage.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare rootfs -if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then - echo "It will use default rootfs path" -else - DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs" - DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs" -fi - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -NNAS_WORKSPACE=${NNAS_WORKSPACE:-build} -if [[ -z "${ARCHIVE_PATH}" ]]; then - ARCHIVE_PATH=${NNAS_WORKSPACE}/archive -fi - -DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l" -DOCKER_ENV_VARS+=" -e CROSS_BUILD=1" -DOCKER_ENV_VARS+=" -e COVERAGE_BUILD=1" - -set -e - -pushd $ROOT_PATH > /dev/null - -# TODO use command instead of makefile -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -CMD="cp -nv Makefile.template Makefile && \ - make all install build_coverage_suite" -./nnfw docker-run bash -c "$CMD" - -mkdir -p ${ARCHIVE_PATH} -# TODO change workspace usage in makefile -mv Product/out/coverage-suite.tar.gz ${ARCHIVE_PATH}/ - -popd > /dev/null diff --git a/infra/scripts/docker_build_nncc.sh b/infra/scripts/docker_build_nncc.sh index 6cdfdf01b..dd9d0bd9b 100755 --- a/infra/scripts/docker_build_nncc.sh +++ b/infra/scripts/docker_build_nncc.sh @@ -2,6 +2,10 @@ [[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return +unset RELEASE_VERSION +# TODO need more better argument parsing +RELEASE_VERSION="$1" + CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_PATH="$CURRENT_PATH/../../" @@ -23,18 +27,20 @@ else fi # prepare tensorflow -if [ -d $TENSORFLOW_PREFIX ]; then +if [ -n "$TENSORFLOW_PREFIX" ]; then DOCKER_OPTS+=" -v $TENSORFLOW_PREFIX:/opt/tensorflow" CONFIG_OPTIONS+=" -DTENSORFLOW_PREFIX=/opt/tensorflow" fi # prepare onnx -if [ -d $ONNXRUNTIME_PREFIX ]; then +if [ -n "$ONNXRUNTIME_PREFIX" ]; then DOCKER_OPTS+=" -v $ONNXRUNTIME_PREFIX:/opt/onnxruntime" CONFIG_OPTIONS+=" -DONNXRUNTIME_PREFIX=/opt/onnxruntime" fi # docker image name +# - for bionic, use DOCKER_IMAGE_NAME="nnfw/one-devtools:bionic" +# - for focal, use DOCKER_IMAGE_NAME="nnfw/one-devtools:focal" if [[ -z $DOCKER_IMAGE_NAME ]]; then echo "It will use default docker image name" fi @@ -54,20 +60,18 @@ pushd $ROOT_PATH > /dev/null mkdir -p ${NNCC_INSTALL_PREFIX} ./nncc docker-run ./nnas create-package --prefix "${PWD}/${NNCC_INSTALL_PREFIX}" -- "${CONFIG_OPTIONS}" -# create python virtual environment -./nncc docker-run python3 -m venv "${NNCC_INSTALL_PREFIX}/bin/venv" +mkdir -p ${ARCHIVE_PATH} +tar -zcf ${ARCHIVE_PATH}/nncc-package.tar.gz -C ${NNCC_INSTALL_PREFIX} \ + --exclude test --exclude tflchef* --exclude circle-tensordump --exclude circledump ./ +tar -zcf ${ARCHIVE_PATH}/nncc-test-package.tar.gz -C ${NNCC_INSTALL_PREFIX} ./test -# TODO remove version number of 'pip==20.2.1 setuptools==49.3.0' -# NOTE adding version is for temporary hotfix of setuptools 50.x.y version -./nncc docker-run "${NNCC_INSTALL_PREFIX}/bin/venv/bin/python" \ - -m pip --default-timeout=1000 --trusted-host pypi.org --trusted-host files.pythonhost.org \ - install -U pip==20.2.1 setuptools==49.3.0 -./nncc docker-run "${NNCC_INSTALL_PREFIX}/bin/venv/bin/python" \ - -m pip --default-timeout=1000 --trusted-host pypi.org --trusted-host files.pythonhost.org \ - install tensorflow-cpu==2.3.0 +if [ -z ${RELEASE_VERSION} ] || [ ${RELEASE_VERSION} == "nightly" ]; then + ./nncc docker-run /bin/bash -c \ + 'dch -v $(${PWD}/${NNCC_INSTALL_PREFIX}/bin/one-version)~$(date "+%y%m%d%H") "nightly release" -D $(lsb_release --short --codename)' + ./nncc docker-run dch -r '' +fi -mkdir -p ${ARCHIVE_PATH} -tar -zcf ${ARCHIVE_PATH}/nncc-package.tar.gz -C ${NNCC_INSTALL_PREFIX} --exclude "bin/venv" ./ -tar -zcf ${ARCHIVE_PATH}/nncc-venv-package.tar.gz -C ${NNCC_INSTALL_PREFIX} bin/venv +./nncc docker-run debuild --preserve-env --no-lintian -us -uc \ + -b --buildinfo-option=-ubuild --changes-option=-ubuild popd > /dev/null diff --git a/infra/scripts/docker_build_test_x64.sh b/infra/scripts/docker_build_test_x64.sh deleted file mode 100755 index 16fcf3fa7..000000000 --- a/infra/scripts/docker_build_test_x64.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -set -e - -pushd $ROOT_PATH > /dev/null - -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -# Disable nnpackage_run build: mismatch between buildtool for CI and installed hdf5 -CMD="export OPTIONS='-DBUILD_NNPACKAGE_RUN=OFF' && \ - export BUILD_TYPE=Release && \ - cp -nv Makefile.template Makefile && \ - make all install build_test_suite" -./nnfw docker-run bash -c "$CMD" - -# Model download server setting -if [[ -z $MODELFILE_SERVER ]]; then - echo "Need model file server setting" - exit 1 -fi - -export DOCKER_ENV_VARS=" -e MODELFILE_SERVER=$MODELFILE_SERVER" -./nnfw docker-run-user ./infra/scripts/test_ubuntu_runtime.sh --backend cpu -./nnfw docker-run-user ./infra/scripts/test_ubuntu_runtime.sh --interp - -popd > /dev/null diff --git a/infra/scripts/docker_build_tizen_cross.sh b/infra/scripts/docker_build_tizen_cross.sh deleted file mode 100755 index ee0f183f1..000000000 --- a/infra/scripts/docker_build_tizen_cross.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# prepare rootfs -if [ -z "$ROOTFS_DIR" ] || [ ! -d $ROOTFS_DIR ]; then - echo "It will use default rootfs path" -else - DOCKER_VOLUMES+=" -v $ROOTFS_DIR:/opt/rootfs" - DOCKER_ENV_VARS+=" -e ROOTFS_DIR=/opt/rootfs" -fi - -# mount volume (or directory) for externals -if [ -n "$EXTERNAL_VOLUME" ]; then - DOCKER_VOLUMES+=" -v $EXTERNAL_VOLUME:/externals" - DOCKER_ENV_VARS+=" -e EXTERNAL_VOLUME=/externals" -else - echo "It will use default external path" -fi - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -DOCKER_ENV_VARS+=" -e TARGET_ARCH=armv7l" -DOCKER_ENV_VARS+=" -e CROSS_BUILD=1" -DOCKER_ENV_VARS+=" -e TARGET_OS=tizen" -DOCKER_ENV_VARS+=" -e BUILD_TYPE=release" - -# Mirror server setting -if [[ -z $EXTERNAL_DOWNLOAD_SERVER ]]; then - echo "It will not use mirror server" -fi - -set -e - -pushd $ROOT_PATH > /dev/null - -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -CMD="export OPTIONS+=' -DGENERATE_RUNTIME_NNAPI_TESTS=ON' && \ - cp -nv Makefile.template Makefile && \ - make all install build_test_suite" -./nnfw docker-run bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/docker_build_tizen_gbs.sh b/infra/scripts/docker_build_tizen_gbs.sh deleted file mode 100755 index 2d508f4c7..000000000 --- a/infra/scripts/docker_build_tizen_gbs.sh +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/bash - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -GBS_RPM_DIR=$ROOT_PATH/Product/out/rpm -mkdir -p $GBS_RPM_DIR -DOCKER_VOLUMES=" -v $GBS_RPM_DIR:/opt/rpm" - -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name for tizen gbs build" - DOCKER_IMAGE_NAME="nnfw_docker_tizen" -fi - -DOCKER_ENV_VARS=" --privileged" - -set -e - -pushd $ROOT_PATH > /dev/null - -CMD="gbs -c $ROOT_PATH/infra/nnfw/config/gbs.conf build \ - -A armv7l --profile=profile.tizen --clean --include-all --define '$GBS_DEFINE' && \ - cp -rf /home/GBS-ROOT/local/repos/tizen/armv7l/RPMS/*.rpm /opt/rpm/" - -export DOCKER_ENV_VARS -export DOCKER_VOLUMES -./nnfw docker-run bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/docker_collect_nnpkg_resources.sh b/infra/scripts/docker_collect_nnpkg_resources.sh index 55adaa15d..8a73dd380 100755 --- a/infra/scripts/docker_collect_nnpkg_resources.sh +++ b/infra/scripts/docker_collect_nnpkg_resources.sh @@ -28,18 +28,20 @@ else fi # prepare tensorflow -if [ -d $TENSORFLOW_PREFIX ]; then +if [ -n "$TENSORFLOW_PREFIX" ]; then DOCKER_OPTS+=" -v $TENSORFLOW_PREFIX:/opt/tensorflow" CONFIG_OPTIONS+=" -DTENSORFLOW_PREFIX=/opt/tensorflow" fi # prepare onnx -if [ -d $ONNXRUNTIME_PREFIX ]; then +if [ -n "$ONNXRUNTIME_PREFIX" ]; then DOCKER_OPTS+=" -v $ONNXRUNTIME_PREFIX:/opt/onnxruntime" CONFIG_OPTIONS+=" -DONNXRUNTIME_PREFIX=/opt/onnxruntime" fi # docker image name +# - for bionic, use DOCKER_IMAGE_NAME="nnfw/one-devtools:bionic" +# - for focal, use DOCKER_IMAGE_NAME="nnfw/one-devtools:focal" if [[ -z $DOCKER_IMAGE_NAME ]]; then echo "It will use default docker image name" fi @@ -59,16 +61,19 @@ pushd $ROOT_PATH > /dev/null REQUIRED_UNITS=() # Common Libraries -REQUIRED_UNITS+=("angkor" "cwrap" "pepper-str" "pepper-strcast" "pp" "stdex") -REQUIRED_UNITS+=("oops" "safemain" "foder" "arser" "vconone") +REQUIRED_UNITS+=("angkor" "cwrap" "pepper-str" "pepper-strcast" "pp") +REQUIRED_UNITS+=("pepper-csv2vec") +REQUIRED_UNITS+=("oops" "safemain" "foder" "crew" "arser" "vconone") # Hermes Logging Framework REQUIRED_UNITS+=("hermes" "hermes-std") # loco IR and related utilities REQUIRED_UNITS+=("loco" "locop" "locomotiv" "logo-core" "logo") +# Compute +REQUIRED_UNITS+=("luci-compute") # Circle compiler library (.circle -> .circle) REQUIRED_UNITS+=("luci") # Flatbuffer I/O -REQUIRED_UNITS+=("mio-tflite" "mio-circle") +REQUIRED_UNITS+=("mio-tflite280" "mio-circle05" "mio-tflite2121" "mio-circle06") # Tools REQUIRED_UNITS+=("tflite2circle" "circle2circle" "luci-interpreter") REQUIRED_UNITS+=("souschef" "tflchef" "circlechef" "circle-verify") diff --git a/infra/scripts/docker_coverage_report.sh b/infra/scripts/docker_coverage_report.sh deleted file mode 100755 index 677462d63..000000000 --- a/infra/scripts/docker_coverage_report.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash - -# coverage test data: ${ARCHIVE_PATH}/coverage-data.tar.gz - -[[ "${BASH_SOURCE[0]}" != "${0}" ]] && echo "Please don't source ${BASH_SOURCE[0]}, execute it" && return - -CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -ROOT_PATH="$CURRENT_PATH/../../" - -# docker image name -if [[ -z $DOCKER_IMAGE_NAME ]]; then - echo "It will use default docker image name" -fi - -NNAS_WORKSPACE=${NNAS_WORKSPACE:-build} -if [[ -z "${ARCHIVE_PATH}" ]]; then - ARCHIVE_PATH=${NNAS_WORKSPACE}/archive -fi - -set -e - -pushd $ROOT_PATH > /dev/null - -tar -zxf ${ARCHIVE_PATH}/coverage-data.tar.gz - -CMD="GCOV_PATH=arm-linux-gnueabihf-gcov NNAS_WORKSPACE=Product ./nnas gen-coverage-report runtime compute && - tar -zcf coverage/coverage_report.tar.gz coverage/html && - python runtime/3rdparty/lcov-to-cobertura-xml/lcov_cobertura.py coverage/coverage.info -o coverage/nnfw_coverage.xml" - -./nnfw docker-run-user bash -c "$CMD" - -popd > /dev/null diff --git a/infra/scripts/test_arm_nnpkg.sh b/infra/scripts/test_arm_nnpkg.sh index d00eb730f..74fae6bd8 100755 --- a/infra/scripts/test_arm_nnpkg.sh +++ b/infra/scripts/test_arm_nnpkg.sh @@ -10,7 +10,4 @@ do NNPackageTest ${BACKEND} "Product/out/test/list/nnpkg_test_list.armv7l-linux.${BACKEND}" done -# Interpreter test -export DISABLE_COMPILE=1 -NNPackageTest "interp" "Product/out/test/list/nnpkg_test_list.noarch.interp" unset DISABLE_COMPILE diff --git a/infra/scripts/test_coverage.sh b/infra/scripts/test_coverage.sh index 12a9942ab..97043ceed 100755 --- a/infra/scripts/test_coverage.sh +++ b/infra/scripts/test_coverage.sh @@ -6,7 +6,7 @@ set -eo pipefail source "$(dirname "${BASH_SOURCE[0]}")/common.sh" -CheckTestPrepared +pushd $ROOT_PATH > /dev/null NNAS_WORKSPACE=${NNAS_WORKSPACE:-build} if [[ -z "${ARCHIVE_PATH}" ]]; then @@ -14,30 +14,27 @@ if [[ -z "${ARCHIVE_PATH}" ]]; then echo "Default archive directory including nncc package and resources: ${ARCHIVE_PATH}" fi -pushd $ROOT_PATH > /dev/null - tar -zxf ${ARCHIVE_PATH}/coverage-suite.tar.gz -C ./ +CheckTestPrepared + if [[ ! -e $ROOT_PATH/tests/scripts/build_path_depth.txt ]]; then echo "Cannot find prefix strip file" exit 1 fi export GCOV_PREFIX_STRIP=`cat $ROOT_PATH/tests/scripts/build_path_depth.txt` -./infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --tflite-loader +TENSOR_LOGGING=trace_log.txt ./infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --nnapi-frontend ./infra/scripts/test_ubuntu_runtime.sh --backend acl_neon ./infra/scripts/test_ubuntu_runtime.sh --backend cpu # Enable all logs (mixed backend) -TENSOR_LOGGING=trace_log.txt ONERT_LOG_ENABLE=1 GRAPH_DOT_DUMP=1 ./infra/scripts/test_ubuntu_runtime_mixed.sh +ONERT_LOG_ENABLE=1 GRAPH_DOT_DUMP=1 ./infra/scripts/test_ubuntu_runtime_mixed.sh # Enable trace event (acl_cl default backend) export TRACE_FILEPATH=trace.json -TFLiteModelVerification "acl_cl" "Product/out/test/list/frameworktest_list.armv7l.acl_cl.txt" "report/acl_cl/trace" +TFLiteModelVerification "acl_cl" "Product/out/test/list/tflite_comparator.armv7l.acl_cl.list" "report/acl_cl/trace" unset TRACE_FILEPATH -# Interpreter -./infra/scripts/test_ubuntu_runtime.sh --interp - # nnpackage test suite if [[ -e ${ARCHIVE_PATH}/nnpkg-test-suite.tar.gz ]]; then tar -zxf ${ARCHIVE_PATH}/nnpkg-test-suite.tar.gz -C ./ diff --git a/infra/scripts/test_ubuntu_npud.sh b/infra/scripts/test_ubuntu_npud.sh new file mode 100755 index 000000000..3b3304240 --- /dev/null +++ b/infra/scripts/test_ubuntu_npud.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +set -eo pipefail + +CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +ROOT_PATH="$(cd ${CURRENT_PATH}/../../ && pwd)" + +# Install path on CI +INSTALL_PATH="$ROOT_PATH/Product/out" +MODEL_PATH="${INSTALL_PATH}/npud-gtest/models" + +# Install dbus configuration file +DBUS_CONF="${INSTALL_PATH}/share/org.tizen.npud.conf" +mkdir -p /usr/share/dbus-1/system.d/ +cp ${DBUS_CONF} /usr/share/dbus-1/system.d/ + +service dbus restart + +function TestPrepared() +{ + if [[ -z "${MODELFILE}" ]]; then + echo "Model file is not set. Try to use default setting." + exit 1 + fi + + mkdir -p ${MODEL_PATH} + if [[ "${MODELFILE: -7}" == ".tar.gz" ]]; then + curl -o model.tar.gz -kLsSO ${MODELFILE} + tar -zxf model.tar.gz -C ${MODEL_PATH} + else + echo "The file format is not supported." + echo "Supported format: tar.gz" + exit 1 + fi +} + +function TestCleanUp() +{ + rm -rf ${MODEL_PATH} +} + +function NpudTest() +{ + pushd ${ROOT_PATH} > /dev/null + + $INSTALL_PATH/npud-gtest/npud_gtest + EXITCODE=$? + if [ ${EXITCODE} -ne 0 ]; then + exit ${EXITCODE} + fi + + popd > /dev/null +} + +TestPrepared + +DEVICE_MODULE_PATH=${INSTALL_PATH}/lib GTEST_MODEL_PATH=${MODEL_PATH} NpudTest + +TestCleanUp diff --git a/infra/scripts/test_ubuntu_runtime.sh b/infra/scripts/test_ubuntu_runtime.sh index f250df5a0..9a98e5bd3 100755 --- a/infra/scripts/test_ubuntu_runtime.sh +++ b/infra/scripts/test_ubuntu_runtime.sh @@ -3,11 +3,10 @@ set -eo pipefail source "$(dirname "${BASH_SOURCE[0]}")/common.sh" +: ${TEST_ARCH:=$(uname -m | tr '[:upper:]' '[:lower:]')} BACKEND="cpu" -TEST_ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') TEST_OS="linux" TEST_PLATFORM="$TEST_ARCH-$TEST_OS" -TFLITE_LOADER="0" LINEAR_ONLY="0" RUN_INTERP="0" @@ -17,7 +16,6 @@ function Usage() echo "" echo "Options:" echo " --backend <BACKEND> Runtime backend to test (default: ${BACKEND})" - echo " --tflite-loader Enable TFLite Loader test" echo " --linear-only Use Linear executor only" } @@ -37,18 +35,10 @@ do BACKEND=$(echo ${1#*=} | tr '[:upper:]' '[:lower:]') shift ;; - --tflite-loader) - TFLITE_LOADER="1" - shift - ;; --linear-only) LINEAR_ONLY="1" shift ;; - --interp) - RUN_INTERP="1" - shift; - ;; *) # Ignore shift @@ -58,52 +48,26 @@ done CheckTestPrepared -if [ $RUN_INTERP = "1" ]; then - TEST_PLATFORM="noarch" - TEST_ARCH="noarch" - BACKEND="interp" - echo "[[ Interpreter test ]]" -else - echo "[[ ${TEST_PLATFORM}: ${BACKEND} backend test ]]" -fi +echo "[[ ${TEST_PLATFORM}: ${BACKEND} backend test ]]" -UNITTEST_SKIPLIST="Product/out/unittest/nnapi_gtest.skip.${TEST_PLATFORM}.${BACKEND}" -FRAMEWORK_TESTLIST="Product/out/test/list/frameworktest_list.${TEST_ARCH}.${BACKEND}.txt" +UNITTEST_SKIPLIST="Product/out/nnapi-gtest/nnapi_gtest.skip.${TEST_PLATFORM}.${BACKEND}" +TFLITE_TESTLIST="Product/out/test/list/tflite_comparator.${TEST_ARCH}.${BACKEND}.list" REPORT_BASE="report/${BACKEND}" EXECUTORS=("Linear" "Dataflow" "Parallel") if [ $LINEAR_ONLY = "1" ]; then EXECUTORS=("Linear") fi -if [ $RUN_INTERP = "1" ]; then - EXECUTORS=("Interpreter") -fi for EXECUTOR in "${EXECUTORS[@]}"; do echo "[EXECUTOR]: ${EXECUTOR}" REPORT_PATH="${REPORT_BASE}/${EXECUTOR}" - if [ $EXECUTOR = "Interpreter" ]; then - export DISABLE_COMPILE=1 - BACKEND="" - else - export EXECUTOR="${EXECUTOR}" - fi + export EXECUTOR="${EXECUTOR}" NNAPIGTest "${BACKEND}" "${UNITTEST_SKIPLIST}" "${REPORT_PATH}" - TFLiteModelVerification "${BACKEND}" "${FRAMEWORK_TESTLIST}" "${REPORT_PATH}" + TFLiteModelVerification "${BACKEND}" "${TFLITE_TESTLIST}" "${REPORT_PATH}" - if [ $EXECUTOR = "Interpreter" ]; then - unset DISABLE_COMPILE - else - unset EXECUTOR - fi + unset EXECUTOR done - -# Current support acl_cl backend testlist only -# TODO Support more backends -TFLITE_LOADER_TESTLIST="Product/out/test/list/tflite_loader_list.${TEST_ARCH}.txt" -if [[ $TFLITE_LOADER = "1" ]]; then - TFLiteLoaderTest "${BACKEND}" "${TFLITE_LOADER_TESTLIST}" "${REPORT_BASE}/loader/${EXECUTOR}" -fi diff --git a/infra/scripts/test_ubuntu_runtime_mixed.sh b/infra/scripts/test_ubuntu_runtime_mixed.sh index 24fde8896..a6fd2a41d 100755 --- a/infra/scripts/test_ubuntu_runtime_mixed.sh +++ b/infra/scripts/test_ubuntu_runtime_mixed.sh @@ -6,7 +6,7 @@ source "$(dirname "${BASH_SOURCE[0]}")/common.sh" CheckTestPrepared # TODO Get argument for mix configuration -TEST_ARCH=$(uname -m | tr '[:upper:]' '[:lower:]') +: ${TEST_ARCH:=$(uname -m | tr '[:upper:]' '[:lower:]')} TEST_OS="linux" # nnfw_api_gtest @@ -17,8 +17,7 @@ pushd ${ROOT_PATH} > /dev/null echo "" echo "==== Run standalone unittest begin ====" echo "" -Product/out/test/onert-test prepare-model --model=nnpackage -Product/out/test/onert-test unittest --unittestdir=Product/out/unittest_standalone +Product/out/test/onert-test unittest --unittestdir=Product/out/unittest echo "" echo "==== Run standalone unittest end ====" echo "" @@ -33,14 +32,14 @@ popd > /dev/null BACKENDS=(acl_cl acl_neon cpu) # Get the intersect of framework test list files -TESTLIST_PREFIX="Product/out/test/list/frameworktest_list.${TEST_ARCH}" -SKIPLIST_PREFIX="Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}" -sort $TESTLIST_PREFIX.${BACKENDS[0]}.txt > $TESTLIST_PREFIX.intersect.txt +TESTLIST_PREFIX="Product/out/test/list/tflite_comparator.${TEST_ARCH}" +SKIPLIST_PREFIX="Product/out/nnapi-gtest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}" +sort $TESTLIST_PREFIX.${BACKENDS[0]}.list > $TESTLIST_PREFIX.intersect.list sort $SKIPLIST_PREFIX.${BACKENDS[0]} > $SKIPLIST_PREFIX.union for BACKEND in "${BACKENDS[@]:1}"; do - comm -12 <(sort $TESTLIST_PREFIX.intersect.txt) <(sort $TESTLIST_PREFIX.$BACKEND.txt) > $TESTLIST_PREFIX.intersect.next.txt + comm -12 <(sort $TESTLIST_PREFIX.intersect.list) <(sort $TESTLIST_PREFIX.$BACKEND.list) > $TESTLIST_PREFIX.intersect.next.list comm <(sort $SKIPLIST_PREFIX.union) <(sort $SKIPLIST_PREFIX.$BACKEND) | tr -d "[:blank:]" > $SKIPLIST_PREFIX.union.next - mv $TESTLIST_PREFIX.intersect.next.txt $TESTLIST_PREFIX.intersect.txt + mv $TESTLIST_PREFIX.intersect.next.list $TESTLIST_PREFIX.intersect.list mv $SKIPLIST_PREFIX.union.next $SKIPLIST_PREFIX.union done popd > /dev/null @@ -56,8 +55,9 @@ echo "GeneratedTests.squeeze_relaxed" >> $SKIPLIST_PREFIX.union # Run the test export OP_BACKEND_Conv2D="cpu" -export OP_BACKEND_MaxPool2D="acl_cl" -export OP_BACKEND_AvgPool2D="acl_neon" +export OP_BACKEND_Pool2D="acl_cl" +export OP_BACKEND_FullyConnected="acl_neon" export ACL_LAYOUT="NCHW" -NNAPIGTest "acl_cl;acl_neon;cpu" "Product/out/unittest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}.union" "report/mixed" -TFLiteModelVerification "acl_cl;acl_neon;cpu" "${TESTLIST_PREFIX}.intersect.txt" "report/mixed" +export RUY_THREADS=4 +NNAPIGTest "acl_cl;acl_neon;cpu" "Product/out/nnapi-gtest/nnapi_gtest.skip.${TEST_ARCH}-${TEST_OS}.union" "report/mixed" +TFLiteModelVerification "acl_cl;acl_neon;cpu" "${TESTLIST_PREFIX}.intersect.list" "report/mixed" diff --git a/infra/scripts/tizen_xu4_test.sh b/infra/scripts/tizen_xu4_test.sh index 05e55848c..5610756b7 100755 --- a/infra/scripts/tizen_xu4_test.sh +++ b/infra/scripts/tizen_xu4_test.sh @@ -25,26 +25,18 @@ function install_model() { # download tflite model files pushd $HOST_HOME - tests/scripts/models/run_test.sh --download=on --run=off + TEMP_PATH=$(mktemp -d) + CACHE_PATH=$TEMP_PATH/cache + mkdir -p $CACHE_PATH + ./nnfw prepare-model --cachedir=$CACHE_PATH # TODO Since this command removes model file(.zip), # We must always download the file unlike model file(.tflite). # Because caching applies only to tflite file. - find tests -name "*.zip" -exec rm {} \; - tar -zcf cache.tar.gz -C tests/scripts/models cache - $SDB_CMD push cache.tar.gz $TEST_ROOT/. - rm -rf cache.tar.gz - $SDB_CMD shell tar -zxf $TEST_ROOT/cache.tar.gz -C $TEST_ROOT/Product/out/test/models - - # download api test model file for nnfw_api_gtest - MODEL_CACHE_DIR=$(mktemp -d) - tests/scripts/models/run_test.sh --download=on --run=off \ - --configdir=tests/scripts/models/nnfw_api_gtest \ - --cachedir=$MODEL_CACHE_DIR - tar -zcf $MODEL_CACHE_DIR/api_model_test.tar.gz -C $MODEL_CACHE_DIR . - $SDB_CMD push $MODEL_CACHE_DIR/api_model_test.tar.gz $TEST_ROOT/Product/out/unittest_standalone/nnfw_api_gtest_models/ - $SDB_CMD shell tar -zxf $TEST_ROOT/Product/out/unittest_standalone/nnfw_api_gtest_models/api_model_test.tar.gz \ - -C $TEST_ROOT/Product/out/unittest_standalone/nnfw_api_gtest_models/ - rm -rf $MODEL_CACHE_DIR + find $CACHE_PATH -name "*.zip" -exec rm {} \; + tar -zcf $TEMP_PATH/cache.tar.gz -C $TEMP_PATH cache + $SDB_CMD push $TEMP_PATH/cache.tar.gz $TEST_ROOT/ + rm -rf $TEMP_PATH + $SDB_CMD shell tar -zxf $TEST_ROOT/cache.tar.gz -C $TEST_ROOT/Product/out/test popd } @@ -160,11 +152,10 @@ if [ $RUN_TEST = "0" ]; then fi if [ -z "${GCOV_DIR}" ]; then - ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --tflite-loader" - ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_neon" - ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend cpu" - ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime_mixed.sh" - ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --interp" + ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --tflite-loader" + ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_neon" + ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend cpu" + ${SDB_CMD} shell /bin/bash -c "IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime_mixed.sh" else mkdir -p ${GCOV_DIR} rm -rf ${GCOV_DIR}/* @@ -176,11 +167,10 @@ else GCOV_DATA_PATH="/opt/usr/nnfw-gcov" # TODO For coverage check, we run acl_cl and mixed test - ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --tflite-loader" - ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_neon" - ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend cpu" - ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime_mixed.sh" - ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --interp" + ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_cl --tflite-loader" + ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend acl_neon" + ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime.sh --backend cpu" + ${SDB_CMD} shell /bin/bash -c "GCOV_PREFIX_STRIP=${GCOV_PREFIX_STRIP} IGNORE_MD5=1 TEST_ARCH=armv7l ${TEST_ROOT}/infra/scripts/test_ubuntu_runtime_mixed.sh" # More test to check coverage ${SDB_CMD} shell "rm -rf ${GCOV_DATA_PATH} && mkdir -p ${GCOV_DATA_PATH}" diff --git a/infra/scripts/unittest_compiler_xml.sh b/infra/scripts/unittest_compiler_xml.sh index 46d3bc813..6e9e8ad7f 100755 --- a/infra/scripts/unittest_compiler_xml.sh +++ b/infra/scripts/unittest_compiler_xml.sh @@ -7,7 +7,9 @@ set -eo pipefail CURRENT_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" ROOT_PATH="$CURRENT_PATH/../../" NNCC_WORKSPACE=${NNCC_WORKSPACE:-${ROOT_PATH}build} -UNITTEST_REPORT_DIR=${NNCC_WORKSPACE}/unittest_compiler_xml + +# Use fixed absolute report dir for CI +UNITTEST_REPORT_DIR=${ROOT_PATH}build/unittest_compiler_xml for i in "$@" do @@ -25,5 +27,10 @@ fi for TEST_BIN in `find ${NNCC_WORKSPACE}/compiler -type f -executable -name *_test`; do TEST_NAME="$(basename -- $TEST_BIN)" - LUGI_LOG=999 $TEST_BIN --gtest_output="xml:$UNITTEST_REPORT_DIR/$TEST_NAME.xml" + TEST_DIR="$(dirname $TEST_BIN)" + + # Execute on test directory to find related file + pushd $TEST_DIR > /dev/null + LUGI_LOG=999 ./$TEST_NAME --gtest_output="xml:$UNITTEST_REPORT_DIR/$TEST_NAME.xml" + popd > /dev/null done |