blob: a849e0f0fdb1a1f48321841ec048336d35b46a02 [file] [log] [blame]
Jerry Wuc59155f2022-06-01 23:46:18 +00001# 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 Todd33a7caa2022-06-10 10:47:10 -070013# benchmarks only configure IREE compilation and runtime flags for the target #
Jerry Wuc59155f2022-06-01 23:46:18 +000014# architecture and do *not* include any non-default flags. No non-default #
15# flags should be added here. #
16# #
17################################################################################
18
Scott Todd33a7caa2022-06-10 10:47:10 -070019set(ANDROID_MALI_GPU_COMPILATION_FLAGS
Jerry Wuc59155f2022-06-01 23:46:18 +000020 "--iree-input-type=tosa"
Lei Zhang915977b2022-09-02 18:08:02 -040021 "--iree-vulkan-target-triple=valhall-unknown-android31"
Jerry Wuc59155f2022-06-01 23:46:18 +000022)
23
24# GPU, Vulkan, Mali, full-inference
25iree_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 Todd33a7caa2022-06-10 10:47:10 -070043 COMPILATION_FLAGS
44 ${ANDROID_MALI_GPU_COMPILATION_FLAGS}
Jerry Wuc59155f2022-06-01 23:46:18 +000045 BENCHMARK_TOOL
46 iree-benchmark-module
Ben Vanik33aa8b32022-06-07 11:06:15 -070047 CONFIG
48 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +000049 DRIVER
50 "vulkan"
51)
52
53# GPU, Vulkan, Mali, full-inference
54iree_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 Todd33a7caa2022-06-10 10:47:10 -070067 COMPILATION_FLAGS
68 ${ANDROID_MALI_GPU_COMPILATION_FLAGS}
Jerry Wuc59155f2022-06-01 23:46:18 +000069 # 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 Vanik33aa8b32022-06-07 11:06:15 -070074 CONFIG
75 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +000076 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
97iree_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 Todd33a7caa2022-06-10 10:47:10 -0700115 COMPILATION_FLAGS
116 ${ANDROID_MALI_GPU_COMPILATION_FLAGS}
Han-Chung Wangcaa78422022-09-21 06:45:51 +0800117 "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
Jerry Wuc59155f2022-06-01 23:46:18 +0000118 BENCHMARK_TOOL
119 iree-benchmark-module
Ben Vanik33aa8b32022-06-07 11:06:15 -0700120 CONFIG
121 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +0000122 DRIVER
123 "vulkan"
124)
125
126iree_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 Todd33a7caa2022-06-10 10:47:10 -0700139 COMPILATION_FLAGS
Jerry Wuc59155f2022-06-01 23:46:18 +0000140 "--iree-input-type=tosa"
141 "--iree-flow-demote-f32-to-f16"
Lei Zhang915977b2022-09-02 18:08:02 -0400142 "--iree-vulkan-target-triple=valhall-unknown-android31"
Han-Chung Wangcaa78422022-09-21 06:45:51 +0800143 "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
Jerry Wuc59155f2022-06-01 23:46:18 +0000144 BENCHMARK_TOOL
145 iree-benchmark-module
Ben Vanik33aa8b32022-06-07 11:06:15 -0700146 CONFIG
147 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +0000148 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
163iree_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 Todd33a7caa2022-06-10 10:47:10 -0700181 COMPILATION_FLAGS
182 ${ANDROID_MALI_GPU_COMPILATION_FLAGS}
Han-Chung Wangcaa78422022-09-21 06:45:51 +0800183 "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
Jerry Wuc59155f2022-06-01 23:46:18 +0000184 "--iree-hal-benchmark-dispatch-repeat-count=32"
185 BENCHMARK_TOOL
186 iree-benchmark-module
Ben Vanik33aa8b32022-06-07 11:06:15 -0700187 CONFIG
188 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +0000189 DRIVER
190 "vulkan"
191 RUNTIME_FLAGS
192 "--batch_size=32"
193)
194
195iree_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 Todd33a7caa2022-06-10 10:47:10 -0700208 COMPILATION_FLAGS
Jerry Wuc59155f2022-06-01 23:46:18 +0000209 "--iree-input-type=tosa"
210 "--iree-flow-demote-f32-to-f16"
Lei Zhang915977b2022-09-02 18:08:02 -0400211 "--iree-vulkan-target-triple=valhall-unknown-android31"
Han-Chung Wangcaa78422022-09-21 06:45:51 +0800212 "--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
Jerry Wuc59155f2022-06-01 23:46:18 +0000213 "--iree-hal-benchmark-dispatch-repeat-count=32"
214 BENCHMARK_TOOL
215 iree-benchmark-module
Ben Vanik33aa8b32022-06-07 11:06:15 -0700216 CONFIG
217 "iree-vulkan"
Jerry Wuc59155f2022-06-01 23:46:18 +0000218 DRIVER
219 "vulkan"
220 RUNTIME_FLAGS
221 "--batch_size=32"
222)
223
224################################################################################