Skip to content

Commit 3e0c2c6

Browse files
committed
update
1 parent 797ff13 commit 3e0c2c6

File tree

3 files changed

+47
-65
lines changed

3 files changed

+47
-65
lines changed

.github/actions/dependencies-action/action.yml

+2-9
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ inputs:
2929
runs:
3030
using: composite
3131
steps:
32-
# TODO(shink): Remove this step after building devel images
3332
- name: Install system dependencies
3433
shell: bash
3534
env:
@@ -40,19 +39,13 @@ runs:
4039
apt update
4140
apt install --no-install-recommends -y \
4241
git \
43-
gcc-10 \
44-
g++-10 \
42+
gcc \
43+
g++ \
4544
make \
4645
cmake \
4746
ninja-build
4847
echo "::endgroup::"
4948
50-
- name: Create symlinks for gcc and g++
51-
shell: bash
52-
run: |
53-
ln -s /usr/bin/gcc-10 /usr/bin/gcc
54-
ln -s /usr/bin/g++-10 /usr/bin/g++
55-
5649
- name: Show versions
5750
shell: bash
5851
run: |

.github/workflows/_ascend_npu_build.yml

+19-13
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,46 @@ jobs:
2929
runs-on: ${{ inputs.runner }}
3030
container:
3131
image: ${{ inputs.image }}
32-
volumes:
33-
- /home/runner/actions-runner/codes:/root/codes
3432
outputs:
3533
dist_name: ${{ steps.list-dist.outputs.dist_name }}
3634
steps:
37-
- name: Prepare the codes
38-
run: |
39-
cp -rf /root/codes /root/build
35+
- name: Install system dependencies
36+
uses: ./.github/actions/dependencies-action
4037

4138
- name: Checkout
4239
uses: actions/checkout@v4
4340

44-
- name: Install dependencies
45-
uses: ./.github/actions/dependencies-action
41+
- name: Checkout torch_npu
42+
uses: actions/checkout@v4
4643
with:
47-
pip_packages: |
48-
- wheel
49-
pip_requirements: |
50-
- /root/build/npu/pytorch/requirements.txt
44+
# TODO(shink): Use ascend/pytorch once this pr merged:
45+
# https://gitee.com/ascend/pytorch/pulls/12854
46+
repo: shink/torchnpu
47+
ref: feat/autoload
48+
submodules: recursive
49+
path: torch_npu
50+
51+
- name: Install pip dependencies
52+
working-directory: torch_npu
53+
run: |
54+
pip install wheel
55+
pip install -r requirements.txt
5156
5257
- name: List Python version
5358
id: list-py-version
59+
working-directory: torch_npu
5460
run: |
5561
py_version=$(python --version | awk '{print $2}' | cut -d '.' -f 1,2)
5662
echo "py_version=${py_version}" >> $GITHUB_OUTPUT
5763
5864
- name: Build torch_npu
59-
working-directory: /root/build/npu/pytorch
65+
working-directory: torch_npu
6066
run: |
6167
bash ci/build.sh --python=${{ steps.list-py-version.outputs.py_version }}
6268
6369
- name: List distribution package
6470
id: list-dist
65-
working-directory: /root/build/npu/pytorch/dist
71+
working-directory: torch_npu/dist
6672
run: |
6773
dist_name=$(ls torch_npu*.whl)
6874
dist_path=$(pwd)/${dist_name}

.github/workflows/ascend_npu_test.yml

+26-43
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# Note:
2-
# Same runner only needs one job named like .*fetch-and-rebase
3-
41
name: Ascend NPU Test Suite
52

63
on:
@@ -36,7 +33,8 @@ on:
3633
- ascendai/cann:7.1-openeuler2203sp2
3734
- ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9
3835
- ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9
39-
default: 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9'
36+
- latest
37+
default: 'latest'
4038
description: 'The docker image which will be loaded'
4139
device:
4240
required: true
@@ -73,52 +71,37 @@ jobs:
7371
set -e
7472
echo "runner=${{ github.event.inputs.runner || 'self-hosted' }}" >> $GITHUB_OUTPUT
7573
echo "device=${{ github.event.inputs.device || '/dev/davinci6' }}" >> $GITHUB_OUTPUT
76-
echo "image=${{ github.event.inputs.image || 'ascendai/cann:8.0.rc3.alpha002-910b-ubuntu22.04-py3.9' }}" >> $GITHUB_OUTPUT
77-
78-
# TODO(shink): remove this job, use actions/checkout instead
79-
fetch-and-rebase:
80-
name: Fetch and rebase
81-
runs-on: ${{ needs.prepare.outputs.runner }}
82-
needs:
83-
- prepare
84-
steps:
85-
- name: Pull latest codes for torch_npu
86-
uses: ./.github/actions/fetch-and-rebase
87-
with:
88-
repo_path: /home/runner/actions-runner/codes/npu/pytorch
89-
remote_branch: upstream/master
90-
loop: 10
74+
echo "image=${{ github.event.inputs.image || 'latest' }}" >> $GITHUB_OUTPUT
9175
9276
build:
9377
name: Build torch_npu
9478
needs:
9579
- prepare
96-
- fetch-and-rebase
9780
uses: ./.github/workflows/_ascend_npu_build.yml
9881
with:
9982
runner: ${{ needs.prepare.outputs.runner }}
10083
image: ${{ needs.prepare.outputs.image }}
10184

102-
test:
103-
name: Test torch_npu
104-
needs:
105-
- prepare
106-
- build
107-
uses: ./.github/workflows/_ascend_npu_test.yml
108-
with:
109-
runner: ${{ needs.prepare.outputs.runner }}
110-
image: ${{ needs.prepare.outputs.image }}
111-
device: ${{ needs.prepare.outputs.device }}
112-
artifact_name: ${{ needs.build.outputs.artifact_name }}
113-
114-
pytorch-examples:
115-
name: Run models
116-
needs:
117-
- prepare
118-
- test
119-
uses: ./.github/workflows/_ascend_npu_run_pytorch_examples.yml
120-
with:
121-
runner: ${{ needs.prepare.outputs.runner }}
122-
image: ${{ needs.prepare.outputs.image }}
123-
device: ${{ needs.prepare.outputs.device }}
124-
artifact_name: ${{ needs.build.outputs.artifact_name }}
85+
# test:
86+
# name: Test torch_npu
87+
# needs:
88+
# - prepare
89+
# - build
90+
# uses: ./.github/workflows/_ascend_npu_test.yml
91+
# with:
92+
# runner: ${{ needs.prepare.outputs.runner }}
93+
# image: ${{ needs.prepare.outputs.image }}
94+
# device: ${{ needs.prepare.outputs.device }}
95+
# artifact_name: ${{ needs.build.outputs.artifact_name }}
96+
#
97+
# pytorch-examples:
98+
# name: Run models
99+
# needs:
100+
# - prepare
101+
# - test
102+
# uses: ./.github/workflows/_ascend_npu_run_pytorch_examples.yml
103+
# with:
104+
# runner: ${{ needs.prepare.outputs.runner }}
105+
# image: ${{ needs.prepare.outputs.image }}
106+
# device: ${{ needs.prepare.outputs.device }}
107+
# artifact_name: ${{ needs.build.outputs.artifact_name }}

0 commit comments

Comments
 (0)