Skip to content
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
56 changes: 42 additions & 14 deletions .github/workflows/_ascend_npu_benchmark.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
name: '_ascend_npu_benchmark'
name: "_ascend_npu_benchmark"

on:
workflow_call:
inputs:
runner:
required: true
type: string
description: 'The runner selected to run on'
description: "The runner selected to run on"
image:
required: true
type: string
description: 'The docker image which will be loaded'
description: "The docker image which will be loaded"
device:
required: true
type: string
description: 'The device selected to run on'
description: "The device selected to run on"
torch-artifact:
required: false
type: string
description: 'The distribution artifact name of torch'
description: "The distribution artifact name of torch"
torch-npu-artifact:
required: true
type: string
description: 'The distribution artifact name of torch_npu'
description: "The distribution artifact name of torch_npu"
secrets:
pr-token:
description: 'A token used to create a pull request'
description: "A token used to create a pull request"
required: true

# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
Expand All @@ -36,13 +36,16 @@ defaults:
shell: bash -el {0}

jobs:
test:
benchmark:
name: run benchmarks for torch_npu
runs-on: ${{ inputs.runner }}
container:
image: ${{ inputs.image }}
env:
HF_ENDPOINT: https://hf-mirror.com
outputs:
changed: ${{ steps.update-readme.outputs.changed }}
report-url: ${{ steps.upload-report.outputs.artifact-url }}
steps:
- name: Show NPU info
run: |
Expand Down Expand Up @@ -176,19 +179,44 @@ jobs:
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Upload README.md
if: ${{ steps.update-readme.outputs.changed == 'true' }}
id: upload-readme
uses: actions/upload-artifact@v4
with:
name: README.md
path: README.md
if-no-files-found: error
retention-days: 1
overwrite: true

create-pr:
if: ${{ needs.benchmark.outputs.changed == 'true' }}
name: Create a pull request for changes to README.md
runs-on: ubuntu-latest
needs:
- benchmark
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download README.md
uses: actions/download-artifact@v4
with:
name: README.md

# See: 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'
commit-message: "Update torchbenchmark report in README.md"
committer: "cosdt-bot <[email protected]>"
author: "cosdt-bot <[email protected]>"
add-paths: README.md
branch: ascend-npu/benchmark
title: '[Ascend NPU] Update torchbenchmark report in 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.

Expand All @@ -198,7 +226,7 @@ jobs:
- [Torchbenchmark report][2] (click to download)

