Skip to content

Commit

Permalink
CI: [nfc] Use actions/cache instead of modified fork (llvm#2124)
Browse files Browse the repository at this point in the history
We previously used a fork of the action/cache repository for the PyTorch
cache since the actions/cache repo did not support read-only caches.
Now that actions/cache supports separate read and write steps, this
patch switches back to the actions/cache repo.
  • Loading branch information
ashay authored May 13, 2023
1 parent 3a81965 commit 19a08d5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/RollPyTorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Update PyTorch Build Cache (if running on main branch)
if: github.ref_name == 'main'
id: cache-pytorch
uses: ashay/cache@v1
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
key: ${{ runner.os }}-pytorch-${{ env.PT_HASH }}
Expand Down
14 changes: 11 additions & 3 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,13 @@ jobs:
with:
arch: x64

- name: Cache PyTorch Build
- name: Try to Restore PyTorch Build Cache
if: matrix.os-arch != 'windows-x86_64'
id: cache-pytorch
uses: ashay/cache@v1
uses: actions/cache/restore@v3
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
key: ${{ runner.os }}-pytorch-${{ env.PT_HASH }}
save: ${{ github.ref_name == 'main' && matrix.torch-binary == 'OFF' }}

- name: Build and Test os-arch='ubuntu-x86_64' llvm-build='${{ matrix.llvm-build }}' torch-binary='${{ matrix.torch-binary }}'
if: ${{ matrix.os-arch == 'ubuntu-x86_64' }}
Expand All @@ -100,6 +99,7 @@ jobs:
TM_USE_PYTORCH_BINARY="${{ matrix.torch-binary }}" \
TM_PYTORCH_INSTALL_WITHOUT_REBUILD="${{ steps.cache-pytorch.outputs.cache-hit }}" \
./build_tools/python_deploy/build_linux_packages.sh
- name: Configure os-arch='macos-arm64' llvm-build='in-tree' torch-binary='${{ matrix.torch-binary }}'
# cross compile, can't test arm64
if: ${{ matrix.os-arch == 'macos-arm64' && matrix.llvm-build == 'in-tree' }}
Expand Down Expand Up @@ -128,6 +128,7 @@ jobs:
-DMACOSX_DEPLOYMENT_TARGET=12.0 \
-DPython3_EXECUTABLE="$(which python)" \
$GITHUB_WORKSPACE/externals/llvm-project/llvm
- name: Build torch-mlir (cross-compile)
if: ${{ matrix.os-arch == 'macos-arm64' }}
run: |
Expand All @@ -138,6 +139,13 @@ jobs:
shell: bash
run: ./build_tools/python_deploy/build_windows_ci.sh

- name: Save PyTorch Build Cache
if: ${{ github.ref_name == 'main' && matrix.torch-binary == 'OFF' && matrix.os-arch != 'windows-x86_64' }}
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
key: ${{ runner.os }}-pytorch-${{ env.PT_HASH }}

- name: Print ccache statistics
shell: bash
run: ccache --show-stats

0 comments on commit 19a08d5

Please sign in to comment.