Move "platforms" CI jobs into their own workflow files. (#17979)
This moves workflow jobs that build the full project (including the
compiler) from `ci.yml` to their own workflow files:
- `build_test_all_arm64` -->
`.github/workflows/ci_linux_arm64_clang.yml`
- `build_test_all_windows` -->
`.github/workflows/ci_windows_x86_msvc.yml`
- `build_test_all_macos_arm64` --> none
- `build_test_all_macos_x86_64` -->
`.github/workflows/ci_macos_x86_clang.yml`
With one workflow file per platform, these are the tradeoffs compared to
a single workflow file:
Pros:
+ Easy to tune which triggers affect each workflow
* See
https://github.com/Tencent/ncnn/blob/master/.github/workflows/windows-clang.yml
for some inspiration. Each workflow can independently define `paths:` to
trigger on. We have support for that via
[`build_tools/github_actions/configure_ci.py`](https://github.com/iree-org/iree/blob/main/build_tools/github_actions/configure_ci.py),
but this also allows for adjusting schedule triggers too.
+ Easy to fork a workflow for a new platform, less merge conflicts in a
single large file
+ Easy to cancel a single job without affecting others from the same
file
+ Easy to disable/enable a workflow in isolation from the UI if there
are runner issues
+ Low impact radius if/when a single platform has runner issues
Cons:
- If running on PRs, checks are spread out a lot
- Hard to mark multiple/all jobs as required checks (if we care)
- More code duplication between files (reusable workflows can help
here... maybe, could also lean on CMake presets and build scripts)
Practically at this point in time, these workflows _were_ running on all
commits pushed to the `main` branch but they were disabled for being too
slow or requiring runners that went offline. Now the workflows will run
on a nightly schedule and they can be disabled individually from the
GitHub UI as needed. TBD how we'll make these workflows available for
opt-in on presubmit. We could add the `pull_request` trigger back,
trigger if some labels are added, etc.
skip-ci: adding new workflows, existing ones are unaffected
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cc31ef1..4fed94f 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -65,185 +65,6 @@
write-caches: ${{ needs.setup.outputs.write-caches }}
run-tests: true
- # Disabled since we don't have any runners for arm64.
- # As of July 2024, GitHub has "large" arm64 runners available in beta at cost.
- # If these get included in the free/standard tier or if a project member
- # sponsors their use then we could re-enable this job.
- # build_test_all_arm64:
- # needs: setup
- # if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_arm64')
- # runs-on:
- # - self-hosted # must come first
- # - runner-group=${{ needs.setup.outputs.runner-group }}
- # - environment=${{ needs.setup.outputs.runner-env }}
- # - arm64
- # - os-family=Linux
- # env:
- # BUILD_DIR: build-arm64
- # steps:
- # - name: "Checking out repository"
- # uses: actions/checkout@v4.1.7
- # with:
- # submodules: true
- # - name: "Building IREE"
- # env:
- # IREE_WRITE_REMOTE_CCACHE: ${{ needs.setup.outputs.write-caches }}
- # run: |
- # ./build_tools/github_actions/docker_run.sh \
- # --env "IREE_CCACHE_GCP_TOKEN=$(gcloud auth application-default print-access-token)" \
- # --env "IREE_WRITE_REMOTE_CCACHE=${IREE_WRITE_REMOTE_CCACHE}" \
- # --env "CCACHE_NAMESPACE=gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59" \
- # --env "IREE_BUILD_SETUP_PYTHON_VENV=${BUILD_DIR}/.venv" \
- # gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \
- # ./build_tools/cmake/build_all.sh \
- # "${BUILD_DIR}"
- # - name: "Testing IREE"
- # run: |
- # ./build_tools/github_actions/docker_run.sh \
- # --env "IREE_ARM_SME_QEMU_AARCH64_BIN=/usr/bin/qemu-aarch64" \
- # gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \
- # ./build_tools/cmake/ctest_all.sh \
- # "${BUILD_DIR}"
-
- # Disabled since
- # * windows-2022 is too slow
- # * windows-2022-64core is too expensive (and takes ~8 minutes just to checkout the repo)
- # * we don't have self-hosted Windows runners with enough cores yet
- # build_test_all_windows:
- # needs: setup
- # if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_windows')
- # # TODO(saienduri): switch to self-hosted
- # runs-on: windows-2022
- # defaults:
- # run:
- # shell: bash
- # env:
- # BUILD_DIR: build-windows
- # steps:
- # - name: "Checking out repository"
- # uses: actions/checkout@v4.1.7
- # with:
- # submodules: true
- # - id: "gcp-auth"
- # name: "Authenticating to Google Cloud"
- # if: needs.setup.outputs.write-caches == 1
- # uses: "google-github-actions/auth@v1"
- # with:
- # token_format: "access_token"
- # credentials_json: "${{ secrets.IREE_OSS_GITHUB_RUNNER_BASIC_TRUST_SERVICE_ACCOUNT_KEY }}"
- # create_credentials_file: false
- # - name: "Setting up Python"
- # uses: actions/setup-python@v5.1.0
- # with:
- # python-version: "3.10" # Needs pybind >= 2.10.1 for Python >= 3.11
- # - name: "Installing Python packages"
- # run: |
- # python3 -m venv .venv
- # .venv/Scripts/activate.bat
- # python3 -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
- # - name: "Installing requirements"
- # run: choco install ccache --yes
- # - name: "Configuring MSVC"
- # uses: ilammy/msvc-dev-cmd@v1.13.0
- # # Finally: build and run tests.
- # - name: "Building IREE"
- # env:
- # IREE_WRITE_REMOTE_CCACHE: ${{ needs.setup.outputs.write-caches }}
- # IREE_CCACHE_GCP_TOKEN: ${{ steps.gcp-auth.outputs.access_token }}
- # CCACHE_NAMESPACE: github-windows-2022
- # run: ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
- # - name: "Testing IREE"
- # run: ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
-
- # Disabled while runner is offline.
- # build_test_all_macos_arm64:
- # needs: setup
- # if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_macos_arm64')
- # runs-on:
- # - ${{ github.repository == 'iree-org/iree' && 'self-hosted' || 'macos-12' }} # must come first
- # - runner-group=postsubmit
- # - os-family=macOS
- # env:
- # BUILD_DIR: build-macos
- # steps:
- # - name: "Checking out repository"
- # uses: actions/checkout@v4.1.7
- # - name: "Updating git submodules"
- # run: git submodule update --init --jobs 8 --depth 1
- # - name: "Installing Python packages"
- # run: |
- # python3 -m venv .venv
- # source .venv/bin/activate
- # python3 -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
- # - name: "Building IREE"
- # env:
- # IREE_READ_REMOTE_CCACHE: 0
- # IREE_WRITE_REMOTE_CCACHE: 0
- # IREE_READ_LOCAL_CCACHE: 1
- # IREE_WRITE_LOCAL_CCACHE: ${{ needs.setup.outputs.write-caches }}
- # # We'll remove the GITHUB_WORKSPACE directory after the job.
- # # Persist the cache by storing in the parent directory.
- # CCACHE_DIR: ${{ github.workspace }}/../.ccache
- # CCACHE_MAXSIZE: 30G
- # run: |
- # source .venv/bin/activate
- # bash ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
- # - name: "Testing IREE"
- # run: |
- # source .venv/bin/activate
- # IREE_METAL_DISABLE=0 bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
-
- build_test_all_macos_x86_64:
- needs: setup
- if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_macos_x86_64')
- runs-on: macos-13
- env:
- BUILD_DIR: build-macos
- defaults:
- run:
- shell: bash
- steps:
- - name: "Checking out repository"
- uses: actions/checkout@v4.1.7
- - id: "gcp-auth"
- name: "Authenticating to Google Cloud"
- if: needs.setup.outputs.write-caches == 1
- uses: "google-github-actions/auth@v1"
- with:
- token_format: "access_token"
- credentials_json: "${{ secrets.IREE_OSS_GITHUB_RUNNER_BASIC_TRUST_SERVICE_ACCOUNT_KEY }}"
- create_credentials_file: false
- - name: "Updating git submodules"
- run: git submodule update --init --jobs 8 --depth 1
- # There are multiple versions of Xcode and SDKs installed on the macOS runner.
- # Select the latest Xcode app to enable using Metal offline toolchain.
- - name: "Update Xcode command line tools path"
- run: |
- sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
- xcrun metal --version
- xcrun metallib --version
- - name: "Setting up Python"
- uses: actions/setup-python@v5.1.0
- with:
- python-version: "3.10"
- cache: "pip"
- - name: "Installing Python packages"
- run: pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
- - name: "Installing requirements"
- # We need coreutils for `realpath` used in scripts.
- # We need bash because the default one on macOS is fairly old and lacks
- # features we use in scripts.
- run: brew install ninja ccache coreutils bash
- # Finally: build and run tests.
- - name: "Building IREE"
- env:
- IREE_WRITE_REMOTE_CCACHE: ${{ needs.setup.outputs.write-caches }}
- IREE_CCACHE_GCP_TOKEN: ${{ steps.gcp-auth.outputs.access_token }}
- CCACHE_NAMESPACE: github-macos-13
- run: bash ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
- - name: "Testing IREE"
- run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
-
build_test_all_bazel:
needs: setup
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_bazel')
@@ -984,12 +805,6 @@
- build_all
- build_test_all_bazel
- # Platforms
- # - build_test_all_arm64
- # - build_test_all_windows
- # - build_test_all_macos_arm64
- - build_test_all_macos_x86_64
-
# Accelerators
- test_nvidia_gpu
# - test_nvidia_a100
diff --git a/.github/workflows/ci_linux_arm64_clang.yml b/.github/workflows/ci_linux_arm64_clang.yml
new file mode 100644
index 0000000..029f0a2
--- /dev/null
+++ b/.github/workflows/ci_linux_arm64_clang.yml
@@ -0,0 +1,63 @@
+# Copyright 2024 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
+
+name: CI - Linux arm64 clang
+
+on:
+ schedule:
+ # Weekday mornings at 09:15 UTC = 01:15 PST (UTC - 8).
+ - cron: "15 9 * * 1-5"
+ workflow_dispatch:
+
+concurrency:
+ # A PR number if a pull request and otherwise the commit hash. This cancels
+ # queued and in-progress runs for the same PR (presubmit) or commit
+ # (postsubmit). The workflow name is prepended to avoid conflicts between
+ # different workflows.
+ group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
+ cancel-in-progress: true
+
+jobs:
+ setup:
+ uses: ./.github/workflows/setup.yml
+
+ # TODO: Switch to GitHub-hosted arm64 runners when available?
+ # TODO: Switch runs-on labels to use different (non-GCP) self-hosted runners?
+ linux_arm64_clang:
+ needs: setup
+ if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'build_test_all_arm64')
+ runs-on:
+ - self-hosted # must come first
+ - runner-group=${{ needs.setup.outputs.runner-group }}
+ - environment=${{ needs.setup.outputs.runner-env }}
+ - arm64
+ - os-family=Linux
+ env:
+ BUILD_DIR: build-arm64
+ steps:
+ - name: "Checking out repository"
+ uses: actions/checkout@v4.1.7
+ with:
+ submodules: true
+ - name: "Building IREE"
+ env:
+ IREE_WRITE_REMOTE_CCACHE: ${{ needs.setup.outputs.write-caches }}
+ run: |
+ ./build_tools/github_actions/docker_run.sh \
+ --env "IREE_CCACHE_GCP_TOKEN=$(gcloud auth application-default print-access-token)" \
+ --env "IREE_WRITE_REMOTE_CCACHE=${IREE_WRITE_REMOTE_CCACHE}" \
+ --env "CCACHE_NAMESPACE=gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59" \
+ --env "IREE_BUILD_SETUP_PYTHON_VENV=${BUILD_DIR}/.venv" \
+ gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \
+ ./build_tools/cmake/build_all.sh \
+ "${BUILD_DIR}"
+ - name: "Testing IREE"
+ run: |
+ ./build_tools/github_actions/docker_run.sh \
+ --env "IREE_ARM_SME_QEMU_AARCH64_BIN=/usr/bin/qemu-aarch64" \
+ gcr.io/iree-oss/base-arm64@sha256:9daa1cdbbf12da8527319ece76a64d06219e04ecb99a4cff6e6364235ddf6c59 \
+ ./build_tools/cmake/ctest_all.sh \
+ "${BUILD_DIR}"
diff --git a/.github/workflows/ci_macos_x86_clang.yml b/.github/workflows/ci_macos_x86_clang.yml
new file mode 100644
index 0000000..ab669fa
--- /dev/null
+++ b/.github/workflows/ci_macos_x86_clang.yml
@@ -0,0 +1,58 @@
+# Copyright 2024 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
+
+name: CI - macOS x86 clang
+
+on:
+ schedule:
+ # Weekday mornings at 09:15 UTC = 01:15 PST (UTC - 8).
+ - cron: "15 9 * * 1-5"
+ workflow_dispatch:
+
+concurrency:
+ # A PR number if a pull request and otherwise the commit hash. This cancels
+ # queued and in-progress runs for the same PR (presubmit) or commit
+ # (postsubmit). The workflow name is prepended to avoid conflicts between
+ # different workflows.
+ group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
+ cancel-in-progress: true
+
+jobs:
+ macos_x86_clang:
+ runs-on: macos-13
+ env:
+ BUILD_DIR: build-macos
+ defaults:
+ run:
+ shell: bash
+ steps:
+ - name: "Checking out repository"
+ uses: actions/checkout@v4.1.7
+ - name: "Updating git submodules"
+ run: git submodule update --init --jobs 8 --depth 1
+ # There may be multiple versions of Xcode and SDKs installed.
+ # Select the latest Xcode app to enable using Metal offline toolchain.
+ - name: "Update Xcode command line tools path"
+ run: |
+ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
+ xcrun metal --version
+ xcrun metallib --version
+ - name: "Setting up Python"
+ uses: actions/setup-python@v5.1.0
+ with:
+ python-version: "3.10"
+ cache: "pip"
+ - name: "Installing Python packages"
+ run: pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
+ - name: "Installing requirements"
+ # We need coreutils for `realpath` used in scripts.
+ # We need bash because the default one on macOS is fairly old and lacks
+ # features we use in scripts.
+ run: brew install ninja ccache coreutils bash
+ - name: "Building IREE"
+ run: bash ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
+ - name: "Testing IREE"
+ run: bash ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
diff --git a/.github/workflows/ci_windows_x86_msvc.yml b/.github/workflows/ci_windows_x86_msvc.yml
new file mode 100644
index 0000000..548a4e9
--- /dev/null
+++ b/.github/workflows/ci_windows_x86_msvc.yml
@@ -0,0 +1,52 @@
+# Copyright 2024 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
+
+name: CI - Windows x86 MSVC
+
+on:
+ schedule:
+ # Weekday mornings at 09:15 UTC = 01:15 PST (UTC - 8).
+ - cron: "15 9 * * 1-5"
+ workflow_dispatch:
+
+concurrency:
+ # A PR number if a pull request and otherwise the commit hash. This cancels
+ # queued and in-progress runs for the same PR (presubmit) or commit
+ # (postsubmit). The workflow name is prepended to avoid conflicts between
+ # different workflows.
+ group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
+ cancel-in-progress: true
+
+jobs:
+ windows_x86_msvc:
+ runs-on: windows-2022
+ defaults:
+ run:
+ shell: bash
+ env:
+ BUILD_DIR: build-windows
+ steps:
+ - name: "Checking out repository"
+ uses: actions/checkout@v4.1.7
+ with:
+ submodules: true
+ - name: "Setting up Python"
+ uses: actions/setup-python@v5.1.0
+ with:
+ python-version: "3.10" # Needs pybind >= 2.10.1 for Python >= 3.11
+ - name: "Installing Python packages"
+ run: |
+ python3 -m venv .venv
+ .venv/Scripts/activate.bat
+ python3 -m pip install -r runtime/bindings/python/iree/runtime/build_requirements.txt
+ - name: "Installing requirements"
+ run: choco install ccache --yes
+ - name: "Configuring MSVC"
+ uses: ilammy/msvc-dev-cmd@v1.13.0
+ - name: "Building IREE"
+ run: ./build_tools/cmake/build_all.sh "${BUILD_DIR}"
+ - name: "Testing IREE"
+ run: ./build_tools/cmake/ctest_all.sh "${BUILD_DIR}"
diff --git a/build_tools/cmake/ctest_all.sh b/build_tools/cmake/ctest_all.sh
index 24fd42b..85894d4 100755
--- a/build_tools/cmake/ctest_all.sh
+++ b/build_tools/cmake/ctest_all.sh
@@ -123,6 +123,7 @@
"iree/tests/e2e/tensor_ops/check_vmvx_ukernel_local-task_unpack.mlir"
# TODO(#11070): Fix argument/result signature mismatch
"iree/tests/e2e/tosa_ops/check_vmvx_local-sync_microkernels_fully_connected.mlir"
+ "iree/tests/e2e/tosa_ops/check_vmvx_local-sync_microkernels_matmul.mlir"
)
elif [[ "${OSTYPE}" =~ ^darwin ]]; then
excluded_tests+=(
diff --git a/build_tools/github_actions/configure_ci.py b/build_tools/github_actions/configure_ci.py
index e6fccba..6bb7fce 100755
--- a/build_tools/github_actions/configure_ci.py
+++ b/build_tools/github_actions/configure_ci.py
@@ -124,10 +124,6 @@
# They may also run on presubmit only under certain conditions.
DEFAULT_POSTSUBMIT_ONLY_JOBS = frozenset(
[
- # "build_test_all_arm64", # Currently disabled
- # "build_test_all_windows", # Currently disabled
- # "build_test_all_macos_arm64", # Currently disabled
- "build_test_all_macos_x86_64",
"test_nvidia_gpu",
# "test_nvidia_a100", # Currently disabled
"test_amd_mi250",
@@ -157,14 +153,6 @@
# The file paths should be specified using Unix shell-style wildcards.
# Note: these jobs should also be included in DEFAULT_POSTSUBMIT_ONLY_JOBS.
PRESUBMIT_TOUCH_ONLY_JOBS = [
- # Currently disabled
- # ("build_test_all_macos_arm64", ["runtime/src/iree/hal/drivers/metal/*"]),
- # Currently disabled
- # (
- # "build_test_all_windows",
- # ["*win32*", "*windows*", "*msvc*", "runtime/src/iree/builtins/ukernel/*"],
- # ),
- #
# The runners with GPUs for these jobs can be unstable or in short supply,
# so limit jobs to only code paths most likely to affect the tests.
("test_nvidia_gpu", NVGPU_PATHS),
diff --git a/build_tools/github_actions/configure_ci_test.py b/build_tools/github_actions/configure_ci_test.py
index 0d5ecf1..b9a6c07 100644
--- a/build_tools/github_actions/configure_ci_test.py
+++ b/build_tools/github_actions/configure_ci_test.py
@@ -292,57 +292,6 @@
)
self.assertCountEqual(jobs, {postsubmit_job})
- @unittest.skip("skip while `build_test_all_macos_arm64` job is disabled")
- def test_get_enabled_jobs_metal(self):
- trailers = {}
- all_jobs = {"job1"}
- is_pr = True
- is_llvm_integrate_pr = False
- modified_paths = ["runtime/src/iree/hal/drivers/metal/file"]
- jobs = configure_ci.get_enabled_jobs(
- trailers,
- all_jobs,
- modified_paths=modified_paths,
- is_pr=is_pr,
- is_llvm_integrate_pr=is_llvm_integrate_pr,
- )
- expected_jobs = {"job1", "build_test_all_macos_arm64"}
- self.assertCountEqual(jobs, expected_jobs)
-
- @unittest.skip("skip while `build_test_all_windows` job is disabled")
- def test_get_enabled_jobs_windows(self):
- trailers = {}
- all_jobs = {"job1"}
- is_pr = True
- is_llvm_integrate_pr = False
- modified_paths = ["runtime/src/iree/base/internal/threading_win32.c"]
- jobs = configure_ci.get_enabled_jobs(
- trailers,
- all_jobs,
- modified_paths=modified_paths,
- is_pr=is_pr,
- is_llvm_integrate_pr=is_llvm_integrate_pr,
- )
- expected_jobs = {"job1", "build_test_all_windows"}
- self.assertCountEqual(jobs, expected_jobs)
-
- def test_get_enabled_jobs_windows_docs(self):
- # docs/ directory is excluded from CI, superceding "windows" inclusion
- trailers = {}
- all_jobs = {"job1"}
- is_pr = True
- is_llvm_integrate_pr = False
- modified_paths = ["docs/windows.md"]
- jobs = configure_ci.get_enabled_jobs(
- trailers,
- all_jobs,
- modified_paths=modified_paths,
- is_pr=is_pr,
- is_llvm_integrate_pr=is_llvm_integrate_pr,
- )
- expected_jobs = {}
- self.assertCountEqual(jobs, expected_jobs)
-
def test_parse_path_from_workflow_ref(self):
path = configure_ci.parse_path_from_workflow_ref(
"octocat/example", "octocat/example/.github/test.yml@1234"