Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into emscripten-presubmit
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Sep 26, 2022
2 parents eca5e19 + 8eb7399 commit 2ae9c8f
Show file tree
Hide file tree
Showing 419 changed files with 14,178 additions and 4,789 deletions.
15 changes: 10 additions & 5 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ on:
runner-env:
required: true
type: string
gcs-dir:
required: true
type: string
build-dir:
required: true
type: string
Expand All @@ -41,6 +38,14 @@ on:
required: true
type: string

env:
# This duplicates the variable from ci.yml. The variable needs to be in env
# instead of the outputs of setup because it contains the run attempt and we
# want that to be the current attempt, not whatever attempt the setup step
# last ran in. It therefore can't be passed in via inputs because the env
# context isn't available there.
GCS_DIR: gs://iree-github-actions-${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }}-artifacts/${{ github.run_id }}/${{ github.run_attempt }}

jobs:
build_suites:
runs-on:
Expand Down Expand Up @@ -89,7 +94,7 @@ jobs:
target:
- platform: "riscv"
architecture: "rv64"
docker_image: "gcr.io/iree-oss/riscv@sha256:720bc0215d8462ea14352edc22710a6ce4c0c1daff581d179dd173885f1d8a35"
docker_image: "gcr.io/iree-oss/riscv@sha256:d6f0e293a50faf5abbd564c1d1bb9dc6456d7ce93d07b131c381fa64c1daed62"
outputs:
benchmark-tools-gcs-artifacts: ${{ toJSON(steps.upload.outputs) }}
env:
Expand Down Expand Up @@ -141,7 +146,7 @@ jobs:
id: upload
env:
BENCHMARK_TOOLS_ARCHIVE: ${{ steps.archive.outputs.benchmark-tools-archive }}
BENCHMARK_TOOLS_GCS_ARTIFACT: ${{ inputs.gcs-dir }}/${{ steps.archive.outputs.benchmark-tools-archive }}
BENCHMARK_TOOLS_GCS_ARTIFACT: ${{ env.GCS_DIR }}/${{ steps.archive.outputs.benchmark-tools-archive }}
run: |
gcloud alpha storage cp "${BENCHMARK_TOOLS_ARCHIVE}" "${BENCHMARK_TOOLS_GCS_ARTIFACT}"
echo "::set-output name=${PLATFORM}-${ARCHITECTURE}-benchmark-tools-gcs-artifact::${BENCHMARK_TOOLS_GCS_ARTIFACT}"
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ env:
# See note above regarding lack of proper variables. Also see note about
# pseudo-ternary hack.
_CI_STAGE: ${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }}
# This needs to be in env instead of the outputs of setup because it contains
# the run attempt and we want that to be the current attempt, not whatever
# attempt the setup step last ran in.
GCS_DIR: gs://iree-github-actions-${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }}-artifacts/${{ github.run_id }}/${{ github.run_attempt }}

