Skip to content

Ascend NPU Test Suite #4046

Ascend NPU Test Suite

Ascend NPU Test Suite #4046

name: "Ascend NPU Test Suite"
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"
- ".github/workflows/_ascend_npu_torchtitan.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"
- ".github/workflows/_ascend_npu_torchtitan.yml"
- ".ci/**"
- "ascend_npu/**"
- "src/**"
- "!**/*.md"
release:
types:
- "published"
schedule:
- cron: "0 12 * * *"
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"
# 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 }}-${{ github.event_name }}-${{ github.event.client_payload.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.set-env.outputs.runner }}
image: ${{ steps.set-env.outputs.image }}
device: ${{ steps.set-env.outputs.device }}
ref: ${{ steps.list-ref.outputs.ref }}
pr-number: ${{ steps.list-ref.outputs.pr_number }}
steps:
- name: Set environment params
id: set-env
run: |
echo "runner=${{ github.event.inputs.runner || 'linux-arm64-npu-1' }}" >> $GITHUB_OUTPUT
echo "image=${{ github.event.inputs.image || 'ascendai/cann:latest' }}" >> $GITHUB_OUTPUT
# TODO(shink): List ghstack PR's ref
- name: List ref to the PyTorch branch
id: list-ref
if: ${{ github.event_name == 'repository_dispatch' }}
run: |
echo "pr_number=${{ github.event.client_payload.pull_request.number }}" >> $GITHUB_OUTPUT
echo "ref=refs/pull/${{ github.event.client_payload.pull_request.number }}/merge" >> $GITHUB_OUTPUT
build-torch:
name: Build torch
needs:
- prepare
if: ${{ needs.prepare.outputs.ref }}
uses: ./.github/workflows/_ascend_npu_build_torch.yml
with:
runner: ${{ needs.prepare.outputs.runner }}
image: ${{ needs.prepare.outputs.image }}
ref: ${{ needs.prepare.outputs.ref }}
pr-number: ${{ needs.prepare.outputs.pr-number }}
build:
name: Build torch_npu
needs:
- prepare
- build-torch
if: ${{ !cancelled() && (success() || needs.build-torch.result == 'skipped') }}
uses: ./.github/workflows/_ascend_npu_build_torch_npu.yml
with:
runner: ${{ needs.prepare.outputs.runner }}
image: ${{ needs.prepare.outputs.image }}
torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }}
torchtitan:
name: Run torchtitan
needs:
- prepare
- build-torch
- build
if: |
!cancelled() && github.event_name != 'repository_dispatch' &&
(success() || (needs.build-torch.result == 'skipped' && needs.build.result == 'success'))
uses: ./.github/workflows/_ascend_npu_torchtitan.yml

Check failure on line 132 in .github/workflows/ascend_npu_test.yml

View workflow run for this annotation

GitHub Actions / Ascend NPU Test Suite

Invalid workflow file

The workflow is not valid. .github/workflows/ascend_npu_test.yml (Line: 132, Col: 11): Input device is required, but not provided while calling. .github/workflows/ascend_npu_test.yml (Line: 132, Col: 11): Secret pr-token is required, but not provided while calling.
with:
runner: ${{ needs.prepare.outputs.runner }}
image: ${{ needs.prepare.outputs.image }}
torch-artifact: ${{ needs.build-torch.outputs.torch-artifact }}
torch-npu-artifact: ${{ needs.build.outputs.torch-npu-artifact }}