From f38c896a5926545dbf111a62d0fb9cd8468dfdfa Mon Sep 17 00:00:00 2001 From: Advait Jain Date: Fri, 13 Aug 2021 11:02:13 -0700 Subject: [PATCH] Only perform a build for the vision_p6 PR presubmit checks (do not run the tests) (#405) * Add option to only do a build for the vision_p6. BUG=http://b/196459172 * Only build for Vision P6 as part of presubmit checks. * make running the tests optional. * fix whitespace. * Address review comments. --- .github/workflows/xtensa.yml | 21 +++++++++++++--- .../tools/ci_build/test_xtensa_vision_p6.sh | 25 ++++++++++++++----- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/.github/workflows/xtensa.yml b/.github/workflows/xtensa.yml index b2fea50f..35117348 100644 --- a/.github/workflows/xtensa.yml +++ b/.github/workflows/xtensa.yml @@ -55,22 +55,37 @@ jobs: echo ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }} | docker login ghcr.io -u tflm-bot --password-stdin docker run --rm -v `pwd`:/opt/tflite-micro ghcr.io/tflm-bot/xtensa:0.1 /opt/tflite-micro/tensorflow/lite/micro/tools/ci_build/test_xtensa_hifi5.sh + vision_p6_presubmit: + runs-on: ubuntu-latest + + if: | + github.event_name == 'workflow_dispatch' || + (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:run')) + + name: Vision P6 Build (presubmit) + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - run: | + echo ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }} | docker login ghcr.io -u tflm-bot --password-stdin + docker run --rm -v `pwd`:/opt/tflite-micro ghcr.io/tflm-bot/xtensa:0.1 /opt/tflite-micro/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh + vision_p6_unit_tests: runs-on: ubuntu-latest if: | github.event_name == 'workflow_dispatch' || - (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'ci:run')) || (github.event_name == 'schedule' && github.repository == 'tensorflow/tflite-micro') - name: Vision P6 Unit Tests (presubmit) + name: Vision P6 Unit Tests (nightly) steps: - uses: actions/checkout@v2 with: ref: ${{ github.event.pull_request.head.sha }} - run: | echo ${{ secrets.TFLM_BOT_PACKAGE_READ_TOKEN }} | docker login ghcr.io -u tflm-bot --password-stdin - docker run --rm -v `pwd`:/opt/tflite-micro ghcr.io/tflm-bot/xtensa:0.1 /opt/tflite-micro/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh + docker run --rm -v `pwd`:/opt/tflite-micro ghcr.io/tflm-bot/xtensa:0.1 /opt/tflite-micro/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh RUN_TESTS hifi_3z_unit_tests: runs-on: ubuntu-latest diff --git a/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh b/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh index 3baa0001..6741977a 100755 --- a/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh +++ b/tensorflow/lite/micro/tools/ci_build/test_xtensa_vision_p6.sh @@ -28,9 +28,22 @@ readable_run make -f tensorflow/lite/micro/tools/make/Makefile clean # TODO(b/143904317): downloading first to allow for parallel builds. readable_run make -f tensorflow/lite/micro/tools/make/Makefile third_party_downloads -readable_run make -f tensorflow/lite/micro/tools/make/Makefile \ - TARGET=xtensa \ - TARGET_ARCH=vision_p6 \ - OPTIMIZED_KERNEL_DIR=xtensa \ - XTENSA_CORE=P6_200528 \ - test -j$(nproc) +# Since we currently do not have optimized kernel implemetations for vision_p6, +# running the tests (in particular person_detection_int8) takes a very long +# time. So, we have changed the default for this script to only perform a build +# and added an option to run all the tests when that is feasible. +if [[ ${1} == "RUN_TESTS" ]]; then + readable_run make -f tensorflow/lite/micro/tools/make/Makefile \ + TARGET=xtensa \ + TARGET_ARCH=vision_p6 \ + OPTIMIZED_KERNEL_DIR=xtensa \ + XTENSA_CORE=P6_200528 \ + test -j$(nproc) +else + readable_run make -f tensorflow/lite/micro/tools/make/Makefile \ + TARGET=xtensa \ + TARGET_ARCH=vision_p6 \ + OPTIMIZED_KERNEL_DIR=xtensa \ + XTENSA_CORE=P6_200528 \ + build -j$(nproc) +fi -- GitLab