[1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
[2]: ${{ steps.upload-report.outputs.artifact-url }}
[2]: ${{ needs.benchmark.outputs.report-url }}

cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink
reviewers: shink
16 changes: 8 additions & 8 deletions .github/workflows/_ascend_npu_build_torch.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: '_ascend_npu_build_torch'
name: "_ascend_npu_build_torch"

on:
workflow_call:
inputs:
runner:
required: true
type: string
description: 'The runner selected to run on'
description: "The runner selected to run on"
image:
required: true
type: string
description: 'The docker image which will be used to build'
description: "The docker image which will be used to build"
pr-number:
required: false
type: string
default: ''
description: 'The number of pull request'
default: ""
description: "The number of pull request"
ref:
required: false
type: string
default: 'refs/heads/main'
description: 'The branch, tag or SHA to checkout'
default: "refs/heads/main"
description: "The branch, tag or SHA to checkout"
outputs:
torch-artifact:
description: 'The distribution artifact name of torch'
description: "The distribution artifact name of torch"
value: ${{ jobs.build.outputs.dist-name }}

# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_ascend_npu_build_torch_npu.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: '_ascend_npu_build'
name: "_ascend_npu_build"

on:
workflow_call:
inputs:
runner:
required: true
type: string
description: 'The runner selected to run on'
description: "The runner selected to run on"
image:
required: true
type: string
description: 'The docker image which will be used to build'
description: "The docker image which will be used to build"
device:
required: true
type: string
description: 'The device selected to run on'
description: "The device selected to run on"
torch-artifact:
required: false
type: string
description: 'The distribution artifact name of torch'
description: "The distribution artifact name of torch"
outputs:
torch-npu-artifact:
description: 'The distribution artifact name of torch_npu'
description: "The distribution artifact name of torch_npu"
value: ${{ jobs.build.outputs.dist-name }}

# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_ascend_npu_ut.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
name: '_ascend_npu_ut'
name: "_ascend_npu_ut"

on:
workflow_call:
inputs:
runner:
required: true
type: string
description: 'The runner selected to run on'
description: "The runner selected to run on"
image:
required: true
type: string
description: 'The docker image which will be loaded'
description: "The docker image which will be loaded"
device:
required: true
type: string
description: 'The device selected to run on'
description: "The device selected to run on"
torch-artifact:
required: false
type: string
description: 'The distribution artifact name of torch'
description: "The distribution artifact name of torch"
torch-npu-artifact:
required: true
type: string
description: 'The distribution artifact name of torch_npu'
description: "The distribution artifact name of torch_npu"

# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
# declared as "shell: bash -el {0}" on steps that need to be properly activated.
Expand Down
58 changes: 29 additions & 29 deletions .github/workflows/ascend_npu_test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: 'Ascend NPU Test Suite'
name: "Ascend NPU Test Suite"

on:
push:
branches:
- 'main'
- "main"
paths:
- '.github/workflows/ascend_npu_test.yml'
- '.github/workflows/_ascend_npu_build_torch.yml'
- '.github/workflows/_ascend_npu_build_torch_npu.yml'
- '.github/workflows/_ascend_npu_ut.yml'
- '.github/workflows/_ascend_npu_benchmark.yml'
- '.ci/**'
- 'ascend_npu/**'
- 'src/**'
- '!**/*.md'
- ".github/workflows/ascend_npu_test.yml"
- ".github/workflows/_ascend_npu_build_torch.yml"
- ".github/workflows/_ascend_npu_build_torch_npu.yml"
- ".github/workflows/_ascend_npu_ut.yml"
- ".github/workflows/_ascend_npu_benchmark.yml"
- ".ci/**"
- "ascend_npu/**"
- "src/**"
- "!**/*.md"
pull_request:
branches:
- 'main'
- "main"
paths:
- '.github/workflows/ascend_npu_test.yml'
- '.github/workflows/_ascend_npu_build_torch.yml'
- '.github/workflows/_ascend_npu_build_torch_npu.yml'
- '.github/workflows/_ascend_npu_ut.yml'
- '.github/workflows/_ascend_npu_benchmark.yml'
- '.ci/**'
- 'ascend_npu/**'
- 'src/**'
- '!**/*.md'
- ".github/workflows/ascend_npu_test.yml"
- ".github/workflows/_ascend_npu_build_torch.yml"
- ".github/workflows/_ascend_npu_build_torch_npu.yml"
- ".github/workflows/_ascend_npu_ut.yml"
- ".github/workflows/_ascend_npu_benchmark.yml"
- ".ci/**"
- "ascend_npu/**"
- "src/**"
- "!**/*.md"
release:
types:
- 'published'
- "published"
schedule:
- cron: '0 12 * * *'
- cron: "0 12 * * *"
repository_dispatch:
types: [pytorch-pr-event-redispatch]
workflow_dispatch:
Expand All @@ -45,17 +45,17 @@ on:
- linux-arm64-npu-1
- linux-arm64-npu-2
- linux-arm64-npu-4
default: 'linux-arm64-npu-1'
description: 'The runner selected to run on'
default: "linux-arm64-npu-1"
description: "The runner selected to run on"
image:
required: true
type: choice
options:
- ascendai/cann:7.0.1-910b-ubuntu22.04-py3.8
- ascendai/cann:8.0.0-910b-ubuntu22.04-py3.10
- ascendai/cann:latest
default: 'ascendai/cann:latest'
description: 'The docker image which will be loaded'
default: "ascendai/cann:latest"
description: "The docker image which will be loaded"
device:
required: true
type: choice
Expand All @@ -68,8 +68,8 @@ on:
- /dev/davinci6
- /dev/davinci7
- /dev/davinci8
default: '/dev/davinci5'
description: 'The device selected to run on'
default: "/dev/davinci5"
description: "The device selected to run on"

# Only cancel the previous runs when triggered by a pull_request event
#
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/dispatch-event.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
name: 'Dispatch PyTorch events'
name: "Dispatch PyTorch events"

on:
schedule:
- cron: '0 12 * * *'
- cron: "0 12 * * *"

pull_request:
branches:
- 'main'
- "main"
paths:
- '.github/workflows/dispatch-event.yml'
- '.github/workflows/redispatch-event.yml'
- '.github/actions/list-pr/**'
- '!**/*.md'
- ".github/workflows/dispatch-event.yml"
- ".github/workflows/redispatch-event.yml"
- ".github/actions/list-pr/**"
- "!**/*.md"

workflow_dispatch:
inputs:
labels:
required: false
type: string
default: 'module: PrivateUse1'
description: 'The labels on pull requests'
default: "module: PrivateUse1"
description: "The labels on pull requests"
hours:
required: false
type: number
default: 24
description: 'Pull requests created within this many hours will be listed'
description: "Pull requests created within this many hours will be listed"
limit:
required: false
type: number
default: -1
description: 'How many pull requests will be listed'
description: "How many pull requests will be listed"

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
Expand Down Expand Up @@ -58,7 +58,7 @@ jobs:

dispatch-pr:
if: ${{ needs.list-pr.outputs.prs != '[]' }}
name: 'Dispatch PR event - #${{ matrix.data.pull_request.number }}'
name: "Dispatch PR event - #${{ matrix.data.pull_request.number }}"
runs-on: ubuntu-latest
needs:
- list-pr
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/redispatch-event.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: 'Redispatch PyTorch events'
name: "Redispatch PyTorch events"

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

jobs:
redispatch-pr-event:
name: 'Redispatch PR event - #${{ github.event.client_payload.pull_request.number }}'
name: "Redispatch PR event - #${{ github.event.client_payload.pull_request.number }}"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
Loading