Skip to content

Commit

Permalink
CI: create PR for RollPyTorch updates (llvm#2106)
Browse files Browse the repository at this point in the history
Currently, we run just the Linux in-tree tests when the RollPyTorch
workflow runs, but this is insufficient since WHL files for macOS or
Windows are sometimes not uploaded by PyTorch, causing the RollPyTorch
action to pass but all subsequent torch-mlir CI tests to fail because of
the broken build.

The easiest way to validate the RollPyTorch action on all platforms is
to run the standard set of tests that we run for each submitted PR, so
this patch makes the RollPyTorch action submit a PR instead of
committing the changes to the main branch directly.  The PR is assigned
to a handful of folks for review, although this can be changed in the
future.
  • Loading branch information
ashay authored May 10, 2023
1 parent d7614c2 commit 377720a
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions .github/workflows/RollPyTorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,15 @@ jobs:
torchvision version: ${{ env.PTVISION_RELEASE }}
```
- name: Push changes to main branch
- name: Update PyTorch Build Cache (if running on main branch)
if: github.ref_name == 'main'
id: cache-pytorch
uses: ashay/cache@v1
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
key: ${{ runner.os }}-pytorch-${{ env.PT_HASH }}

- name: Commit changes locally
if: env.PT_HASH_CHANGED != '0'
run: |
cd ${GITHUB_WORKSPACE}
Expand All @@ -106,13 +114,25 @@ jobs:
git fetch --recurse-submodules=no
git checkout main
git pull origin main
git checkout -b rollpytorch/${{ env.PT_RELEASE }}
git add pytorch-hash.txt pytorch-requirements.txt torchvision-requirements.txt lib/Dialect/Torch/Transforms/AbstractInterpLibrary.cpp include/torch-mlir/Dialect/Torch/IR/GeneratedTorchOps.td
git diff --cached --exit-code || (git commit -m "update PyTorch version to ${{ env.PT_RELEASE }}" && git push --set-upstream origin main)
git diff --cached --exit-code || git commit -m "update PyTorch version to ${{ env.PT_RELEASE }}"
- name: Update PyTorch Build Cache (if running on main branch)
if: github.ref_name == 'main'
id: cache-pytorch
uses: ashay/cache@v1
- name: Create pull request
uses: peter-evans/create-pull-request@v5.0.1
with:
path: ${{ github.workspace }}/build_tools/python_deploy/wheelhouse
key: ${{ runner.os }}-pytorch-${{ env.PT_HASH }}
author: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
branch: rollpytorch/${{ env.PT_RELEASE }}
body: |
torch version: ${{ env.PT_RELEASE }}
torch commit hash: ${{ env.PT_HASH }}
torchvision version: ${{ env.PTVISION_RELEASE }}
commit-message: |
update PyTorch version to ${{ env.PT_RELEASE }}
- torch version: ${{ env.PT_RELEASE }}
- torch commit hash: ${{ env.PT_HASH }}
- torchvision version: ${{ env.PTVISION_RELEASE }}
committer: Roll PyTorch Action <torch-mlir@users.noreply.github.com>
title: update PyTorch version to ${{ env.PT_RELEASE }}
reviewers: ashay, powderluv, vivekkhandelwal1

0 comments on commit 377720a

Please sign in to comment.