From 377388bd7b005854b2bd9551ae51e3a7e4118d3f Mon Sep 17 00:00:00 2001 From: David Ittah Date: Thu, 8 Aug 2024 10:42:52 -0400 Subject: [PATCH] Additional cache improvemnts (#1001) - Only pushes to main will generate a new `ccache` cache entry, while runs on feature branches will download the latest available cache. The `ccache` entry on main is always built from scratch. This reduces the number of caches generated, and makes the `ccache` cache mechanism slightly more consistent. - Use the new `lookup-only` flag when we don't actually care about restoring a cache entry, and only want to test if it exists. Saves time. - Don't perform a save step when only a restore is required. This saves time, but also eliminates some bugs like the occasional patches we apply to dependencies being cached. - For faster debugging of wheel actions, the cache for each dependency is now stored immediately after a successful dependency build step, rather than only storing the cache if all builds were successful. [sc-70625] --- .../workflows/build-wheel-linux-arm64.yaml | 50 ++++++++++++++----- .../workflows/build-wheel-linux-x86_64.yaml | 50 ++++++++++++++----- .../workflows/build-wheel-macos-arm64.yaml | 50 ++++++++++++++----- .../workflows/build-wheel-macos-x86_64.yaml | 50 ++++++++++++++----- .github/workflows/check-catalyst.yaml | 30 ++++++----- .github/workflows/check-pl-compat.yaml | 12 ++--- 6 files changed, 176 insertions(+), 66 deletions(-) diff --git a/.github/workflows/build-wheel-linux-arm64.yaml b/.github/workflows/build-wheel-linux-arm64.yaml index 91106fe28d..89aa1b6cab 100644 --- a/.github/workflows/build-wheel-linux-arm64.yaml +++ b/.github/workflows/build-wheel-linux-arm64.yaml @@ -105,26 +105,28 @@ jobs: path: mlir/Enzyme # Cache external project builds - - name: Cache LLVM Build + - name: Restore LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ matrix.container_name }}-llvm-${{ needs.constants.outputs.llvm_version }}-wheel-build - - name: Cache MHLO Build + - name: Restore MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ matrix.container_name }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + lookup-only: True - - name: Cache Enzyme Build + - name: Restore Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ matrix.container_name }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + lookup-only: True - name: Build LLD if: steps.cache-llvm-build.outputs.cache-hit != 'true' @@ -150,6 +152,14 @@ jobs: -i ${{ matrix.container_img }} \ bash /catalyst/.github/workflows/scripts/linux_arm64/rh8/build_llvm.sh $GCC_VERSION ${{ matrix.python_version.official }} ${{ matrix.python_version.subversion }} ${{ matrix.python_version.package }} + - name: Save LLVM Build + id: save-llvm-build + if: steps.cache-llvm-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: llvm-build + key: ${{ matrix.container_name }}-llvm-${{ needs.constants.outputs.llvm_version }}-wheel-build + - name: Build MHLO Dialect if: steps.cache-mhlo-build.outputs.cache-hit != 'true' run: | @@ -161,6 +171,14 @@ jobs: -i ${{ matrix.container_img }} \ bash /catalyst/.github/workflows/scripts/linux_arm64/rh8/build_mhlo.sh $GCC_VERSION ${{ matrix.python_version.official }} ${{ matrix.python_version.subversion }} ${{ matrix.python_version.package }} + - name: Save MHLO Build + id: save-mhlo-build + if: steps.cache-mhlo-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: mhlo-build + key: ${{ matrix.container_name }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + - name: Build Enzyme if: steps.cache-enzyme-build.outputs.cache-hit != 'true' run: | @@ -172,6 +190,14 @@ jobs: -i ${{ matrix.container_img }} \ bash /catalyst/.github/workflows/scripts/linux_arm64/rh8/build_enzyme.sh $GCC_VERSION ${{ matrix.python_version.official }} ${{ matrix.python_version.subversion }} ${{ matrix.python_version.package }} + - name: Save Enzyme Build + id: save-enzyme-build + if: steps.cache-enzyme-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: enzyme-build + key: ${{ matrix.container_name }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + catalyst-linux-wheels-arm64: needs: [constants, build-dependencies] strategy: @@ -201,7 +227,7 @@ jobs: - name: Get Cached LLVM Source id: cache-llvm-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-default-source @@ -210,7 +236,7 @@ jobs: - name: Get Cached LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ matrix.container_name }}-llvm-${{ needs.constants.outputs.llvm_version }}-wheel-build @@ -218,7 +244,7 @@ jobs: - name: Get Cached MHLO Source id: cache-mhlo-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source @@ -227,7 +253,7 @@ jobs: - name: Get Cached MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ matrix.container_name }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build @@ -235,7 +261,7 @@ jobs: - name: Get Cached Enzyme Source id: cache-enzyme-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-default-source @@ -244,7 +270,7 @@ jobs: - name: Get Cached Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ matrix.container_name }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build diff --git a/.github/workflows/build-wheel-linux-x86_64.yaml b/.github/workflows/build-wheel-linux-x86_64.yaml index 20fe135268..67436cda08 100644 --- a/.github/workflows/build-wheel-linux-x86_64.yaml +++ b/.github/workflows/build-wheel-linux-x86_64.yaml @@ -110,26 +110,28 @@ jobs: path: mlir/Enzyme # Cache external project builds - - name: Cache LLVM Build + - name: Restore LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ matrix.container_img }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build - - name: Cache MHLO Build + - name: Restore MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ matrix.container_img }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + lookup-only: True - - name: Cache Enzyme Build + - name: Restore Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ matrix.container_img }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + lookup-only: True - name: Install dependencies (AlmaLinux) if: | @@ -187,6 +189,14 @@ jobs: # This tests fails on CI/CD not locally. LIT_FILTER_OUT="Bytecode" cmake --build llvm-build --target check-mlir + - name: Save LLVM Build + id: save-llvm-build + if: steps.cache-llvm-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: llvm-build + key: ${{ matrix.container_img }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build + - name: Build MHLO Dialect if: steps.cache-mhlo-build.outputs.cache-hit != 'true' # building with LLD is a strong requirement for mhlo @@ -209,6 +219,14 @@ jobs: LIT_FILTER_OUT="chlo_legalize_to_mhlo" cmake --build mhlo-build --target check-mlir-hlo + - name: Save MHLO Build + id: save-mhlo-build + if: steps.cache-mhlo-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: mhlo-build + key: ${{ matrix.container_img }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + - name: Build Enzyme if: steps.cache-enzyme-build.outputs.cache-hit != 'true' run: | @@ -222,6 +240,14 @@ jobs: cmake --build enzyme-build --target EnzymeStatic-19 + - name: Save Enzyme Build + id: save-enzyme-build + if: steps.cache-enzyme-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: enzyme-build + key: ${{ matrix.container_img }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + catalyst-linux-wheels-x86-64: needs: [constants, build-dependencies, determine_runner] strategy: @@ -255,7 +281,7 @@ jobs: - name: Get Cached LLVM Source id: cache-llvm-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-container-source @@ -264,7 +290,7 @@ jobs: - name: Get Cached LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ matrix.container_img }}-llvm-${{ needs.constants.outputs.llvm_version }}-3.9-wheel-build @@ -272,7 +298,7 @@ jobs: - name: Get Cached MHLO Source id: cache-mhlo-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-container-source @@ -281,7 +307,7 @@ jobs: - name: Get Cached MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ matrix.container_img }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build @@ -289,7 +315,7 @@ jobs: - name: Get Cached Enzyme Source id: cache-enzyme-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-container-source @@ -298,7 +324,7 @@ jobs: - name: Get Cached Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ matrix.container_img }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build diff --git a/.github/workflows/build-wheel-macos-arm64.yaml b/.github/workflows/build-wheel-macos-arm64.yaml index 167a9394a9..20e4e64be7 100644 --- a/.github/workflows/build-wheel-macos-arm64.yaml +++ b/.github/workflows/build-wheel-macos-arm64.yaml @@ -98,26 +98,28 @@ jobs: path: mlir/Enzyme # Cache external project builds - - name: Cache LLVM Build + - name: Restore LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build - - name: Cache MHLO Build + - name: Restore MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + lookup-only: True - - name: Cache Enzyme Build + - name: Restore Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + lookup-only: True - name: Setup Python version # There are multiple Python versions installed on the GitHub image, 3.9 - 3.12 is already @@ -153,6 +155,14 @@ jobs: # This tests fails on CI/CD not locally. LIT_FILTER_OUT="Bytecode" cmake --build llvm-build --target check-mlir + - name: Save LLVM Build + id: save-llvm-build + if: steps.cache-llvm-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: llvm-build + key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build + - name: Build MHLO Dialect if: steps.cache-mhlo-build.outputs.cache-hit != 'true' run: | @@ -174,6 +184,14 @@ jobs: cmake --build mhlo-build --target check-mlir-hlo + - name: Save MHLO Build + id: save-mhlo-build + if: steps.cache-mhlo-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: mhlo-build + key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + - name: Build Enzyme if: steps.cache-enzyme-build.outputs.cache-hit != 'true' run: | @@ -185,6 +203,14 @@ jobs: cmake --build enzyme-build --target EnzymeStatic-19 + - name: Save Enzyme Build + id: save-enzyme-build + if: steps.cache-enzyme-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: enzyme-build + key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + catalyst-macos-wheels-arm64: needs: [constants, build-dependencies] strategy: @@ -216,7 +242,7 @@ jobs: - name: Get Cached LLVM Source id: cache-llvm-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-default-source @@ -225,7 +251,7 @@ jobs: - name: Get Cached LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-3.9-wheel-build @@ -233,7 +259,7 @@ jobs: - name: Get Cached MHLO Source id: cache-mhlo-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source @@ -242,7 +268,7 @@ jobs: - name: Get Cached MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build @@ -250,7 +276,7 @@ jobs: - name: Get Cached Enzyme Source id: cache-enzyme-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-default-source @@ -259,7 +285,7 @@ jobs: - name: Get Cached Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build diff --git a/.github/workflows/build-wheel-macos-x86_64.yaml b/.github/workflows/build-wheel-macos-x86_64.yaml index d8ca9d6c61..35ae23a6b5 100644 --- a/.github/workflows/build-wheel-macos-x86_64.yaml +++ b/.github/workflows/build-wheel-macos-x86_64.yaml @@ -96,26 +96,28 @@ jobs: path: mlir/Enzyme # Cache external project builds - - name: Cache LLVM Build + - name: Restore LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build - - name: Cache MHLO Build + - name: Restore MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + lookup-only: True - - name: Cache Enzyme Build + - name: Restore Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + lookup-only: True - name: Set up Python ${{ matrix.python_version }} uses: actions/setup-python@v5 @@ -149,6 +151,14 @@ jobs: # This tests fails on CI/CD not locally. LIT_FILTER_OUT="Bytecode" cmake --build llvm-build --target check-mlir + - name: Save LLVM Build + id: save-llvm-build + if: steps.cache-llvm-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: llvm-build + key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-${{matrix.python_version}}-wheel-build + - name: Build MHLO Dialect if: steps.cache-mhlo-build.outputs.cache-hit != 'true' run: | @@ -170,6 +180,14 @@ jobs: cmake --build mhlo-build --target check-mlir-hlo + - name: Save MHLO Build + id: save-mhlo-build + if: steps.cache-mhlo-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: mhlo-build + key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build + - name: Build Enzyme if: steps.cache-enzyme-build.outputs.cache-hit != 'true' run: | @@ -181,6 +199,14 @@ jobs: cmake --build enzyme-build --target EnzymeStatic-19 + - name: Save Enzyme Build + id: save-enzyme-build + if: steps.cache-enzyme-build.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: enzyme-build + key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build + catalyst-macos-wheels-x86-64: needs: [constants, build-dependencies] strategy: @@ -206,7 +232,7 @@ jobs: - name: Get Cached LLVM Source id: cache-llvm-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-default-source @@ -215,7 +241,7 @@ jobs: - name: Get Cached LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-${{ runner.arch }}-llvm-${{ needs.constants.outputs.llvm_version }}-3.9-wheel-build @@ -223,7 +249,7 @@ jobs: - name: Get Cached MHLO Source id: cache-mhlo-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source @@ -232,7 +258,7 @@ jobs: - name: Get Cached MHLO Build id: cache-mhlo-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-${{ runner.arch }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-wheel-build @@ -240,7 +266,7 @@ jobs: - name: Get Cached Enzyme Source id: cache-enzyme-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-default-source @@ -249,7 +275,7 @@ jobs: - name: Get Cached Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ runner.os }}-${{ runner.arch }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-wheel-build diff --git a/.github/workflows/check-catalyst.yaml b/.github/workflows/check-catalyst.yaml index 6ce469c98d..63102b3652 100644 --- a/.github/workflows/check-catalyst.yaml +++ b/.github/workflows/check-catalyst.yaml @@ -306,7 +306,7 @@ jobs: - name: Get Cached LLVM Source id: cache-llvm-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-default-source @@ -315,7 +315,7 @@ jobs: - name: Get Cached LLVM Build id: cache-llvm-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-build-${{ matrix.compiler }} @@ -323,7 +323,7 @@ jobs: - name: Get Cached MHLO Source id: cache-mhlo-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source @@ -332,7 +332,7 @@ jobs: - name: Get Cached MHLO Build id: cache-mhlo - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-default-build-${{ matrix.compiler }} @@ -340,7 +340,7 @@ jobs: - name: Get Cached Enzyme Source id: cache-enzyme-source - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-default-source @@ -349,20 +349,18 @@ jobs: - name: Get Cached Enzyme Build id: cache-enzyme-build - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: enzyme-build key: ${{ runner.os }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-default-build-${{ matrix.compiler }} fail-on-cache-miss: true - - name: Cache CCache - id: cache-ccache - uses: actions/cache@v4 + - name: Restore CCache on feature branches + id: restore-ccache + if: ${{ github.ref != 'refs/heads/main' }} + uses: actions/cache/restore@v4 with: path: .ccache - # TODO: revisit once actions/cache has an update feature - # https://github.com/actions/toolkit/issues/505 - # this will load the latest available cache and generate a new one at the end key: ${{ runner.os }}-ccache-${{ github.run_id }} restore-keys: ${{ runner.os }}-ccache- @@ -386,6 +384,14 @@ jobs: quantum-build/python_packages/* retention-days: 1 + - name: Cache CCache on main branch + id: save-ccache + if: ${{ github.ref == 'refs/heads/main' }} + uses: actions/cache/save@v4 + with: + path: .ccache + key: ${{ runner.os }}-ccache-${{ github.run_id }} + frontend-tests: name: Frontend Tests needs: [constants, llvm, runtime, quantum, determine_runner] diff --git a/.github/workflows/check-pl-compat.yaml b/.github/workflows/check-pl-compat.yaml index 8294af770f..db1a0108f1 100644 --- a/.github/workflows/check-pl-compat.yaml +++ b/.github/workflows/check-pl-compat.yaml @@ -51,29 +51,29 @@ jobs: echo "AWS_DEFAULT_REGION=us-east-1" >> $GITHUB_ENV - name: Get Catalyst Build Dependencies (latest) - uses: actions/cache@v4 + uses: actions/cache/restore@v4 with: path: mlir/llvm-project key: llvm-${{ needs.constants.outputs.llvm_version }}-default-source enableCrossOsArchive: True fail-on-cache-miss: True - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: path: llvm-build key: ${{ runner.os }}-llvm-${{ needs.constants.outputs.llvm_version }}-default-build-gcc fail-on-cache-miss: True - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: path: mlir/mlir-hlo key: mhlo-${{ needs.constants.outputs.mhlo_version }}-default-source enableCrossOsArchive: True fail-on-cache-miss: True - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: path: mhlo-build key: ${{ runner.os }}-mhlo-${{ needs.constants.outputs.mhlo_version }}-default-build-gcc fail-on-cache-miss: True - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: path: mlir/Enzyme key: enzyme-${{ needs.constants.outputs.enzyme_version }}-default-source @@ -84,7 +84,7 @@ jobs: path: enzyme-build key: ${{ runner.os }}-enzyme-${{ needs.constants.outputs.llvm_version }}-${{ needs.constants.outputs.enzyme_version }}-default-build-gcc fail-on-cache-miss: True - - uses: actions/cache@v4 + - uses: actions/cache/restore@v4 with: path: .ccache key: ${{ runner.os }}-ccache-${{ github.run_id }}