Skip to content

Commit

Permalink
Add job to build all benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
GMNGeoffrey committed Aug 8, 2022
1 parent 3bdae8c commit bf129ae
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ jobs:
run: |
build_tools/github_actions/docker_run.sh \
--env "IREE_TF_BINARIES_DIR=${TF_BINARIES_DIR}" \
gcr.io/iree-oss/base@sha256:bad174c580cdefaf435ce31a7df6bdd7f7cb7bfdcdff5d1acf40f630acf85bf5 \
gcr.io/iree-oss/base@sha256:5d43683c6b50aebe1fca6c85f2012f3b0fa153bf4dd268e8767b619b1891423a \
build_tools/build_benchmarks.sh \
"${BUILD_DIR}"
Expand All @@ -591,6 +591,7 @@ jobs:
- riscv32
- riscv64
- android_arm64
- build_benchmarks
if: always()
steps:
- name: Getting combined job status
Expand Down
42 changes: 42 additions & 0 deletions build_tools/cmake/build_benchmarks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

# Copyright 2019 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

# Build benchmark suites for IREE using an *already built* build directory.
# Designed for CI, but can be run locally.
# TODO(#4662): this should just allow passing in host tools.

set -xeuo pipefail

ROOT_DIR="${ROOT_DIR:-$(git rev-parse --show-toplevel)}"
cd "${ROOT_DIR}"

BUILD_DIR="${1:-${IREE_BUILD_DIR:-build}}"
CMAKE_BIN=${CMAKE_BIN:-$(which cmake)}
IREE_TF_BINARIES_DIR="${IREE_TF_BINARIES_DIR:-integrations/tensorflow/bazel-bin/iree_tf_compiler}"

"$CMAKE_BIN" --version
ninja --version

if ! [[ -d "${BUILD_DIR}" ]]; then
echo "Build directory '${BUILD_DIR}' does not exist. Aborting"
exit 1
fi

echo "Reconfiguring to enable benchmarks"
# Note that we're relying on CMake caching here
"${CMAKE_BIN}" -B "${BUILD_DIR}" \
-DIREE_BUILD_BENCHMARKS=ON \
-DIREE_BUILD_MICROBENCHMARKS=ON \
-DIREE_IMPORT_TFLITE_PATH="${IREE_TF_BINARIES_DIR}/iree-import-tflite" \
-DIREE_IMPORT_TF_PATH="${IREE_TF_BINARIES_DIR}/iree-import-tf"

echo "Building benchmark artifacts"
"${CMAKE_BIN}" --build . --target \
iree-benchmark-suites \
iree-microbenchmark-suites \
-- -k 0

0 comments on commit bf129ae

Please sign in to comment.