Ascend NPU Test Suite #3939
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
| name: 'download.pytorch.org' | |
| on: | |
| push: | |
| branches: | |
| - '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' | |
| pull_request: | |
| branches: | |
| - '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' | |
| release: | |
| types: | |
| - 'published' | |
| schedule: | |
| - cron: '0,30 * * * *' | |
| repository_dispatch: | |
| types: [pytorch-pr-event-redispatch] | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| required: true | |
| type: choice | |
| options: | |
| - npu-arm64 | |
| - linux-arm64-npu-0 | |
| - linux-arm64-npu-1 | |
| - linux-arm64-npu-2 | |
| - linux-arm64-npu-4 | |
| 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' | |
| device: | |
| required: true | |
| type: choice | |
| options: | |
| - /dev/davinci1 | |
| - /dev/davinci2 | |
| - /dev/davinci3 | |
| - /dev/davinci4 | |
| - /dev/davinci5 | |
| - /dev/davinci6 | |
| - /dev/davinci7 | |
| - /dev/davinci8 | |
| default: '/dev/davinci5' | |
| 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 | |
| jobs: | |
| job_0: | |
| runs-on: linux-arm64-npu-1 | |
| container: | |
| image: ascendai/cann:latest | |
| steps: | |
| - name: Show NPU info | |
| run: | | |
| npu-smi info | |
| - name: Config mirrors | |
| run: | | |
| sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list | |
| pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple | |
| - name: Install system dependencies | |
| run: | | |
| apt-get update | |
| apt-get install -y \ | |
| git gcc g++ make cmake ninja-build curl \ | |
| libgl1 libglib2.0-0 libsndfile1 | |
| # See: https://github.com/actions/checkout/issues/363#issuecomment-1915075699 | |
| # See: https://github.com/hunshcn/gh-proxy/issues/28#issuecomment-773769630 | |
| - name: Config git | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config --global url."https://gh-proxy.test.osinfra.cn/https://github.com/".insteadOf https://github.com/ | |
| - name: Install torch_npu dependencies | |
| run: | | |
| pip install -r https://raw.githubusercontent.com/Ascend/pytorch/refs/heads/master/requirements.txt |