aboutsummaryrefslogtreecommitdiff
path: root/examples/gemm_tuner/benchmark_gemm_examples.sh
diff options
context:
space:
mode:
authorEren Kopuz <eren.kopuz@arm.com>2020-07-13 12:37:06 +0100
committerEren Kopuz <eren.kopuz@arm.com>2020-07-16 10:53:41 +0000
commit6977b378174af882750fc58020258077c4875056 (patch)
tree14fe72a33d4857d56fa34c10a9aaa209255bd3cd /examples/gemm_tuner/benchmark_gemm_examples.sh
parent534fdeaabbf3052a133e366f17634e5dd8c26498 (diff)
downloadComputeLibrary-6977b378174af882750fc58020258077c4875056.tar.gz
COMPMID-3549: Add support for data type in bash and python scripts
- Bash script allows option for selecting data type which is passed to benchmark example - Python script parses data type from results and reports as part of GEMMParam Change-Id: I4202a2ce0a9b87b0bd8be5c26bb3027fe72aaaf4 Signed-off-by: Eren Kopuz <eren.kopuz@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/3560 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com>
Diffstat (limited to 'examples/gemm_tuner/benchmark_gemm_examples.sh')
-rwxr-xr-xexamples/gemm_tuner/benchmark_gemm_examples.sh16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/gemm_tuner/benchmark_gemm_examples.sh b/examples/gemm_tuner/benchmark_gemm_examples.sh
index 175e0fad07..e8025538ae 100755
--- a/examples/gemm_tuner/benchmark_gemm_examples.sh
+++ b/examples/gemm_tuner/benchmark_gemm_examples.sh
@@ -36,6 +36,9 @@ EXAMPLE_BIN_NATIVE="benchmark_cl_gemm_native"
EXAMPLE_BIN_RESHAPED_RHS_ONLY="benchmark_cl_gemm_reshaped_rhs_only"
EXAMPLE_BIN_RESHAPED="benchmark_cl_gemm_reshaped"
+# Default data type
+DEFAULT_DATA_TYPE="F32"
+
# Default output directory
DEFAULT_OUT_DIR="out"
@@ -233,6 +236,10 @@ Options:
-c <gemm_config_file>
Path to gemm config csv file
+ -d <data_type>
+ Data type option with which to run benchmark examples
+ Default: ${DEFAULT_DATA_TYPE}
+
-o <out_dir>
Path to output directory that holds output json files
Default: ${DEFAULT_OUT_DIR}
@@ -350,9 +357,9 @@ function run() {
while read gemm_config
do
# Ignore empty lines and lines starting with # (comments)
- if echo "$gemm_shape" | grep -Eq "$match_expression" && echo "$gemm_config" | grep -Pq "$match_expression";then
+ if echo "$gemm_shape" | grep -Eq "$match_expression" && echo "$gemm_config" | grep -Eq "$match_expression";then
echo "Running..." 1>&2
- example_args="${gemm_shape},${gemm_config}"
+ example_args="${gemm_shape},${gemm_config},--type=${DATA_TYPE}"
# Run experiment
${EXAMPLE_BIN_DIR}/${example_bin} --example_args=${example_args} --iterations=${NUM_ITERATION} --json-file=${OUT_DIR}/${expr_count}.${OUT_EXTENSION} --instruments=OPENCL_TIMER_MS
# Print progress
@@ -411,6 +418,8 @@ GEMM_SHAPES_FILE=""
# Path to gemm configs file
GEMM_CONFIGS_FILE=""
STRATEGY_OPTION=""
+# Data type to use
+DATA_TYPE=${DEFAULT_DATA_TYPE}
# Path to output directory
OUT_DIR=${DEFAULT_OUT_DIR}
# Output benchmark result file extension
@@ -419,13 +428,14 @@ OUT_EXTENSION="gemmtuner_benchmark"
HELP=false
# Obtain options
-while getopts "hs:e:g:c:o:" opt; do
+while getopts "hs:e:g:c:d:o:" opt; do
case "$opt" in
h) HELP=true ;;
s) STRATEGY_OPTION=$(to_lower "${OPTARG}");;
e) EXAMPLE_BIN_DIR="${OPTARG}";;
g) GEMM_SHAPES_FILE="${OPTARG}";;
c) GEMM_CONFIGS_FILE="${OPTARG}";;
+ d) DATA_TYPE="${OPTARG}";;
o) OUT_DIR="${OPTARG}";;
esac
done