diff --git a/.github/workflows/_ascend_npu_benchmark.yml b/.github/workflows/_ascend_npu_benchmark.yml index db1ee68..2377e46 100644 --- a/.github/workflows/_ascend_npu_benchmark.yml +++ b/.github/workflows/_ascend_npu_benchmark.yml @@ -210,7 +210,7 @@ jobs: Please check out the following resources for more information: - [Workflow run][1] - - [Torchbenchmark report (click to download)][2] + - [Torchbenchmark report][2] (click to download) [1]: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} [2]: ${{ steps.upload-report.outputs.artifact-url }} diff --git a/.github/workflows/_ascend_npu_build_torch.yml b/.github/workflows/_ascend_npu_build_torch.yml index 43a9f6c..456a0bb 100644 --- a/.github/workflows/_ascend_npu_build_torch.yml +++ b/.github/workflows/_ascend_npu_build_torch.yml @@ -96,6 +96,18 @@ jobs: echo "dist-name=${dist_name}" >> $GITHUB_OUTPUT echo "dist-path=${dist_path}" >> $GITHUB_OUTPUT + - name: Install torch + working-directory: pytorch/dist + run: | + pip install ${{ steps.list-dist.outputs.dist-name }} + + - name: List torch version + id: list-version + run: | + torch_version=$(python -c "import torch; print(torch.__version__)") + echo "torch version: ${torch_version}" + echo "torch-version=${torch_version}" >> $GITHUB_OUTPUT + - name: Upload distribution artifact id: upload-dist uses: actions/upload-artifact@v4 @@ -109,5 +121,5 @@ jobs: - name: Write to workflow job summary if: ${{ steps.upload-dist.outputs.artifact-url }} run: | - echo "## torch built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY + echo "## torch-${{ steps.list-version.outputs.torch-version }} built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY echo "You can download the distribution package [here](${{ steps.upload-dist.outputs.artifact-url }})." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/_ascend_npu_build_torch_npu.yml b/.github/workflows/_ascend_npu_build_torch_npu.yml index e535e2c..9c6d579 100644 --- a/.github/workflows/_ascend_npu_build_torch_npu.yml +++ b/.github/workflows/_ascend_npu_build_torch_npu.yml @@ -11,6 +11,10 @@ on: required: true type: string description: 'The docker image which will be used to build' + device: + required: true + type: string + description: 'The device selected to run on' torch-artifact: required: false type: string @@ -33,8 +37,18 @@ jobs: runs-on: ${{ inputs.runner }} container: image: ${{ inputs.image }} + volumes: + - /usr/local/dcmi:/usr/local/dcmi + - /usr/local/bin/npu-smi:/usr/local/bin/npu-smi + - /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ + - /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info + - /etc/ascend_install.info:/etc/ascend_install.info options: >- --network host + --device ${{ inputs.device }} + --device /dev/davinci_manager + --device /dev/devmm_svm + --device /dev/hisi_hdc env: HTTP_PROXY: http://127.0.0.1:10809 HTTPS_PROXY: http://127.0.0.1:10809 @@ -117,6 +131,20 @@ jobs: echo "dist-name=${dist_name}" >> $GITHUB_OUTPUT echo "dist-path=${dist_path}" >> $GITHUB_OUTPUT + - name: Install torch_npu + working-directory: torch_npu/dist + run: | + pip install ${{ steps.list-dist.outputs.dist-name }} + + - name: List torch_npu version + id: list-version + run: | + torch_version=$(python -c "import torch; print(torch.__version__)") + torch_npu_version=$(python -c "import torch_npu; print(torch_npu.__version__)") + echo "torch version: ${torch_version}" + echo "torch_npu version: ${torch_npu_version}" + echo "torch-npu-version=${torch_npu_version}" >> $GITHUB_OUTPUT + - name: Upload distribution artifact id: upload-dist uses: actions/upload-artifact@v4 @@ -130,5 +158,5 @@ jobs: - name: Write to workflow job summary if: ${{ steps.upload-dist.outputs.artifact-url }} run: | - echo "## torch_npu built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY + echo "## torch_npu-${{ steps.list-version.outputs.torch-npu-version }} built successfully! :rocket:" >> $GITHUB_STEP_SUMMARY echo "You can download the distribution package [here](${{ steps.upload-dist.outputs.artifact-url }})." >> $GITHUB_STEP_SUMMARY diff --git a/.github/workflows/ascend_npu_test.yml b/.github/workflows/ascend_npu_test.yml index 0fefd6e..6004f3f 100644 --- a/.github/workflows/ascend_npu_test.yml +++ b/.github/workflows/ascend_npu_test.yml @@ -78,7 +78,7 @@ on: # 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 }} + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.client_payload.pull_request.number || github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} jobs: @@ -129,6 +129,7 @@ jobs: with: runner: ${{ needs.prepare.outputs.runner }} image: ${{ needs.prepare.outputs.image }} + device: ${{ needs.prepare.outputs.device }} torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }} test: diff --git a/.github/workflows/dispatch-event.yml b/.github/workflows/dispatch-event.yml index 50fa33d..3722746 100644 --- a/.github/workflows/dispatch-event.yml +++ b/.github/workflows/dispatch-event.yml @@ -1,14 +1,6 @@ name: 'Dispatch PyTorch events' on: - pull_request: - branches: - - 'main' - paths: - - '.github/workflows/dispatch-event.yml' - - '.github/actions/list-pr/**' - - '!**/*.md' - schedule: - cron: '0 12 * * *' @@ -61,7 +53,7 @@ jobs: matrix: data: ${{ fromJSON(needs.list-pr.outputs.prs) }} steps: - - name: Dispatch PR events to be out-of-tree test infra + - name: Dispatch PR event to the out-of-tree test infra uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.COSDT_BOT_TOKEN }} diff --git a/.github/workflows/redispatch-event.yml b/.github/workflows/redispatch-event.yml index dfaec5f..e1f8fb5 100644 --- a/.github/workflows/redispatch-event.yml +++ b/.github/workflows/redispatch-event.yml @@ -6,7 +6,7 @@ on: jobs: redispatch-pr-event: - name: 'Redispatch PyTorch events for #${{ 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 @@ -17,7 +17,7 @@ jobs: run: | printf "payload: ${{ toJSON(github.event.client_payload) }}" - - name: Redispatch PyTorch event + - name: Redispatch PR event uses: peter-evans/repository-dispatch@v3 with: token: ${{ secrets.COSDT_BOT_TOKEN }}