1- name : ' _ascend_npu_benchmark'
1+ name : " _ascend_npu_benchmark"
22
33on :
44 workflow_call :
55 inputs :
66 runner :
77 required : true
88 type : string
9- description : ' The runner selected to run on'
9+ description : " The runner selected to run on"
1010 image :
1111 required : true
1212 type : string
13- description : ' The docker image which will be loaded'
13+ description : " The docker image which will be loaded"
1414 device :
1515 required : true
1616 type : string
17- description : ' The device selected to run on'
17+ description : " The device selected to run on"
1818 torch-artifact :
1919 required : false
2020 type : string
21- description : ' The distribution artifact name of torch'
21+ description : " The distribution artifact name of torch"
2222 torch-npu-artifact :
2323 required : true
2424 type : string
25- description : ' The distribution artifact name of torch_npu'
25+ description : " The distribution artifact name of torch_npu"
2626 secrets :
2727 pr-token :
28- description : ' A token used to create a pull request'
28+ description : " A token used to create a pull request"
2929 required : true
3030
3131# Bash shells do not use ~/.profile or ~/.bashrc so these shells need to be explicitly
@@ -36,13 +36,16 @@ defaults:
3636 shell : bash -el {0}
3737
3838jobs :
39- test :
39+ benchmark :
4040 name : run benchmarks for torch_npu
4141 runs-on : ${{ inputs.runner }}
4242 container :
4343 image : ${{ inputs.image }}
4444 env :
4545 HF_ENDPOINT : https://hf-mirror.com
46+ outputs :
47+ changed : ${{ steps.update-readme.outputs.changed }}
48+ report-url : ${{ steps.upload-report.outputs.artifact-url }}
4649 steps :
4750 - name : Show NPU info
4851 run : |
@@ -176,19 +179,44 @@ jobs:
176179 echo "changed=true" >> $GITHUB_OUTPUT
177180 fi
178181
182+ - name : Upload README.md
183+ if : ${{ steps.update-readme.outputs.changed == 'true' }}
184+ id : upload-readme
185+ uses : actions/upload-artifact@v4
186+ with :
187+ name : README.md
188+ path : README.md
189+ if-no-files-found : error
190+ retention-days : 1
191+ overwrite : true
192+
193+ create-pr :
194+ if : ${{ needs.benchmark.outputs.changed == 'true' }}
195+ name : Create a pull request for changes to README.md
196+ runs-on : ubuntu-latest
197+ needs :
198+ - benchmark
199+ steps :
200+ - name : Checkout
201+ uses : actions/checkout@v4
202+
203+ - name : Download README.md
204+ uses : actions/download-artifact@v4
205+ with :
206+ name : README.md
207+
179208 # See: https://github.com/peter-evans/create-pull-request
180209 - name : Create a pull request for changes to README.md
181- if : ${{ steps.update-readme.outputs.changed == 'true' }}
182210 uses : peter-evans/create-pull-request@v7
183211 with :
184212 token : ${{ secrets.pr-token }}
185213 base : ${{ github.head_ref }}
186- committer : ' cosdt-bot <[email protected] > ' 187- author : ' cosdt-bot <[email protected] >' 188- commit-message : ' Update torchbenchmark report in README.md '
214+ commit-message : " Update torchbenchmark report in README.md "
215+ committer : " cosdt-bot <[email protected] >" 216+ author : " cosdt-bot <[email protected] > " 189217 add-paths : README.md
190218 branch : ascend-npu/benchmark
191- title : ' [Ascend NPU] Update torchbenchmark report in README.md'
219+ title : " [Ascend NPU] Update torchbenchmark report in README.md"
192220 body : |
193221 The torchbenchmark results running on Ascend NPU have changed, I'm updating the report in README.md.
194222
@@ -198,7 +226,7 @@ jobs:
198226 - [Torchbenchmark report][2] (click to download)
199227
200228 [1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
201- [2]: ${{ steps.upload-report .outputs.artifact -url }}
229+ [2]: ${{ needs.benchmark .outputs.report -url }}
202230
203231 cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink
204232 reviewers : shink
0 commit comments