Skip to content

Commit 4acf7f5

Browse files
authored
[CI] Use latest Docker image (#5)
1 parent bce84a1 commit 4acf7f5

File tree

5 files changed

+83
-64
lines changed

5 files changed

+83
-64
lines changed

.github/workflows/_build-and-test.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ on:
1818

1919
jobs:
2020
build-and-test:
21+
name: build and test in ${{ inputs.image }} with ${{ inputs.device }}
2122
runs-on: ${{ inputs.runner }}
2223
defaults:
2324
run:
24-
shell: bash
25+
shell: bash -el {0}
2526
container:
2627
image: ${{ inputs.image }}
2728
env:
@@ -42,9 +43,11 @@ jobs:
4243
#- name: Set environment
4344
# run: |
4445
# source /root/.bashrc && conda activate torch_npu
46+
4547
- name: Prepare the codes
4648
run: |
47-
\cp -rf /root/codes/ /root/build
49+
cp -rf /root/codes /root/build
50+
4851
#- name: Compile torch
4952
# working-directory: /root/build/pytorch/pytorch
5053
# run: |
@@ -53,14 +56,57 @@ jobs:
5356
# export USE_CUDA=0
5457
# export USE_XNNPACK=0
5558
# python setup.py develop
59+
60+
- name: Install system dependencies
61+
env:
62+
DEBIAN_FRONTEND: noninteractive
63+
run: |
64+
sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
65+
apt update
66+
apt install --no-install-recommends -y \
67+
git \
68+
gcc-10 \
69+
g++-10 \
70+
make \
71+
cmake \
72+
ninja-build
73+
74+
- name: Create symlinks for gcc and g++
75+
run: |
76+
ln -s /usr/bin/gcc-10 /usr/bin/gcc
77+
ln -s /usr/bin/g++-10 /usr/bin/g++
78+
79+
- name: Install pip dependencies
80+
run: |
81+
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \
82+
wheel \
83+
setuptools \
84+
unittest-xml-reporting
85+
86+
- name: Show versions
87+
run: |
88+
set -x
89+
python --version
90+
pip --version
91+
gcc --version
92+
g++ --version
93+
make --version
94+
cmake --version
95+
ninja --version
96+
97+
- name: Show NPU info
98+
run: |
99+
npu-smi info
100+
56101
- name: Compile and install torch_npu
57102
working-directory: /root/build/npu/pytorch
58103
run: |
59-
pip install -r requirements.txt
104+
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
60105
bash ci/build.sh --python=`python --version | awk '{print $2}' | cut -d '.' -f 1,2`
61-
pip3 install dist/torch_npu*.whl
106+
pip install dist/torch_npu*.whl
107+
62108
- name: Do the test
63-
working-directory: /root/build/npu/pytorch
109+
working-directory: /root/build
64110
run: |
65-
pip3 install -r test/requirements.txt --no-deps
66-
python ci/access_control_test.py
111+
pip install -r npu/pytorch/test/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --no-deps
112+
python npu/pytorch/ci/access_control_test.py

.github/workflows/_fetch_and_rebase.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/ascend_npu_test.yml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@ on:
77
push:
88
branches:
99
- 'main'
10-
paths:
11-
- '!**/*.md'
1210

1311
pull_request:
1412
branches:
1513
- 'main'
16-
paths:
17-
- '!**/*.md'
1814

1915
release:
2016
types:
@@ -49,13 +45,20 @@ on:
4945
description: 'The device selected to run on'
5046
image:
5147
required: true
52-
type: string
53-
default: 'ascendai/cann:7.1-openeuler2203sp2'
48+
type: choice
49+
options:
50+
- 'ascendai/cann:7.1-openeuler2203sp2'
51+
- 'ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9'
52+
default: 'ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9'
5453
description: The docker image which will be loaded
5554

55+
concurrency:
56+
group: ${{ github.workflow }}
57+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
58+
5659
jobs:
5760
prepare:
58-
name: prepare
61+
name: Prepare
5962
runs-on: ubuntu-latest
6063
outputs:
6164
runner: ${{ steps.set-param.outputs.runner }}
@@ -68,22 +71,26 @@ jobs:
6871
set -e
6972
echo "runner=${{ github.event.inputs.runner || 'self-hosted' }}" >> $GITHUB_OUTPUT
7073
echo "device=${{ github.event.inputs.device || '/dev/davinci6' }}" >> $GITHUB_OUTPUT
71-
echo "image=${{ github.event.inputs.image || 'ascendai/cann:7.1-openeuler2203sp2' }}" >> $GITHUB_OUTPUT
74+
echo "image=${{ github.event.inputs.image || 'ascendai/cann:8.0.rc2.alpha003-910b-ubuntu22.04-py3.9' }}" >> $GITHUB_OUTPUT
7275
73-
linux-py3_8-fetch-and-rebase:
74-
name: linux-py3_8-7.0.RC1.alpha005
76+
fetch-and-rebase:
77+
name: Fetch and rebase
78+
runs-on: ${{ needs.prepare.outputs.runner }}
7579
needs:
7680
- prepare
77-
uses: ./.github/workflows/_fetch_and_rebase.yml
78-
with:
79-
runner: ${{ needs.prepare.outputs.runner }}
80-
loop: 10
81+
steps:
82+
- name: Pull latest codes for torch_npu
83+
uses: ./.github/actions/fetch-and-rebase
84+
with:
85+
repo_path: /home/runner/actions-runner/codes/npu/pytorch
86+
remote_branch: upstream/master
87+
loop: 10
8188

82-
linux-py3_8-build-and-test:
83-
name: linux-py3_8-7.0.RC1.alpha005
89+
build-and-test:
90+
name: Build and test
8491
needs:
8592
- prepare
86-
- linux-py3_8-fetch-and-rebase
93+
- fetch-and-rebase
8794
uses: ./.github/workflows/_build-and-test.yml
8895
with:
8996
runner: ${{ needs.prepare.outputs.runner }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

README.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,15 @@ across various devices by running comprehensive GitHub workflows.
77

88
## Accelerator Integration Test Results
99

10-
| [torch_npu][1] |
11-
|----------------------------------------|
12-
| [![torch_npu periodic workflow][2]][3] |
13-
| [![torch_npu manual workflow][4]][5] |
10+
| [torch_npu][1] |
11+
|----------------------------------|
12+
| [![Ascend NPU Test Suite][2]][3] |
1413

1514
[1]: https://github.com/ascend/pytorch
1615

17-
[2]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/periodic.yml/badge.svg
16+
[2]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/ascend_npu_test.yml/badge.svg
1817

19-
[3]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/periodic.yml
20-
21-
[4]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/manual.yml/badge.svg
22-
23-
[5]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/manual.yml
18+
[3]: https://github.com/cosdt/pytorch-integration-tests/actions/workflows/ascend_npu_test.yml
2419

2520
## Overview
2621

0 commit comments

Comments
 (0)