Skip to content

Add CI trigger #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/_ascend_npu_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,21 +68,18 @@ jobs:

- name: Install system dependencies
run: |
apt update
apt install --no-install-recommends -y \
apt-get update
apt-get install -y \
git gcc g++ make cmake ninja-build curl \
libgl1 libglib2.0-0 libsndfile1

- name: Checkout
uses: actions/checkout@v4

# TODO(shink): Update once PR merged
# https://github.com/pytorch/benchmark/pull/2550
- name: Checkout benchmark
uses: actions/checkout@v4
with:
repository: shink/benchmark
ref: feat/test_bench/continue_on_error
repository: pytorch/benchmark
path: benchmark

- name: Download ${{ inputs.artifact_name }}
Expand Down Expand Up @@ -144,19 +141,22 @@ jobs:
id: update-readme
run: |
python .ci/benchmark.py --update-readme --path benchmark/ascend_npu_benchmark.json
if git diff --quiet README.md; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi

# https://github.com/peter-evans/create-pull-request
- name: Create a pull request for changes to README.md
if: ${{ steps.update-readme.outputs.changed == 'true' }}
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.pr-token }}
base: ${{ github.head_ref }}
committer: 'cosdt-bot <[email protected]>'
author: 'cosdt-bot <[email protected]>'
commit-message: 'Update torchbenchmark report in README.md'
add-paths: README.md
branch: ascend-npu/benchmark
title: "[Ascend NPU] Update torchbenchmark report in README.md"
commit-message: "Update README.md"
title: '[Ascend NPU] Update torchbenchmark report in README.md'
body: |
The torchbenchmark results running on Ascend NPU have changed, I'm updating the report in README.md.

cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink
reviewers: shink
2 changes: 2 additions & 0 deletions .github/workflows/ascend_npu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ on:
- 'published'
schedule:
- cron: '0 12 * * *'
repository_dispatch:
types: [pytorch-pr-event-redispatch]
workflow_dispatch:
inputs:
runner:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/handle-pytorch-event.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Handle events from PyTorch

on:
repository_dispatch:
types: [pytorch-pr-event]

jobs:
redispatch-pr-event:
name: Redispatch PyTorch event
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Print PR event payload
run: |
echo "owner: ${{ github.event.client_payload.owner }}"
echo "repo: ${{ github.event.client_payload.repo }}"
echo "event_name: ${{ github.event.client_payload.event_name }}"
echo "pull_request: ${{ toJson(github.event.client_payload.pull_request) }}"

- name: Redispatch PyTorch event
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.COSDT_BOT_TOKEN }}
repository: ${{ github.repository }}
event-type: pytorch-pr-event-redispatch
client-payload: ${{ toJson(github.event.client_payload) }}