diff --git a/.github/workflows/_ascend_npu_benchmark.yml b/.github/workflows/_ascend_npu_benchmark.yml index 5989a4b..db1ee68 100644 --- a/.github/workflows/_ascend_npu_benchmark.yml +++ b/.github/workflows/_ascend_npu_benchmark.yml @@ -165,7 +165,7 @@ jobs: --output ascend_npu_benchmark.json - name: Upload the benchmark report file - id: upload-output + id: upload-report uses: actions/upload-artifact@v4 with: name: ascend_npu_benchmark.json @@ -179,7 +179,7 @@ jobs: python .ci/benchmark.py --write-gh-job-summary --path benchmark/ascend_npu_benchmark.json - name: Update README.md - if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + if: ${{ contains(fromJSON('["push", "schedule", "workflow_dispatch"]'), github.event_name) }} id: update-readme run: | python .ci/benchmark.py --update-readme --path benchmark/ascend_npu_benchmark.json @@ -207,5 +207,13 @@ jobs: body: | The torchbenchmark results running on Ascend NPU have changed, I'm updating the report in README.md. + Please check out the following resources for more information: + + - [Workflow run][1] + - [Torchbenchmark report (click to download)][2] + + [1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + [2]: ${{ steps.upload-report.outputs.artifact-url }} + cc: @Yikun @hipudding @FFFrog @Zhenbin-8 @zeshengzong @wjunLu @MengqingCao @shink reviewers: shink diff --git a/.github/workflows/_ascend_npu_build_torch.yml b/.github/workflows/_ascend_npu_build_torch.yml index c6a1273..43a9f6c 100644 --- a/.github/workflows/_ascend_npu_build_torch.yml +++ b/.github/workflows/_ascend_npu_build_torch.yml @@ -98,7 +98,6 @@ jobs: - name: Upload distribution artifact id: upload-dist - continue-on-error: true uses: actions/upload-artifact@v4 with: name: ${{ steps.list-dist.outputs.dist-name }} diff --git a/.github/workflows/_ascend_npu_build_torch_npu.yml b/.github/workflows/_ascend_npu_build_torch_npu.yml index 64b4159..e535e2c 100644 --- a/.github/workflows/_ascend_npu_build_torch_npu.yml +++ b/.github/workflows/_ascend_npu_build_torch_npu.yml @@ -119,7 +119,6 @@ jobs: - name: Upload distribution artifact id: upload-dist - continue-on-error: true uses: actions/upload-artifact@v4 with: name: ${{ steps.list-dist.outputs.dist-name }} diff --git a/.github/workflows/ascend_npu_test.yml b/.github/workflows/ascend_npu_test.yml index 658f695..0fefd6e 100644 --- a/.github/workflows/ascend_npu_test.yml +++ b/.github/workflows/ascend_npu_test.yml @@ -70,6 +70,13 @@ on: description: 'The device selected to run on' # Only cancel the previous runs when triggered by a pull_request event +# +# TODO: As the doc says, there can be at most one running and one pending job +# in a concurrency group at any time. But we want all workflows to be +# queued, not cancelled. This is a shortcomings of GitHub Actions. +# +# Doc: https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#concurrency +# Discussion: https://github.com/orgs/community/discussions/5435 concurrency: group: ${{ github.workflow }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} @@ -130,7 +137,9 @@ jobs: - prepare - build-torch - build - if: ${{ !cancelled() && (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) }} + if: | + !cancelled() && github.event_name != 'repository_dispatch' && + (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) uses: ./.github/workflows/_ascend_npu_ut.yml with: runner: ${{ needs.prepare.outputs.runner }} @@ -146,7 +155,9 @@ jobs: - build-torch - build - test - if: ${{ !cancelled() && (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) }} + if: | + !cancelled() && github.event_name != 'repository_dispatch' && + (success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success')) uses: ./.github/workflows/_ascend_npu_benchmark.yml with: runner: ${{ needs.prepare.outputs.runner }} diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml index 413cdf5..50fa33d 100644 --- a/.github/workflows/dispatch-event.yml +++ b/.github/workflows/dispatch-event.yml @@ -59,7 +59,7 @@ jobs: fail-fast: false max-parallel: 1 matrix: - data: ${{ fromJson(needs.list-pr.outputs.prs) }} + data: ${{ fromJSON(needs.list-pr.outputs.prs) }} steps: - name: Dispatch PR events to be out-of-tree test infra uses: peter-evans/repository-dispatch@v3 @@ -67,4 +67,4 @@ jobs: token: ${{ secrets.COSDT_BOT_TOKEN }} repository: cosdt/pytorch-integration-tests event-type: pytorch-pr-event - client-payload: ${{ toJson(matrix.data) }} + client-payload: ${{ toJSON(matrix.data) }} diff --git a/.github/workflows/redispatch-event.yml b/.github/workflows/redispatch-event.yml index a5cea8c..dfaec5f 100644 --- a/.github/workflows/redispatch-event.yml +++ b/.github/workflows/redispatch-event.yml @@ -13,11 +13,9 @@ jobs: uses: actions/checkout@v4 - name: Print PR event payload + continue-on-error: true 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) }}" + printf "payload: ${{ toJSON(github.event.client_payload) }}" - name: Redispatch PyTorch event uses: peter-evans/repository-dispatch@v3 @@ -25,4 +23,4 @@ jobs: token: ${{ secrets.COSDT_BOT_TOKEN }} repository: ${{ github.repository }} event-type: pytorch-pr-event-redispatch - client-payload: ${{ toJson(github.event.client_payload) }} + client-payload: ${{ toJSON(github.event.client_payload) }}