# Jobs are organized into groups and topologically sorted by dependencies
jobs:
Expand All @@ -68,7 +72,6 @@ jobs:
should-run: ${{ steps.should-run.outputs.should-run }}
# Variables for dependent jobs. See comment at top.
runner-env: prod
gcs-dir: gs://iree-github-actions-${{ env._CI_STAGE }}-artifacts/${{ github.run_id }}/${{ github.run_attempt }}
runner-group: ${{ env._CI_STAGE }}
# Note that we can't flip the condition here because 0 is falsey. See
# comment at top.
Expand Down Expand Up @@ -151,7 +154,7 @@ jobs:
id: upload
env:
BUILD_DIR_ARCHIVE: ${{ steps.archive.outputs.build-dir-archive }}
BUILD_DIR_GCS_ARTIFACT: ${{ needs.setup.outputs.gcs-dir }}/${{ steps.archive.outputs.build-dir-archive }}
BUILD_DIR_GCS_ARTIFACT: ${{ env.GCS_DIR }}/${{ steps.archive.outputs.build-dir-archive }}
run: |
gcloud alpha storage cp "${BUILD_DIR_ARCHIVE}" "${BUILD_DIR_GCS_ARTIFACT}"
echo "::set-output name=build-dir-gcs-artifact::${BUILD_DIR_GCS_ARTIFACT}"
Expand Down Expand Up @@ -180,7 +183,7 @@ jobs:
run: |
./build_tools/github_actions/docker_run.sh \
--env "IREE_BAZEL_WRITE_REMOTE_CACHE=${IREE_BAZEL_WRITE_REMOTE_CACHE}" \
gcr.io/iree-oss/frontends-swiftshader@sha256:41e516b8c1b432e3c02896c4bf4b7f06df6a67371aa167b88767b8d4d2018ea6 \
gcr.io/iree-oss/frontends-swiftshader@sha256:3d5b879672d7f302124ab3d1aa533a6949bd0adfc176884177844ac6767e23e9 \
./build_tools/bazel/build_core.sh
test_all:
Expand Down Expand Up @@ -343,7 +346,7 @@ jobs:
./build_tools/github_actions/docker_run.sh \
--env "IREE_BAZEL_WRITE_REMOTE_CACHE=${IREE_BAZEL_WRITE_REMOTE_CACHE}" \
--env "IREE_TF_BINARIES_OUTPUT_DIR=${IREE_TF_BINARIES_OUTPUT_DIR}" \
gcr.io/iree-oss/frontends-swiftshader@sha256:3090418a8d8a64c356d35eff285af32570a72f41127aa123209c1562f57abb01 \
gcr.io/iree-oss/frontends-swiftshader@sha256:3d5b879672d7f302124ab3d1aa533a6949bd0adfc176884177844ac6767e23e9 \
build_tools/cmake/build_tf_binaries.sh
echo "::set-output name=binaries-dir::${IREE_TF_BINARIES_OUTPUT_DIR}"
- name: "Creating archive of binaries"
Expand All @@ -358,7 +361,7 @@ jobs:
id: upload
env:
BINARIES_ARCHIVE: ${{ steps.archive.outputs.binaries-archive }}
BINARIES_GCS_ARTIFACT: ${{ needs.setup.outputs.gcs-dir }}/${{ steps.archive.outputs.binaries-archive }}
BINARIES_GCS_ARTIFACT: ${{ env.GCS_DIR }}/${{ steps.archive.outputs.binaries-archive }}
run: |
gcloud alpha storage cp "${BINARIES_ARCHIVE}" "${BINARIES_GCS_ARTIFACT}"
echo "::set-output name=binaries-gcs-artifact::${BINARIES_GCS_ARTIFACT}"
Expand Down Expand Up @@ -398,7 +401,7 @@ jobs:
- name: "Running TF integrations tests"
run: |
./build_tools/github_actions/docker_run.sh \
gcr.io/iree-oss/frontends-swiftshader@sha256:3090418a8d8a64c356d35eff285af32570a72f41127aa123209c1562f57abb01 \
gcr.io/iree-oss/frontends-swiftshader@sha256:3d5b879672d7f302124ab3d1aa533a6949bd0adfc176884177844ac6767e23e9 \
build_tools/cmake/run_tf_tests.sh \
"${BUILD_DIR}"
Expand Down Expand Up @@ -440,7 +443,7 @@ jobs:
--env IREE_LLVM_CPU_DISABLE=1 \
--gpus all \
--env NVIDIA_DRIVER_CAPABILITIES=all \
gcr.io/iree-oss/frontends-nvidia@sha256:e934ed09e9e60c28ebe11a02f37a993dd975db40118d410c4279d0fa2d4e6b9a \
gcr.io/iree-oss/frontends-nvidia@sha256:28cd43f36b1ca0633bbd915911abe6d22b4aa16093f074e87016305322a0eba1 \
bash -euo pipefail -c \
"./build_tools/scripts/check_cuda.sh
./build_tools/scripts/check_vulkan.sh
Expand Down Expand Up @@ -494,9 +497,10 @@ jobs:
if: needs.setup.outputs.should-run == 'true'
uses: ./.github/workflows/benchmarks.yml
with:
# env.GCS_DIR is also duplicated in this workflow. See the note there on
# why this is.
runner-group: ${{ needs.setup.outputs.runner-group }}
runner-env: ${{ needs.setup.outputs.runner-env }}
gcs-dir: ${{ needs.setup.outputs.gcs-dir }}
build-dir: ${{ needs.build_all.outputs.build-dir }}
build-dir-archive: ${{ needs.build_all.outputs.build-dir-archive }}
build-dir-gcs-artifact: ${{ needs.build_all.outputs.build-dir-gcs-artifact }}
Expand Down Expand Up @@ -536,7 +540,7 @@ jobs:
build_tools/github_actions/docker_run.sh \
--env "ANDROID_ABI=${ANDROID_ABI}" \
--env "IREE_HOST_BINARY_ROOT=${BUILD_DIR}/install" \
gcr.io/iree-oss/android@sha256:9bc723fc707a18bd0c1be9c12e01ea5bb7c7d77f607427879e10ffcffd7d2bb5 \
gcr.io/iree-oss/android@sha256:76c2a52dcd6d07601227b965ac87d021c1d2d5e2d01f46ad58da28c89267f2ab \
build_tools/cmake/build_android.sh
riscv32:
Expand Down Expand Up @@ -570,7 +574,7 @@ jobs:
--env "BUILD_RISCV_DIR=${BUILD_RISCV_DIR}" \
--env "BUILD_PRESET=test" \
--env "IREE_HOST_BINARY_ROOT=${BUILD_DIR}/install" \
gcr.io/iree-oss/riscv@sha256:720bc0215d8462ea14352edc22710a6ce4c0c1daff581d179dd173885f1d8a35 \
gcr.io/iree-oss/riscv@sha256:d6f0e293a50faf5abbd564c1d1bb9dc6456d7ce93d07b131c381fa64c1daed62 \
bash -euo pipefail -c \
"./build_tools/cmake/build_riscv.sh && tests/riscv32/smoke.sh"
Expand Down Expand Up @@ -614,7 +618,7 @@ jobs:
--env "IREE_HOST_BINARY_ROOT=${BUILD_DIR}/install" \
--env "IREE_IMPORT_TFLITE_BIN=${TF_BINARIES_DIR}/iree-import-tflite" \
--env "LLVM_BIN_DIR=${BUILD_DIR}/third_party/llvm-project/llvm/bin" \
gcr.io/iree-oss/riscv@sha256:720bc0215d8462ea14352edc22710a6ce4c0c1daff581d179dd173885f1d8a35 \
gcr.io/iree-oss/riscv@sha256:d6f0e293a50faf5abbd564c1d1bb9dc6456d7ce93d07b131c381fa64c1daed62 \
bash -euo pipefail -c \
"./build_tools/cmake/build_riscv.sh && ./build_tools/cmake/test_riscv64.sh"
Expand Down
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ option(IREE_BUILD_MICROBENCHMARKS "Builds IREE microbenchmark suites." OFF)
option(IREE_BUILD_EXPERIMENTAL_REMOTING "Builds experimental remoting support." OFF)
option(IREE_BUILD_EXPERIMENTAL_VMVX_MMT4D "Enables MMT4D methods in the VMVX module." OFF)
option(IREE_BUILD_EXPERIMENTAL_WEB_SAMPLES "Builds experimental web samples." OFF)
option(IREE_BUILD_EXPERIMENTAL_PYTHON_GENERATED_BENCHMARKS "Builds IREE benchmark suites generated by the python benchmark framework." OFF)

