Skip to content

Commit

Permalink
CI: Spot fixes related to nightly and stable PyTorch builds (llvm#2190)
Browse files Browse the repository at this point in the history
* CI: Skip (redundant) libtorch build when using stable PyTorch version

When we use PyTorch stable builds, there is no need to build libtorch
from source, making the stable-pytorch-with-torch-binary-OFF
configuration redundant with stable-pytorch-with-torch-binary-ON.  This
patch drops the redundant configuration from CI.

* CI: Simplify guard conditions for creating and using libtorch cache

Whether libtorch is enabled or not is predicated on a host of conditions
such as the platform, in-tree versus out-of-tree build, and stable
versus nightly PyTorch builds.  Instead of repeating these conditions to
guard whether to create or use the libtorch cache artifacts (and getting
them almost incorrect), this patch predicates the relevant pipeline
steps to whether libtorch is enabled, thus making the conditions far
simpler.
  • Loading branch information
ashay authored Jun 2, 2023
1 parent a46b5c6 commit 755d0c4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/buildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ jobs:
llvm-build: out-of-tree
- os-arch: windows-x86_64
torch-version: stable
# For PyTorch stable builds, we don't build PyTorch from source
- torch-version: stable
torch-binary: OFF
include:
# Specify OS versions
- os-arch: ubuntu-x86_64
Expand Down Expand Up @@ -89,7 +92,7 @@ jobs:
arch: x64

- name: Try to Restore PyTorch Build Cache
if: matrix.os-arch != 'windows-x86_64'
if: ${{ matrix.torch-binary == 'OFF' }}
id: cache-pytorch
uses: actions/cache/restore@v3
with:
Expand Down Expand Up @@ -147,7 +150,7 @@ jobs:
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' }}
if: ${{ github.ref_name == 'main' && matrix.torch-binary == 'OFF' }}
uses: actions/cache/save@v3
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
Expand Down

0 comments on commit 755d0c4

Please sign in to comment.