Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 1 | # Copyright 2022 The IREE Authors |
| 2 | # |
| 3 | # Licensed under the Apache License v2.0 with LLVM Exceptions. |
| 4 | # See https://llvm.org/LICENSE.txt for license information. |
| 5 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | |
| 7 | ################################################################################ |
| 8 | # # |
| 9 | # Default benchmark configurations # |
| 10 | # # |
| 11 | # Each suite benchmarks a list of modules with configurations specifying a # |
| 12 | # target architecture and runtime characteristics (e.g. threads/cores). These # |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 13 | # benchmarks only configure IREE compilation and runtime flags for the target # |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 14 | # architecture and do *not* include any non-default flags. No non-default # |
| 15 | # flags should be added here. # |
| 16 | # # |
| 17 | ################################################################################ |
| 18 | |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 19 | set(ANDROID_MALI_GPU_COMPILATION_FLAGS |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 20 | "--iree-input-type=tosa" |
Lei Zhang | 915977b | 2022-09-02 18:08:02 -0400 | [diff] [blame] | 21 | "--iree-vulkan-target-triple=valhall-unknown-android31" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 22 | ) |
| 23 | |
| 24 | # GPU, Vulkan, Mali, full-inference |
| 25 | iree_benchmark_suite( |
| 26 | GROUP_NAME |
| 27 | "android-mali" |
| 28 | |
| 29 | MODULES |
| 30 | "${DEEPLABV3_FP32_MODULE}" |
| 31 | "${MOBILESSD_FP32_MODULE}" |
| 32 | "${POSENET_FP32_MODULE}" |
| 33 | "${MOBILEBERT_FP32_MODULE}" |
| 34 | "${MOBILENET_V2_MODULE}" |
| 35 | "${MOBILENET_V3SMALL_MODULE}" |
| 36 | |
| 37 | BENCHMARK_MODES |
| 38 | "full-inference,default-flags" |
| 39 | TARGET_BACKEND |
| 40 | "vulkan-spirv" |
| 41 | TARGET_ARCHITECTURE |
| 42 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 43 | COMPILATION_FLAGS |
| 44 | ${ANDROID_MALI_GPU_COMPILATION_FLAGS} |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 45 | BENCHMARK_TOOL |
| 46 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 47 | CONFIG |
| 48 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 49 | DRIVER |
| 50 | "vulkan" |
| 51 | ) |
| 52 | |
| 53 | # GPU, Vulkan, Mali, full-inference |
| 54 | iree_benchmark_suite( |
| 55 | GROUP_NAME |
| 56 | "android-mali" |
| 57 | |
| 58 | MODULES |
| 59 | "${MOBILEBERT_FP16_MODULE}" |
| 60 | |
| 61 | BENCHMARK_MODES |
| 62 | "full-inference,default-flags" |
| 63 | TARGET_BACKEND |
| 64 | "vulkan-spirv" |
| 65 | TARGET_ARCHITECTURE |
| 66 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 67 | COMPILATION_FLAGS |
| 68 | ${ANDROID_MALI_GPU_COMPILATION_FLAGS} |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 69 | # This isn't a special optimization flag. It's so we can reuse the same f32 |
| 70 | # model file. See comments on MOBILEBERT_FP16_MODULE |
| 71 | "--iree-flow-demote-f32-to-f16" |
| 72 | BENCHMARK_TOOL |
| 73 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 74 | CONFIG |
| 75 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 76 | DRIVER |
| 77 | "vulkan" |
| 78 | ) |
| 79 | |
| 80 | ################################################################################ |
| 81 | |
| 82 | ################################################################################ |
| 83 | # # |
| 84 | # Specialized benchmark configurations # |
| 85 | # # |
| 86 | # Each suite benchmarks one or more module with configurations that can vary # |
| 87 | # on model or architecture characteristics. These are intended for providing # |
| 88 | # continuous benchmarks of experimental features that cannot be turned on by # |
| 89 | # default yet. It is primarily intended for whoever is actively investigating # |
| 90 | # optimizations for a feature exemplified in a specific model or architecture. # |
| 91 | # Due to our current benchmark setup, there can only be one experimental # |
| 92 | # configuration per model and other benchmark mode. # |
| 93 | # # |
| 94 | ################################################################################ |
| 95 | |
| 96 | # GPU, Vulkan, Mali, full-inference |
| 97 | iree_benchmark_suite( |
| 98 | GROUP_NAME |
| 99 | "android-mali" |
| 100 | |
| 101 | MODULES |
| 102 | "${DEEPLABV3_FP32_MODULE}" |
| 103 | "${MOBILESSD_FP32_MODULE}" |
| 104 | "${POSENET_FP32_MODULE}" |
| 105 | "${MOBILEBERT_FP32_MODULE}" |
| 106 | "${MOBILENET_V2_MODULE}" |
| 107 | "${MOBILENET_V3SMALL_MODULE}" |
| 108 | |
| 109 | BENCHMARK_MODES |
| 110 | "full-inference,experimental-flags" |
| 111 | TARGET_BACKEND |
| 112 | "vulkan-spirv" |
| 113 | TARGET_ARCHITECTURE |
| 114 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 115 | COMPILATION_FLAGS |
| 116 | ${ANDROID_MALI_GPU_COMPILATION_FLAGS} |
Han-Chung Wang | caa7842 | 2022-09-21 06:45:51 +0800 | [diff] [blame] | 117 | "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 118 | BENCHMARK_TOOL |
| 119 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 120 | CONFIG |
| 121 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 122 | DRIVER |
| 123 | "vulkan" |
| 124 | ) |
| 125 | |
| 126 | iree_benchmark_suite( |
| 127 | GROUP_NAME |
| 128 | "android-mali" |
| 129 | |
| 130 | MODULES |
| 131 | "${MOBILEBERT_FP16_MODULE}" |
| 132 | |
| 133 | BENCHMARK_MODES |
| 134 | "full-inference,experimental-flags" |
| 135 | TARGET_BACKEND |
| 136 | "vulkan-spirv" |
| 137 | TARGET_ARCHITECTURE |
| 138 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 139 | COMPILATION_FLAGS |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 140 | "--iree-input-type=tosa" |
| 141 | "--iree-flow-demote-f32-to-f16" |
Lei Zhang | 915977b | 2022-09-02 18:08:02 -0400 | [diff] [blame] | 142 | "--iree-vulkan-target-triple=valhall-unknown-android31" |
Han-Chung Wang | caa7842 | 2022-09-21 06:45:51 +0800 | [diff] [blame] | 143 | "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 144 | BENCHMARK_TOOL |
| 145 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 146 | CONFIG |
| 147 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 148 | DRIVER |
| 149 | "vulkan" |
| 150 | ) |
| 151 | |
| 152 | # kernel-execution |
| 153 | |
| 154 | # Note that for kernel-execution benchmarks batch_size/repeat-count need to be |
| 155 | # low enough that the whole dispatch completes within an OS-specific timeout. |
| 156 | # Otherwise you'll get error like: |
| 157 | # ``` |
| 158 | # INTERNAL; VK_ERROR_DEVICE_LOST; vkQueueSubmit; while invoking native function |
| 159 | # hal.ex.submit_and_wait; while calling import; |
| 160 | # ``` |
| 161 | |
| 162 | # GPU, Vulkan, Mali, kernel-execution |
| 163 | iree_benchmark_suite( |
| 164 | GROUP_NAME |
| 165 | "android-mali" |
| 166 | |
| 167 | MODULES |
| 168 | "${DEEPLABV3_FP32_MODULE}" |
| 169 | "${MOBILESSD_FP32_MODULE}" |
| 170 | "${POSENET_FP32_MODULE}" |
| 171 | "${MOBILEBERT_FP32_MODULE}" |
| 172 | "${MOBILENET_V2_MODULE}" |
| 173 | "${MOBILENET_V3SMALL_MODULE}" |
| 174 | |
| 175 | BENCHMARK_MODES |
| 176 | "kernel-execution,experimental-flags" |
| 177 | TARGET_BACKEND |
| 178 | "vulkan-spirv" |
| 179 | TARGET_ARCHITECTURE |
| 180 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 181 | COMPILATION_FLAGS |
| 182 | ${ANDROID_MALI_GPU_COMPILATION_FLAGS} |
Han-Chung Wang | caa7842 | 2022-09-21 06:45:51 +0800 | [diff] [blame] | 183 | "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 184 | "--iree-hal-benchmark-dispatch-repeat-count=32" |
| 185 | BENCHMARK_TOOL |
| 186 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 187 | CONFIG |
| 188 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 189 | DRIVER |
| 190 | "vulkan" |
| 191 | RUNTIME_FLAGS |
| 192 | "--batch_size=32" |
| 193 | ) |
| 194 | |
| 195 | iree_benchmark_suite( |
| 196 | GROUP_NAME |
| 197 | "android-mali" |
| 198 | |
| 199 | MODULES |
| 200 | "${MOBILEBERT_FP16_MODULE}" |
| 201 | |
| 202 | BENCHMARK_MODES |
| 203 | "kernel-execution,experimental-flags" |
| 204 | TARGET_BACKEND |
| 205 | "vulkan-spirv" |
| 206 | TARGET_ARCHITECTURE |
| 207 | "GPU-Mali-Valhall" |
Scott Todd | 33a7caa | 2022-06-10 10:47:10 -0700 | [diff] [blame] | 208 | COMPILATION_FLAGS |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 209 | "--iree-input-type=tosa" |
| 210 | "--iree-flow-demote-f32-to-f16" |
Lei Zhang | 915977b | 2022-09-02 18:08:02 -0400 | [diff] [blame] | 211 | "--iree-vulkan-target-triple=valhall-unknown-android31" |
Han-Chung Wang | caa7842 | 2022-09-21 06:45:51 +0800 | [diff] [blame] | 212 | "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 213 | "--iree-hal-benchmark-dispatch-repeat-count=32" |
| 214 | BENCHMARK_TOOL |
| 215 | iree-benchmark-module |
Ben Vanik | 33aa8b3 | 2022-06-07 11:06:15 -0700 | [diff] [blame] | 216 | CONFIG |
| 217 | "iree-vulkan" |
Jerry Wu | c59155f | 2022-06-01 23:46:18 +0000 | [diff] [blame] | 218 | DRIVER |
| 219 | "vulkan" |
| 220 | RUNTIME_FLAGS |
| 221 | "--batch_size=32" |
| 222 | ) |
| 223 | |
| 224 | ################################################################################ |