forked from PaddlePaddle/PaddleCustomDevice
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (132 loc) · 5.74 KB
/
_910B-ARM.yml
File metadata and controls
143 lines (132 loc) · 5.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: PR-CI-910B-ARM
on:
workflow_call:
inputs:
workflow-name:
type: string
required: false
clone_dir:
type: string
required: false
default: 'PaddlecustomDevice'
is_pr:
type: string
required: false
default: 'true'
jobs:
check-bypass:
name: Check bypass
if: ${{ inputs.can-skip != 'true' }}
uses: ./.github/workflows/check-bypass.yml
with:
workflow-name: '910b-arm'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
PR-CI-910B-ARM:
name: PR-CI-910B-ARM
needs: check-bypass
if: ${{ needs.check-bypass.outputs.can-skip != 'true' }}
runs-on:
group: 910B-ARM
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
BRANCH: develop
TASK: paddle-CI-${{ github.event.pull_request.number }}-npu
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
steps:
- name: Check docker image and run container
env:
GIT_PR_ID: ${{ github.event.pull_request.number || '0' }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_ID: ${{ github.run_id }}
cache_dir: /root/.cache
ccache_dir: /root/.ccache
docker_image: registry.baidubce.com/device/paddle-npu:cann80RC1-ubuntu20-aarch64-gcc84-py39
run: |
if [[ "${{ runner.name }}" == "IXUCA-2" ]];then
echo "IXUCA-2"
export ASCEND_RT_VISIBLE_DEVICES=4,5,6,7
elif [[ "${{ runner.name }}" == "IXUCA-3" ]];then
echo "IXUCA-3"
export ASCEND_RT_VISIBLE_DEVICES=8,9,10,11
elif [[ "${{ runner.name }}" == "IXUCA-4" ]];then
echo "IXUCA-4"
export ASCEND_RT_VISIBLE_DEVICES=12,13,14,15
else
echo echo "IXUCA-1"
export ASCEND_RT_VISIBLE_DEVICES=0,1,2,3
fi
echo ${ASCEND_RT_VISIBLE_DEVICES}
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker run --shm-size=128G \
-d -t --name ${container_name} \
--privileged --network=host \
-e PR_ID \
-e COMMIT_ID \
-e BRANCH \
-e no_proxy \
-e USE_910B=1 \
-e FLAGS_npu_storage_format=0 \
-e ASCEND_RT_VISIBLE_DEVICES=${ASCEND_RT_VISIBLE_DEVICES} \
-v ${cache_dir}:/root/.cache \
-v ${ccache_dir}:/root/.ccache \
-v /usr/local/Ascend/driver:/usr/local/Ascend/driver \
-v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \
-v /usr/local/dcmi:/usr/local/dcmi \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/PaddleCustomDevice -w /PaddleCustomDevice \
${docker_image} /bin/bash
- name: Download Code
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
rm -rf /PaddleCustomDevice/* /PaddleCustomDevice/.[^.]* 2>/dev/null || true
source ${{ github.workspace }}/../../../proxy
set -x
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PaddleCustomDevice/PR/${PR_ID}/${COMMIT_ID}/PaddleCustomDevice.tar.gz --no-check-certificate
echo "Extracting PaddleCustomDevice.tar.gz"
tar -xf PaddleCustomDevice.tar.gz --strip-components=1
git config --global --add safe.directory "*"
git remote add upstream https://github.com/PaddlePaddle/PaddleCustomDevice.git
git merge ${BRANCH} --no-edit
git --no-pager log --pretty=oneline -5'
- name: RUN 910B-ARM
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
# !!!!! SKIP IF NO NPU CHANGE !!!!
echo "=========== Checking PR Changes If NPU FULL CI Needed ==========="
change_numbers=$(git --no-pager diff --name-only remotes/origin/${BRANCH} | wc -l)
change_backend=$(git --no-pager diff --name-only remotes/origin/${BRANCH} | grep "backends/"| wc -l)
change_npu_only=$(git --no-pager diff --name-only remotes/origin/${BRANCH} | grep "backends/npu"| wc -l)
git --no-pager diff --name-only remotes/origin/${BRANCH}
if [ $change_numbers -ne $change_backend ]; then
echo "Common file changed, continue to run NPU FULL CI test ..."
elif [ $change_npu_only -eq 0 ] ; then
echo "NO NPU backend changes found, skip NPU FULL CI ...."
exit 0
fi
echo "============ CANN Version ============="
source ~/.bashrc
echo "============ Install PaddlePaddle CPU ============="
PATH=/usr/local/bin:${PATH}
ln -sf $(which python3.9) /usr/local/bin/python
ln -sf $(which pip3.9) /usr/local/bin/pip
pip install -U numpy==1.26.4 safetensors
python -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
python -c "import paddle; print(paddle.__version__)"
python -c "import paddle; print(paddle.version.commit)"
# Install python packages required for incremental coverage
python -m pip install PyGithub
export LD_PRELOAD=/lib/aarch64-linux-gnu/libgomp.so.1:$LD_PRELOAD
export PADDLE_VERSION=0.0.0
bash backends/npu/tools/pr_ci_npu.sh'
- name: Terminate and delete the container
if: always()
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
rm -rf * .[^.]*
chmod -R 777 . || true
'
docker stop ${container_name}
docker rm ${container_name}