Skip to content

Commit 15d692f

Browse files
authored
[CI] Add CE-CINN-Framework (#72696)
* test=document_fix * test=document_fix * test=document_fix * test=document_fix * test=document_fix * test=document_fix * test=document_fix * test=document_fix all * test=document_fix * test=document_fix * test=document_fix * test=document_fix * test=document_fix
1 parent 0fdf0f1 commit 15d692f

File tree

6 files changed

+188
-2
lines changed

6 files changed

+188
-2
lines changed

.github/workflows/Build-develop.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ env:
1414
COMMIT_ID: ${{ github.sha }}
1515
work_dir: /paddle
1616
PADDLE_ROOT: /paddle
17-
TASK: paddle-CI-bbild-develop
17+
TASK: paddle-CI-build-develop-${{ github.sha }}
1818
ci_scripts: /paddle/ci
1919
BRANCH: ${{ github.base.ref }}
20-
CI_name: build-develop
20+
CI_name: build
2121
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
2222

2323
jobs:

.github/workflows/CI.yml

+8
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ jobs:
7878
can-skip: ${{ needs.build.outputs.can-skip }}
7979
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
8080

81+
ce-cinn-framework:
82+
name: CE-CINN-Framework
83+
uses: ./.github/workflows/_CE-CINN-Framework.yml
84+
needs: [build-docker, build]
85+
with:
86+
can-skip: ${{ needs.build.outputs.can-skip }}
87+
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
88+
8189
api-benchmark:
8290
name: Api-Benchmark
8391
uses: ./.github/workflows/_Api-Benchmark.yml
+129
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
name: CE-CINN-Framework
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
docker_build_image:
7+
type: string
8+
required: true
9+
can-skip:
10+
type: string
11+
required: false
12+
13+
env:
14+
PR_ID: ${{ github.event.pull_request.number }}
15+
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
16+
work_dir: /paddle
17+
PADDLE_ROOT: /paddle
18+
TASK: paddle-CI-${{ github.event.pull_request.number }}-CE-CINN-Framework
19+
ci_scripts: /paddle/ci
20+
BRANCH: ${{ github.event.pull_request.base.ref }}
21+
CI_name: ce-cinn-framework
22+
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
23+
24+
defaults:
25+
run:
26+
shell: bash
27+
28+
jobs:
29+
cinn:
30+
name: CINN
31+
if: ${{ inputs.can-skip != 'true' }}
32+
runs-on:
33+
group: BD_BJ-V100
34+
steps:
35+
- name: Check docker image and run container
36+
env:
37+
CACHE_DIR: /home/data/cfs/.cache
38+
run: |
39+
container_name=${TASK}-${core_index}-$(date +%Y%m%d-%H%M%S)
40+
echo "container_name=${container_name}" >> ${{ github.env }}
41+
docker_image=${{ inputs.docker_build_image }}
42+
docker container ls -a --filter "name=paddle-CI-*-api-benchmark-${core_index}*" --format "{{.ID}}" | xargs -r docker rm -f
43+
docker container ls -a --filter "name=api_benchmark_ci_baseline_" --format "{{.ID}} {{.CreatedAt}}" | awk '$2 <= "'$(date -d '1 day ago' +'%Y-%m-%d')'" {print $1}' | xargs -r docker rm -f
44+
docker run -d -t --gpus all --name ${container_name} --privileged --shm-size=128g \
45+
-v "/home/data/cfs:/home/data/cfs" \
46+
-v "/home/data/cfs/.cache:/root/.cache" \
47+
-v "/home/data/cfs/.ccache:/root/.ccache" \
48+
-v "/dev/shm:/dev/shm" \
49+
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
50+
-v ${{ github.workspace }}:/paddle \
51+
-e python \
52+
-e core_index \
53+
-e BRANCH \
54+
-e PR_ID \
55+
-e COMMIT_ID \
56+
-e work_dir \
57+
-e PADDLE_ROOT \
58+
-e ci_scripts \
59+
-e no_proxy \
60+
-e CI_name \
61+
-e CACHE_DIR \
62+
-e GITHUB_API_TOKEN \
63+
-w /paddle --network host ${docker_image}
64+
65+
- name: Download Paddle and PaddleTest
66+
env:
67+
work_dir: ${{ github.workspace }}
68+
run: |
69+
docker exec -t ${{ env.container_name }} /bin/bash -c '
70+
rm -rf * .[^.]*
71+
echo "Downloading build.tar.gz"
72+
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/build/${PR_ID}/${COMMIT_ID}/build.tar.gz --no-check-certificate
73+
echo "Extracting build.tar.gz"
74+
git config --global --add safe.directory ${work_dir}
75+
tar --use-compress-program="pzstd -1" -xpf build.tar.gz --strip-components=1
76+
git submodule foreach "git config --global --add safe.directory \$toplevel/\$sm_path"
77+
git checkout test
78+
rm build.tar.gz
79+
cd /
80+
echo "Downloading PaddleTest.tar.gz"
81+
wget -q --no-proxy https://xly-devops.bj.bcebos.com/PaddleTest/PaddleTest.tar.gz --no-check-certificate
82+
echo "Extracting PaddleTest.tar.gz"
83+
tar -zvxf PaddleTest.tar.gz 1>/dev/null 2>&1
84+
'
85+
86+
- name: Check bypass
87+
id: check-bypass
88+
uses: ./.github/actions/check-bypass
89+
with:
90+
github-token: ${{ secrets.GITHUB_TOKEN }}
91+
workflow-name: ce-cinn
92+
93+
- name: Determine ci trigger
94+
if: steps.check-bypass.outputs.can-skip != 'true'
95+
env:
96+
work_dir: ${{ github.workspace }}
97+
run: |
98+
docker exec -t ${{ env.container_name }} /bin/bash -c '
99+
source ${{ github.workspace }}/../../../proxy
100+
source ${ci_scripts}/ce_cinn_diff.sh
101+
if [ ${sum_num} -eq 0 ];then
102+
echo "The modified files does not affect LayerCase in CE-CINN-Framework, so skip this ci."
103+
echo "skip_ci=true" >> ${{ github.env }}
104+
fi
105+
'
106+
107+
- name: Run check
108+
if: ${{ steps.check-bypass.outputs.can-skip != 'true' && env.skip_ci != 'true' }}
109+
env:
110+
work_dir: ${{ github.workspace }}
111+
run: |
112+
docker exec -t ${{ env.container_name }} /bin/bash -c '
113+
source ~/.bashrc
114+
pip config set global.cache-dir "$CACHE_DIR/pip"
115+
pip install /paddle/build/pr_whl/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
116+
cd /PaddleTest/framework/e2e/PaddleLT_new
117+
pip install -r requirement.txt
118+
source ./scene/set_ci_dy^dy2stcinn_train^dy2stcinn_eval_inputspec_env.sh
119+
python support/dict_to_yml.py --filename apibm_config.yml --data_str "$(cat $CACHE_DIR/cinn_config)"
120+
set -e
121+
python run.py
122+
exit $(head -n 1 "exit_code.txt")
123+
'
124+
125+
- name: Terminate and delete the container
126+
if: always()
127+
run: |
128+
sudo rm -rf * .[^.]*
129+
docker rm -f ${{ env.container_name }}

.github/workflows/docker.yml

+1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
dockerfile_origin: https://raw.githubusercontent.com/PaddlePaddle/Paddle/refs/heads/develop/tools/dockerfile/Dockerfile.ubuntu20
5757
run: |
5858
set -x
59+
rm -rf * .[^.]*
5960
if [ "${{ inputs.is_merge }}" == "true" ]; then
6061
mkdir -p tools/dockerfile && cd tools/dockerfile
6162
wget -q --no-proxy ${dockerfile_script} ${dockerfile_origin} --no-check-certificate

.github/workflows/re-run.yml

+10
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,16 @@ jobs:
199199
REPO: ${{ github.event.repository.name }}
200200
JOB_NAME: 'Static-Check / Test'
201201

202+
- name: Rerun CE-CINN-Framework
203+
if: ${{ contains(env.comment_body, 'ce-cinn') }}
204+
uses: ./.github/actions/rerun-workflow
205+
with:
206+
PR_ID: ${{ github.event.issue.number }}
207+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208+
OWNER: ${{ github.repository_owner }}
209+
REPO: ${{ github.event.repository.name }}
210+
JOB_NAME: 'CE-CINN-Framework / CINN'
211+
202212
- name: Rerun Api-Benchmark
203213
if: ${{ contains(env.comment_body, 'api-bm') }}
204214
uses: ./.github/actions/rerun-workflow

ci/ce_cinn_diff.sh

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
set -x
16+
PATH=/usr/local/bin:${PATH}
17+
echo "PATH=${PATH}" >> ~/.bashrc
18+
ln -sf $(which python3.10) /usr/local/bin/python
19+
ln -sf $(which pip3.10) /usr/local/bin/pip
20+
21+
cp -r /PaddleTest/framework/e2e/PaddleLT_new/support/pr_info.py .
22+
python pr_info.py --pr_id ${PR_ID} --title_keyword CINN
23+
title_num=`grep -o '[0-9]\+' pr_title.log`
24+
25+
git diff --numstat --diff-filter=AMRD $BRANCH | grep paddle/cinn | awk '{print $NF}' | tee pr_filelist1.log
26+
filelist_num1=`cat pr_filelist1.log | wc -l`
27+
28+
git diff --numstat --diff-filter=AMRD $BRANCH | grep paddle/fluid/primitive/ | awk '{print $NF}' | tee pr_filelist2.log
29+
filelist_num2=`cat pr_filelist2.log | wc -l`
30+
31+
git diff --numstat --diff-filter=AMRD $BRANCH | grep paddle/fluid/pir/dialect/operator/interface/infer_symbolic_shape/ | awk '{print $NF}' | tee pr_filelist3.log
32+
filelist_num3=`cat pr_filelist3.log | wc -l`
33+
34+
git diff --numstat --diff-filter=AMRD $BRANCH | grep paddle/fluid/pir/dialect/operator/interface | awk '{print $NF}' | tee pr_filelist4.log
35+
filelist_num4=`cat pr_filelist4.log | wc -l`
36+
37+
sum_num=$((title_num + filelist_num1 + filelist_num2 + filelist_num3 + filelist_num4))
38+
echo "sum_num: ${sum_num}"

0 commit comments

Comments
 (0)