blob: 45af65555865c1c2a953f3d2fa653a11cd782452 [file]
# Copyright 2022 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
steps:
- label: ":hammer_and_wrench: Build"
key: "build"
commands: |
docker run --user=$(id -u):$(id -g) \
--volume="$${HOME?}:$${HOME?}" \
--volume="/etc/passwd:/etc/passwd:ro" \
--volume="/etc/group:/etc/group:ro" \
--volume="$$PWD:$$IREE_DOCKER_WORKDIR" \
--workdir="$$IREE_DOCKER_WORKDIR" \
--rm \
gcr.io/iree-oss/frontends@sha256:7a7a6d2fce60f3db82bfd2f18316231f9e4662cd9307b079d5adfbb6e119b817 \
build_tools/cmake/build_linux_benchmark.sh
tar --exclude="*.tar.gz" \
--exclude="*.tgz" \
--exclude="*.mlir" \
--exclude="*.tflite" \
--exclude="*-tf-model" \
-czvf "benchmark-suites-$${BUILDKITE_BUILD_NUMBER}.tgz" \
build-host/benchmark_suites build-host/.ninja_log
find build-host/benchmark_suites -name "*.mlir" | \
tar -czvf "source-mlir-models-$${BUILDKITE_BUILD_NUMBER}.tgz" -T -
tar -czvf "iree-linux-x86_64-tools-$${BUILDKITE_BUILD_NUMBER}.tgz" \
build-linux-x86_64/tools/iree-benchmark-module \
build-linux-x86_64/tools/build_config.txt
if: "build.pull_request.id == null || (build.pull_request.labels includes 'buildkite:benchmark-x86_64')"
agents:
- "queue=build"
env:
IREE_DOCKER_WORKDIR: "/usr/src/github/iree"
artifact_paths:
- "benchmark-suites-${BUILDKITE_BUILD_NUMBER}.tgz"
- "source-mlir-models-${BUILDKITE_BUILD_NUMBER}.tgz"
- "iree-linux-x86_64-tools-${BUILDKITE_BUILD_NUMBER}.tgz"
- wait
- label: ":stopwatch: Benchmark on Intel Cascade Lake CPU (GCP-c2-standard-16)"
commands: |
git clean -fdx
buildkite-agent artifact download --step \
build "benchmark-suites-$${BUILDKITE_BUILD_NUMBER}.tgz" ./
buildkite-agent artifact download --step \
build "iree-linux-x86_64-tools-$${BUILDKITE_BUILD_NUMBER}.tgz" ./
tar -xzvf "benchmark-suites-$${BUILDKITE_BUILD_NUMBER}.tgz"
tar -xzvf "iree-linux-x86_64-tools-$${BUILDKITE_BUILD_NUMBER}.tgz"
python3 build_tools/benchmarks/run_benchmarks_on_linux.py \
--device_model=GCP-c2-standard-16 \
--cpu_uarch=CascadeLake \
--normal_benchmark_tool_dir=build-linux-x86_64/tools/ \
-o "benchmark-results-gcp-cpu-$${BUILDKITE_BUILD_NUMBER}.json" \
--verbose \
build-host/
if: "build.pull_request.id == null || (build.pull_request.labels includes 'buildkite:benchmark-x86_64')"
agents:
- "gcp:machine-type=c2-standard-16"
- "queue=benchmark-x86_64"
artifact_paths:
- "benchmark-results-gcp-cpu-${BUILDKITE_BUILD_NUMBER}.json"
timeout_in_minutes: "10"
- label: "Collect compilation statistics"
commands: |
git clean -fdx
buildkite-agent artifact download --step build \
"benchmark-suites-$${BUILDKITE_BUILD_NUMBER}.tgz" ./
tar -xzvf "benchmark-suites-$${BUILDKITE_BUILD_NUMBER}.tgz"
python3 build_tools/benchmarks/collect_compilation_statistics.py \
--verbose \
--output "compile-stats-results-linux-$${BUILDKITE_BUILD_NUMBER}.json" \
build-host/
if: "build.pull_request.id == null || (build.pull_request.labels includes 'buildkite:benchmark-x86_64')"
agents:
- "queue=build"
artifact_paths:
- "compile-stats-results-linux-${BUILDKITE_BUILD_NUMBER}.json"
timeout_in_minutes: "10"
- wait
- label: ":lower_left_crayon: Comment benchmark results on pull request"
commands: |
git clean -fdx
buildkite-agent artifact download "benchmark-results-*.json" ./
buildkite-agent artifact download "compile-stats-results-*.json" ./
python3 build_tools/benchmarks/post_benchmarks_as_pr_comment.py \
--verbose \
--query-base \
--comment-title="Abbreviated x86_64 Benchmark Summary (experimental)" \
--benchmark_files benchmark-results-*.json \
--compile_stats_files compile-stats-results-*.json
key: "post-on-pr-x86_64"
if: "build.pull_request.id != null && (build.pull_request.labels includes 'buildkite:benchmark-x86_64')"
agents:
- "queue=report"
- label: ":lower_left_crayon: Push benchmark results to dashboard"
commands: |
git clean -fdx
buildkite-agent artifact download "benchmark-results-*.json" ./
buildkite-agent artifact download "compile-stats-results-*.json" ./
python3 build_tools/benchmarks/upload_benchmarks_to_dashboard.py \
--verbose \
--benchmark_files benchmark-results-*.json \
--compile_stats_files compile-stats-results-*.json
key: "upload-to-dashboard-x86_64"
branches: "main"
agents:
- "queue=report"