Skip to content

Add support for building torch from source #248

Add support for building torch from source

Add support for building torch from source #248

Workflow file for this run

name: Ascend NPU Test Suite
on:
push:
branches:
- 'main'
paths:
- '.github/workflows/ascend_npu_test.yml'
- '.github/workflows/_ascend_npu_build.yml'
- '.github/workflows/_ascend_npu_ut.yml'
- '.github/workflows/_ascend_npu_benchmark.yml'
- '.github/actions/**'
- '.ci/**'
- 'ascend_npu/**'
- 'src/**'
- '!**/*.md'
pull_request:
branches:
- 'main'
paths:
- '.github/workflows/ascend_npu_test.yml'
- '.github/workflows/_ascend_npu_build.yml'
- '.github/workflows/_ascend_npu_ut.yml'
- '.github/workflows/_ascend_npu_benchmark.yml'
- '.github/actions/**'
- '.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:
- self-hosted
- npu-arm64
default: 'self-hosted'
description: 'The runner 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
- 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
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
runner: ${{ steps.set-param.outputs.runner }}
image: ${{ steps.set-param.outputs.image }}
device: ${{ steps.set-param.outputs.device }}
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/davinci5' }}" >> $GITHUB_OUTPUT
echo "image=${{ github.event.inputs.image || 'ascendai/cann:latest' }}" >> $GITHUB_OUTPUT
build-torch:
name: Build torch
needs:
- prepare
uses: ./.github/workflows/_common_build_torch.yml
with:
runner: ${{ needs.prepare.outputs.runner }}
image: ${{ needs.prepare.outputs.image }}
# build:
# name: Build torch_npu
# needs:
# - build-torch
# uses: ./.github/workflows/_ascend_npu_build.yml
# with:
# runner: ${{ needs.prepare.outputs.runner }}
# image: ${{ needs.prepare.outputs.image }}
#
# test:
# name: Test torch_npu
# needs:
# - prepare
# - build
# uses: ./.github/workflows/_ascend_npu_ut.yml
# with:
# runner: ${{ needs.prepare.outputs.runner }}
# image: ${{ needs.prepare.outputs.image }}
# device: ${{ needs.prepare.outputs.device }}
# artifact_name: ${{ needs.build.outputs.artifact_name }}
#
# benchmark:
# name: Run benchmarks
# needs:
# - prepare
# - build
# - test
# uses: ./.github/workflows/_ascend_npu_benchmark.yml
# with:
# runner: ${{ needs.prepare.outputs.runner }}
# image: ${{ needs.prepare.outputs.image }}
# device: ${{ needs.prepare.outputs.device }}
# artifact_name: ${{ needs.build.outputs.artifact_name }}
# secrets:
# pr-token: ${{ secrets.COSDT_BOT_TOKEN }}