Ascend NPU Test Suite #95
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # Note: | |
| # Same runner only needs one job named like .*fetch-and-rebase | |
| name: Ascend NPU Test Suite | |
| on: | |
| push: | |
| branches: | |
| - 'main' | |
| pull_request: | |
| branches: | |
| - 'main' | |
| release: | |
| types: | |
| - 'published' | |
| schedule: | |
| - cron: '0 12 * * *' | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| required: true | |
| type: choice | |
| options: | |
| - self-hosted | |
| - npu-arm64 | |
| default: 'self-hosted' | |
| description: 'The runner selected to run on' | |
| device: | |
| required: true | |
| type: choice | |
| options: | |
| - /dev/davinci1 | |
| - /dev/davinci2 | |
| - /dev/davinci3 | |
| - /dev/davinci4 | |
| - /dev/davinci5 | |
| - /dev/davinci6 | |
| - /dev/davinci7 | |
| - /dev/davinci8 | |
| default: '/dev/davinci6' | |
| description: 'The device selected to run on' | |
| image: | |
| required: true | |
| type: choice | |
| options: | |
| - ascendai/cann:7.1-openeuler2203sp2 | |
| - ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9 | |
| - ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9 | |
| default: 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9' | |
| description: 'The docker image which will be loaded' | |
| # Only cancel the previous runs when triggered by a pull request | |
| concurrency: | |
| group: '${{ github.workflow }}-${{ github.event_name }}' | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| runs-on: ubuntu-latest | |
| outputs: | |
| runner: ${{ steps.set-param.outputs.runner }} | |
| device: ${{ steps.set-param.outputs.device }} | |
| image: ${{ steps.set-param.outputs.image }} | |
| steps: | |
| - name: Set param | |
| id: set-param | |
| run: | | |
| set -e | |
| echo "runner=${{ github.event.inputs.runner || 'self-hosted' }}" >> $GITHUB_OUTPUT | |
| echo "device=${{ github.event.inputs.device || '/dev/davinci6' }}" >> $GITHUB_OUTPUT | |
| echo "image=${{ github.event.inputs.image || 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9' }}" >> $GITHUB_OUTPUT | |
| fetch-and-rebase: | |
| name: Fetch and rebase | |
| runs-on: ${{ needs.prepare.outputs.runner }} | |
| needs: | |
| - prepare | |
| steps: | |
| - name: Pull latest codes for torch_npu | |
| uses: ./.github/actions/fetch-and-rebase | |
| with: | |
| repo_path: /home/runner/actions-runner/codes/npu/pytorch | |
| remote_branch: upstream/master | |
| loop: 10 | |
| build-and-test: | |
| name: Build and test | |
| needs: | |
| - prepare | |
| - fetch-and-rebase | |
| uses: ./.github/workflows/_build-and-test.yml | |
| with: | |
| runner: ${{ needs.prepare.outputs.runner }} | |
| device: ${{ needs.prepare.outputs.device }} | |
| image: ${{ needs.prepare.outputs.image }} |