| # Copyright 2021 Google LLC |
| # |
| # 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 |
| # |
| # https://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. |
| |
| steps: |
| - label: "build" |
| commands: |
| - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:15d3266ae4865f7642a4ef4d76e5181f0dc3482a7cfba9021b6b55be524208ec build_tools/kokoro/gcp_ubuntu/cmake/android/build.sh arm64-v8a" |
| - "gsutil cp gs://iree-model-artifacts/iree-mobile-bert-artifacts-6fe4616e0ab9958eb18f368960a31276f1362029.tar.gz ." |
| - "gsutil cp gs://iree-model-artifacts/mobilenet-v2.tar.gz ." |
| - "tar -xzf iree-mobile-bert-artifacts-6fe4616e0ab9958eb18f368960a31276f1362029.tar.gz" |
| - "tar -xzf mobilenet-v2.tar.gz" |
| - "docker run --user=$(id -u):$(id -g) --volume=\\$PWD:\\$IREE_DOCKER_WORKDIR --workdir=\\$IREE_DOCKER_WORKDIR --rm gcr.io/iree-oss/cmake-android@sha256:15d3266ae4865f7642a4ef4d76e5181f0dc3482a7cfba9021b6b55be524208ec python3 build_tools/mako/compile_android_modules.py" |
| - "cp tmp/iree/modules/MobileBertSquad/iree_vmla/traces/serving_default/flagfile mobile-bert_flagfile" |
| - "cp mobilenet-v2/flagfile mobilenet-v2_flagfile" |
| - "tar -czvf model-Pixel4-artifacts.tgz build-android/iree/tools/iree-benchmark-module *Pixel4*.vmfb" |
| - "tar -czvf model-S20-artifacts.tgz build-android/iree/tools/iree-benchmark-module *S20*.vmfb" |
| - "tar -czvf flagfiles.tgz *_flagfile" |
| agents: |
| - "build=true" |
| env: |
| IREE_DOCKER_WORKDIR: "/usr/src/github/iree" |
| artifact_paths: |
| - "model-Pixel4-artifacts.tgz" |
| - "model-S20-artifacts.tgz" |
| - "flagfiles.tgz" |
| |
| - wait |
| |
| - label: "benchmark on Pixel 4 (snapdragon-855, adreno-640)" |
| commands: |
| - "buildkite-agent artifact download --step build model-Pixel4-artifacts.tgz ./" |
| - "buildkite-agent artifact download --step build flagfiles.tgz ./" |
| - "tar xzvf model-Pixel4-artifacts.tgz" |
| - "tar xzvf flagfiles.tgz" |
| - "adb shell mkdir -p /data/local/tmp/benchmark_tmpdir" |
| - "adb push build-android/iree/tools/iree-benchmark-module /data/local/tmp/benchmark_tmpdir" |
| - "adb push *.vmfb /data/local/tmp/benchmark_tmpdir" |
| - "adb push *_flagfile /data/local/tmp/benchmark_tmpdir" |
| - "python3 build_tools/mako/benchmark_modules_on_android.py --git_hash=$(git rev-parse HEAD) Pixel4" |
| - "adb shell rm -rf /data/local/tmp/benchmark_tmpdir" |
| agents: |
| - "android-soc=snapdragon-855" |
| - "android-version=11" |
| - "queue=benchmark-android" |
| env: |
| IREE_DOCKER_WORKDIR: "/usr/src/github/iree" |
| artifact_paths: "mako-*.log" |
| timeout_in_minutes: "15" |
| |
| - label: "benchmark on Galaxy S20 (exynos-990, mali-g77)" |
| commands: |
| - "buildkite-agent artifact download --step build model-S20-artifacts.tgz ./" |
| - "buildkite-agent artifact download --step build flagfiles.tgz ./" |
| - "tar xzvf model-S20-artifacts.tgz" |
| - "tar xzvf flagfiles.tgz" |
| - "adb shell mkdir -p /data/local/tmp/benchmark_tmpdir" |
| - "adb push build-android/iree/tools/iree-benchmark-module /data/local/tmp/benchmark_tmpdir" |
| - "adb push *.vmfb /data/local/tmp/benchmark_tmpdir" |
| - "adb push *_flagfile /data/local/tmp/benchmark_tmpdir" |
| - "python3 build_tools/mako/benchmark_modules_on_android.py --git_hash=$(git rev-parse HEAD) S20" |
| - "adb shell rm -rf /data/local/tmp/benchmark_tmpdir" |
| agents: |
| - "android-soc=exynos-990" |
| - "android-version=11" |
| - "queue=benchmark-android" |
| env: |
| IREE_DOCKER_WORKDIR: "/usr/src/github/iree" |
| artifact_paths: "mako-*.log" |
| timeout_in_minutes: "15" |
| |
| - wait |
| |
| - label: "upload data to Mako" |
| commands: |
| - "gsutil cp gs://iree-benchmark-artifacts/uploader ." |
| - "chmod +x uploader" |
| - "buildkite-agent artifact download mako-*.log ./" |
| - "ls mako-*.log | xargs -n 1 ./uploader --file_path" |
| - "rm mako-*.log" |
| agents: |
| - "test-android=false" |
| - "build=false" |
| - "mako-uploader=true" |
| - "test-desktop-gpu=false" |
| branches: "main" |