#-------------------------------------------------------------------------------
# Runtime HAL Driver Options
Expand Down Expand Up @@ -368,6 +369,7 @@ include(iree_benchmark_suite)
include(iree_microbenchmark_suite)
include(iree_hal_cts_test_suite)
include(iree_static_linker_test)
include(iree_fetch_artifact)

set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

Expand Down Expand Up @@ -703,7 +705,7 @@ endif()
# IREE top-level targets
#-------------------------------------------------------------------------------

if(IREE_BUILD_BENCHMARKS)
if(IREE_BUILD_BENCHMARKS OR IREE_BUILD_EXPERIMENTAL_PYTHON_GENERATED_BENCHMARKS)
# Add top-level custom targets to drive generating benchmark suites.

# iree-benchmark-import-models imports benchmark models from their source
Expand Down Expand Up @@ -746,7 +748,7 @@ add_subdirectory(build_tools/embed_data/)
# Note: Test deps are not built as part of all (use the iree-test-deps target).
add_subdirectory(tests EXCLUDE_FROM_ALL)

if(IREE_BUILD_BENCHMARKS)
if(IREE_BUILD_BENCHMARKS OR IREE_BUILD_EXPERIMENTAL_PYTHON_GENERATED_BENCHMARKS)
find_program(IREE_IMPORT_TFLITE_PATH iree-import-tflite)
if(IREE_IMPORT_TFLITE_PATH)
message(STATUS "Found ${IREE_IMPORT_TFLITE_PATH} to generate benchmark artifacts")
Expand Down Expand Up @@ -829,6 +831,12 @@ set(IREE_PUBLIC_INCLUDE_DIRS "${IREE_COMMON_INCLUDE_DIRS}"

add_subdirectory(build_tools/benchmarks)

#-------------------------------------------------------------------------------
# IREE build tools python modules
#-------------------------------------------------------------------------------

add_subdirectory(build_tools/python)

#-------------------------------------------------------------------------------
# Samples
#-------------------------------------------------------------------------------
Expand Down
4 changes: 4 additions & 0 deletions benchmarks/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
iree_add_all_subdirs()

if (IREE_BUILD_EXPERIMENTAL_PYTHON_GENERATED_BENCHMARKS)
include(generated_benchmark_suites.cmake)
endif()
4 changes: 2 additions & 2 deletions benchmarks/TFLite/android-adreno.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ iree_benchmark_suite(
"GPU-Adreno"
COMPILATION_FLAGS
${ANDROID_ADRENO_GPU_COMPILATION_FLAGS}
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
BENCHMARK_TOOL
iree-benchmark-module
CONFIG
Expand Down Expand Up @@ -129,7 +129,7 @@ iree_benchmark_suite(
"GPU-Adreno"
COMPILATION_FLAGS
${ANDROID_ADRENO_GPU_COMPILATION_FLAGS}
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
"--iree-hal-benchmark-dispatch-repeat-count=16"
BENCHMARK_TOOL
iree-benchmark-module
Expand Down
8 changes: 4 additions & 4 deletions benchmarks/TFLite/android-mali.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ iree_benchmark_suite(
"GPU-Mali-Valhall"
COMPILATION_FLAGS
${ANDROID_MALI_GPU_COMPILATION_FLAGS}
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
BENCHMARK_TOOL
iree-benchmark-module
CONFIG
Expand All @@ -140,7 +140,7 @@ iree_benchmark_suite(
"--iree-input-type=tosa"
"--iree-flow-demote-f32-to-f16"
"--iree-vulkan-target-triple=valhall-unknown-android31"
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
BENCHMARK_TOOL
iree-benchmark-module
CONFIG
Expand Down Expand Up @@ -180,7 +180,7 @@ iree_benchmark_suite(
"GPU-Mali-Valhall"
COMPILATION_FLAGS
${ANDROID_MALI_GPU_COMPILATION_FLAGS}
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
"--iree-hal-benchmark-dispatch-repeat-count=32"
BENCHMARK_TOOL
iree-benchmark-module
Expand Down Expand Up @@ -209,7 +209,7 @@ iree_benchmark_suite(
"--iree-input-type=tosa"
"--iree-flow-demote-f32-to-f16"
"--iree-vulkan-target-triple=valhall-unknown-android31"
"--iree-flow-enable-fuse-padding-into-consumer-ops"
"--iree-flow-enable-fuse-padding-into-linalg-consumer-ops"
"--iree-hal-benchmark-dispatch-repeat-count=32"
BENCHMARK_TOOL
iree-benchmark-module
Expand Down
Loading

0 comments on commit 2ae9c8f

Please sign in to comment.