forked from PaddlePaddle/PaddleCustomDevice
-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (103 loc) · 4.34 KB
/
_IXUCA.yml
File metadata and controls
116 lines (103 loc) · 4.34 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
name: PR-CI-IXUCA
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: 'iluvatar'
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
PR-CI-IXUCA:
name: PR-CI-IXUCA
needs: check-bypass
if: ${{ needs.check-bypass.outputs.can-skip != 'true' && github.repository_owner == 'PaddlePaddle' }}
runs-on: iluvatar-gpu-2
container:
image: ccr-2vdh3abv-pub.cnc.bj.baidubce.com/device/paddle-ixuca:latest
env:
LD_LIBRARY_PATH: /usr/local/corex/lib
LIBRARY_PATH: /usr/local/corex/lib
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 }}-ixuca
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
steps:
- name: Download Code
run: |
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
cd PaddleCustomDevice
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 IXUCA
id: run-ixuca
if: steps.check-bypass.outputs.can-skip != 'true'
run: |
echo "=========== Checking PR Changes If IXUCA FULL CI Needed ==========="
cd PaddleCustomDevice
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_ixuca_only=$(git --no-pager diff --name-only remotes/origin/${BRANCH} | grep "backends/iluvatar_gpu" | wc -l)
echo "Changed files:"
git --no-pager diff --name-only remotes/origin/${BRANCH}
should_skip="false"
if [ $change_numbers -ne $change_backend ]; then
echo "Common file changed, continue to run IXUCA FULL CI test ..."
elif [ $change_ixuca_only -eq 0 ]; then
echo "NO IXUCA backend changes found, skip IXUCA FULL CI ...."
should_skip="true"
else
echo "IXUCA backend changed, run FULL CI ..."
fi
echo "should_skip=$should_skip" >> $GITHUB_OUTPUT
- name: Build and Install paddle_iluvatar_gpu
if: steps.check-bypass.outputs.can-skip != 'true' && steps.run-ixuca.outputs.should_skip != 'true'
run: |
export PATH=/usr/local/corex/bin:$PATH
mkdir -p PaddleCustomDevice/Paddle/third_party/mklml/Linux
curl -o PaddleCustomDevice/Paddle/third_party/mklml/Linux/csrmm_mklml_lnx_2019.0.5.tgz http://paddlepaddledeps.bj.bcebos.com/csrmm_mklml_lnx_2019.0.5.tgz
tar xf PaddleCustomDevice/Paddle/third_party/mklml/Linux/csrmm_mklml_lnx_2019.0.5.tgz
python3 -m pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
pip show paddlepaddle
python3 -m pip install parameterized
export PADDLE_VERSION=0.0.0
cd PaddleCustomDevice/backends/iluvatar_gpu
# build
bash build_paddle.sh
# Install
bash install_paddle.sh
- name: Run Tests
if: steps.check-bypass.outputs.can-skip != 'true' && steps.run-ixuca.outputs.should_skip != 'true'
run: |
pip show parameterized
python3 -m pip install parameterized
export FLAG_SKIP_FLOAT64=1
cd PaddleCustomDevice/backends/iluvatar_gpu/tests
# Run tests
bash run_test.sh
- name: Terminate and delete the container
if: always()
run: |
rm -rf * .[^.]*
chmod -R 777 . || true