Skip to content

Commit 87228b5

Browse files
committed
Add workflow yml for validate.
1 parent b756a5e commit 87228b5

File tree

1 file changed

+100
-0
lines changed

1 file changed

+100
-0
lines changed

.github/workflows/Validate-GPU.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Validate-GPU
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
8+
env:
9+
PR_ID: ${{ github.event.pull_request.number }}
10+
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
11+
work_dir: /workspace
12+
TASK: GraphNet-CI-${{ github.event.pull_request.number }}-Validate
13+
BRANCH: ${{ github.event.pull_request.base.ref }}
14+
CI_name: ci-graphnet-validate
15+
CFS_DIR: /home/data/cfs
16+
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
17+
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/ci/paddle:4251d0b615371e0d0ed9040d7455e2b4" # cuda11.7
18+
19+
defaults:
20+
run:
21+
shell: bash
22+
23+
jobs:
24+
validate:
25+
name: Validate
26+
if: ${{ inputs.can-skip != 'true' }}
27+
runs-on:
28+
group: BD_BJ-V100
29+
steps:
30+
- name: Check docker image and run container
31+
env:
32+
CACHE_DIR: /home/data/cfs/.cache
33+
run: |
34+
container_name=${TASK}-${core_index}-$(date +%Y%m%d-%H%M%S)
35+
echo "container_name=${container_name}" >> ${{ github.env }}
36+
docker container ls -a --filter "name=GraphNet-CI-*-Validate-${core_index}*" --format "{{.ID}}" | xargs -r docker rm -f
37+
docker run -d -t --gpus all --name ${container_name} --shm-size=128g \
38+
-v "/home/data/cfs:/home/data/cfs" \
39+
-v "/home/data/cfs/.cache:/root/.cache" \
40+
-v "/home/data/cfs/.ccache:/root/.ccache" \
41+
-v "/dev/shm:/dev/shm" \
42+
-v ${{ github.workspace }}:/workspace/GraphNet \
43+
-e python \
44+
-e core_index \
45+
-e BRANCH \
46+
-e PR_ID \
47+
-e COMMIT_ID \
48+
-e work_dir \
49+
-e no_proxy \
50+
-e CI_name \
51+
-e CACHE_DIR \
52+
-e GITHUB_API_TOKEN \
53+
-e CFS_DIR \
54+
-w /workspace/GraphNet --network host ${docker_image}
55+
56+
- name: Check bypass
57+
id: check-bypass
58+
uses: ./.github/actions/check-bypass
59+
with:
60+
github-token: ${{ secrets.GITHUB_TOKEN }}
61+
workflow-name: ci-graphnet-validate
62+
63+
- name: Determine ci trigger
64+
if: steps.check-bypass.outputs.can-skip != 'true'
65+
env:
66+
work_dir: ${{ github.workspace }}
67+
run: |
68+
docker exec -t ${{ env.container_name }} /bin/bash -c '
69+
source ${{ github.workspace }}/../../../proxy
70+
source ${ci_scripts}/ce_cinn_diff.sh
71+
if [ ${sum_num} -eq 0 ];then
72+
echo "The modified files does not affect LayerCase in CE-CINN-Framework, so skip this ci."
73+
echo "skip_ci=true" >> ${{ github.env }}
74+
fi
75+
'
76+
77+
- name: Run check
78+
if: ${{ steps.check-bypass.outputs.can-skip != 'true' && env.skip_ci != 'true' }}
79+
env:
80+
work_dir: ${{ github.workspace }}
81+
run: |
82+
docker exec -t ${{ env.container_name }} /bin/bash -c '
83+
source ~/.bashrc
84+
pip config set global.cache-dir "$CACHE_DIR/pip"
85+
pip install /paddle/build/pr_whl/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
86+
cd /PaddleTest/framework/e2e/PaddleLT_new
87+
pip install -r requirement.txt
88+
source ./scene/set_ci_dy^dy2stcinn_train^dy2stcinn_eval_inputspec_env.sh
89+
python support/dict_to_yml.py --filename apibm_config.yml --data_str "$(cat $CACHE_DIR/cinn_config)"
90+
set -e
91+
python run.py
92+
exit $(head -n 1 "exit_code.txt")
93+
'
94+
95+
- name: Terminate and delete the container
96+
if: always()
97+
run: |
98+
set +e
99+
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
100+
docker rm -f ${{ env.container_name }}

0 commit comments

Comments
 (0)