From ca9244fe25797ce0da5056a24199890ab0ecabb7 Mon Sep 17 00:00:00 2001 From: mariecwhite Date: Mon, 13 Nov 2023 02:05:26 +0000 Subject: [PATCH] Run benchmarks on Pixel-8-Pro --- .github/workflows/run_mobile_comparative_benchmark.yml | 8 ++++---- experimental/iree/benchmark_iree_android.sh | 2 +- experimental/iree/compile_workloads.py | 2 +- experimental/iree/compile_workloads.sh | 2 ++ experimental/tflite/benchmark_tflite_android.sh | 5 ++++- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run_mobile_comparative_benchmark.yml b/.github/workflows/run_mobile_comparative_benchmark.yml index 0fe68e79..b90e189d 100644 --- a/.github/workflows/run_mobile_comparative_benchmark.yml +++ b/.github/workflows/run_mobile_comparative_benchmark.yml @@ -315,7 +315,7 @@ jobs: - os-family=Linux env: BENCHMARK_ARTIFACTS_DIR: android-benchmark-artifacts-dir - TARGET_DEVICE: pixel-6-pro + TARGET_DEVICE: pixel-8-pro IREE_INSTALL_DIR: ${{ needs.build_iree.outputs.iree-install-dir }} IREE_INSTALL_DIR_ARCHIVE: ${{ needs.build_iree.outputs.iree-install-dir-archive }} IREE_INSTALL_DIR_GCS_ARTIFACT: ${{ needs.build_iree.outputs.iree-install-dir-gcs-artifact }} @@ -364,17 +364,17 @@ jobs: echo "benchmark-artifacts-dir-gcs-artifact=${BENCHMARK_ARTIFACTS_DIR_GCS_ARTIFACT}" >> "${GITHUB_OUTPUT}" - benchmark_on_pixel-6-pro: + benchmark_on_pixel-8-pro: needs: [setup, build_iree, compile_models_for_android, build_tflite] runs-on: - self-hosted # must come first - runner-group=${{ needs.setup.outputs.runner-group }} - environment=prod - - machine-type=pixel-6-pro + - machine-type=pixel-8-pro env: BENCHMARK_GCS_DIR: ${{ needs.setup.outputs.benchmark-gcs-dir }} RESULTS_DIR: results-dir - TARGET_DEVICE: pixel-6-pro + TARGET_DEVICE: pixel-8-pro IREE_ANDROID_TOOLS_DIR: ${{ needs.build_iree.outputs.iree-android-tools-dir }} IREE_ANDROID_TOOLS_DIR_ARCHIVE: ${{ needs.build_iree.outputs.iree-android-tools-dir-archive }} IREE_ANDROID_TOOLS_DIR_GCS_ARTIFACT: ${{ needs.build_iree.outputs.iree-android-tools-dir-gcs-artifact }} diff --git a/experimental/iree/benchmark_iree_android.sh b/experimental/iree/benchmark_iree_android.sh index f308343a..f94ff88d 100755 --- a/experimental/iree/benchmark_iree_android.sh +++ b/experimental/iree/benchmark_iree_android.sh @@ -72,7 +72,7 @@ fi "${TD}/../../comparative_benchmark/scripts/create_results_json.sh" "${OUTPUT_PATH}" # A num_threads to cpu_ids map. We use the biggest cores for each configuration. -THREAD_CONFIG="{1: '0', 4: '0,1,2,3'}" +THREAD_CONFIG="{1: '0', 4: '1,2,3,4', 5: '0,1,2,3,4'}" "${TD}/run_benchmarks.py" \ --target_device="${TARGET_DEVICE}" \ diff --git a/experimental/iree/compile_workloads.py b/experimental/iree/compile_workloads.py index 50a039bd..f52f495e 100755 --- a/experimental/iree/compile_workloads.py +++ b/experimental/iree/compile_workloads.py @@ -30,7 +30,7 @@ IREE_COMPILE_COMMON_FLAGS = [ "--iree-hal-target-backends=llvm-cpu", - "--iree-llvmcpu-link-embedded=false", + "--iree-llvmcpu-link-embedded=true", "--iree-input-demote-f64-to-f32=false", "--iree-input-demote-i64-to-i32=false", "--iree-llvmcpu-debug-symbols=false", diff --git a/experimental/iree/compile_workloads.sh b/experimental/iree/compile_workloads.sh index e1024ec2..eb633737 100755 --- a/experimental/iree/compile_workloads.sh +++ b/experimental/iree/compile_workloads.sh @@ -65,6 +65,8 @@ if [ "${TARGET_DEVICE_NAME}" = "c2-standard-60" ]; then BENCHMARK_NAMES=("${CASCADE_LAKE_BENCHMARKS[@]}") elif [ "${TARGET_DEVICE_NAME}" = "pixel-6-pro" ]; then BENCHMARK_NAMES=("${ANDROID_BENCHMARKS[@]}") +elif [ "${TARGET_DEVICE_NAME}" = "pixel-8-pro" ]; then + BENCHMARK_NAMES=("${ANDROID_BENCHMARKS[@]}") else echo "Unsupported target device ${TARGET_DEVICE}." exit 1 diff --git a/experimental/tflite/benchmark_tflite_android.sh b/experimental/tflite/benchmark_tflite_android.sh index 06d68b88..6f2a0721 100755 --- a/experimental/tflite/benchmark_tflite_android.sh +++ b/experimental/tflite/benchmark_tflite_android.sh @@ -69,7 +69,7 @@ declare -a BENCHMARK_NAMES=( # Thread-to-taskset config. Here we run 1 thread on the largest core, and 4 threads on the 4 largest (2 big, 2 medium) cores. # Assumes the benchmarks run on Pixel-6-Pro. -THREAD_CONFIG="{1: '80', 4: 'F0'}" +THREAD_CONFIG="{1: '80', 4: 'F0', 5: '1F0'}" ITERATIONS=5 for benchmark_name in "${BENCHMARK_NAMES[@]}"; do @@ -83,3 +83,6 @@ for benchmark_name in "${BENCHMARK_NAMES[@]}"; do --root_dir="${ROOT_DIR}" \ --verbose done + +# Cleanup. +adb shell rm -rf "${ROOT_DIR}"