Skip to content

Commit 0239d4a

Browse files
authored
Merge branch 'PaddlePaddle:develop' into trt_debug_info
2 parents 2f8d3ae + 2f5d0d0 commit 0239d4a

File tree

650 files changed

+49714
-1733
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

650 files changed

+49714
-1733
lines changed

.github/actions/check-bypass/action.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ runs:
1818
- id: check-bypass
1919
name: Check Bypass
2020
env:
21-
CI_TEAM_MEMBERS: '["SigureMo", "risemeup1", "tianshuo78520a", "0x3878f", "swgu98", "luotao1"]'
21+
CI_TEAM_MEMBERS: '["SigureMo", "risemeup1", "tianshuo78520a", "0x3878f", "swgu98", "luotao1", "XieYunshen"]'
2222
uses: PFCCLab/ci-bypass@v1
2323
with:
2424
github-token: ${{ inputs.github-token }}
@@ -29,12 +29,12 @@ runs:
2929
"any": [
3030
{
3131
"type": "labeled",
32-
"label": ["skip-ci: ${{ inputs.workflow-name }}"],
32+
"label": ["skip-ci: ${{ inputs.workflow-name }}", "skip-ci: all"],
3333
"username": ${{ env.CI_TEAM_MEMBERS }}
3434
},
3535
{
3636
"type": "commented",
37-
"comment-pattern": [".*/skip-ci ${{ inputs.workflow-name }}.*"],
37+
"comment-pattern": [".*/skip-ci ${{ inputs.workflow-name }}.*", ".*/skip-ci all.*"],
3838
"username": ${{ env.CI_TEAM_MEMBERS }}
3939
}
4040
]

.github/workflows/CI.yml

+16-4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: CI
33
on:
44
pull_request:
55
types: [opened, synchronize]
6+
branches: [develop, release/**]
67

78
permissions: read-all
89

@@ -24,16 +25,27 @@ jobs:
2425
uses: ./.github/workflows/_SOT.yml
2526
needs: clone
2627

28+
xpu:
29+
name: Linux-XPU
30+
uses: ./.github/workflows/_Linux-XPU.yml
31+
needs: clone
32+
2733
inference:
2834
name: PR-CI-Inference
2935
uses: ./.github/workflows/_Inference.yml
3036
needs: clone
3137

3238
coverage:
33-
name: PR-CI-Coverage
39+
name: Coverage
3440
uses: ./.github/workflows/_Coverage.yml
3541
needs: clone
3642

37-
# Py3:
38-
# uses: ./.github/workflows/_Py3.yml
39-
# needs: Clone
43+
cpu:
44+
name: Linux-CPU
45+
uses: ./.github/workflows/_Linux-CPU.yml
46+
needs: clone
47+
48+
npu:
49+
name: Linux-NPU
50+
uses: ./.github/workflows/_Linux-NPU.yml
51+
needs: cpu

.github/workflows/_Coverage.yml

+36-23
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR-CI-Coverage
1+
name: Coverage
22

33
on:
44
workflow_call:
@@ -171,7 +171,7 @@ jobs:
171171
rm -rf ./python/build/lib.linux-x86_64-3.9/
172172
cd "${work_dir}/build/third_party" && find $(ls | grep -v "dlpack" | grep -v "install" | grep -v "eigen3" | grep -v "gflags") -type f ! -name "*.so" -a ! -name "libdnnl.so*" -delete
173173
cd /
174-
tar --use-compress-program="pzstd -1" -cpf Paddle.tar.gz paddle
174+
tar --use-compress-program="pzstd -1" -cf Paddle.tar.gz paddle
175175
'
176176
177177
- name: Upload coverage product
@@ -218,21 +218,8 @@ jobs:
218218
needs: build
219219
if: needs.build.outputs.can-skip != 'true'
220220
runs-on:
221-
group: BD_BJ_v100
221+
group: BD_BJ-V100
222222
steps:
223-
- name: Download paddle.tar.gz and update test branch
224-
run: |
225-
set -e
226-
echo "Downloading Paddle.tar.gz"
227-
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
228-
echo "Extracting Paddle.tar.gz"
229-
tar --use-compress-program='pzstd -1' -xpf Paddle.tar.gz --strip-components=1
230-
rm Paddle.tar.gz
231-
source ${{ github.workspace }}/../../../proxy
232-
git checkout test
233-
echo "Pull upstream develop"
234-
git pull upstream $BRANCH --no-edit
235-
236223
- name: Check docker image and run container
237224
env:
238225
CACHE_DIR: "/root/.cache/coverage"
@@ -303,6 +290,22 @@ jobs:
303290
-e GITHUB_API_TOKEN \
304291
-w /paddle --network host ${docker_image}
305292
293+
- name: Download paddle.tar.gz and update test branch
294+
run: |
295+
docker exec -t ${{ env.container_name }} /bin/bash -c '
296+
rm -rf * .[^.]*
297+
set -e
298+
echo "Downloading Paddle.tar.gz"
299+
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/coverage/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
300+
echo "Extracting Paddle.tar.gz"
301+
tar --use-compress-program="pzstd -1" -xf Paddle.tar.gz --strip-components=1
302+
rm Paddle.tar.gz
303+
source ${{ github.workspace }}/../../../proxy
304+
git checkout test
305+
echo "Pull upstream develop"
306+
git pull upstream $BRANCH --no-edit
307+
'
308+
306309
- name: Test
307310
run: |
308311
docker exec -t ${{ env.container_name }} /bin/bash -c '
@@ -315,33 +318,43 @@ jobs:
315318
fi
316319
'
317320
318-
- name: Check coverage data
321+
- name: Generate coverage information
319322
run: |
320323
docker exec -t ${{ env.container_name }} /bin/bash -c '
321324
source ~/.bashrc
322325
unset GREP_OPTIONS
323326
source ${{ github.workspace }}/../../../proxy
324327
source ${ci_scripts}/utils.sh; check_coverage
325-
COVERAGE_EXIT_CODE=$?
326-
echo "COVERAGE_EXIT_CODE=${COVERAGE_EXIT_CODE}" >> ${{ github.env }}
327328
'
328329
329330
- name: Upload coverage report
330331
uses: codecov/codecov-action@v4
331332
with:
332333
directory: build/coverage_files
333334

334-
- name: Judge coverage passed or not
335+
- name: Determine whether the coverage rate reaches 90%
335336
run: |
336-
if [ "${{ env.COVERAGE_EXIT_CODE }}" -ne 0 ]; then
337-
echo "Coverage failed"
338-
exit ${{ env.COVERAGE_EXIT_CODE }}
337+
docker exec -t ${{ env.container_name }} /bin/bash -c '
338+
source ~/.bashrc
339+
unset GREP_OPTIONS
340+
source ${{ github.workspace }}/../../../proxy
341+
source ${ci_scripts}/utils.sh
342+
bash $ci_scripts/coverage_judge.sh
343+
COVERAGE_EXIT_CODE=$?
344+
echo $COVERAGE_EXIT_CODE
345+
if [ "$COVERAGE_EXIT_CODE" -ne 0 ]; then
346+
echo "Coverage check failed, unit tests have all passed, please do not rerun, check whether the newly added code lines are fully covered by unit tests. If you have any questions, please contact XieYunshen."
347+
exit $COVERAGE_EXIT_CODE
348+
else
349+
echo "Coverage passed"
339350
fi
351+
'
340352
341353
- name: Terminate and delete the container
342354
if: always()
343355
run: |
344356
set +e
357+
rm Paddle.tar.gz
345358
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
346359
docker stop ${{ env.container_name }}
347360
docker rm ${{ env.container_name }}

.github/workflows/_Py3.yml renamed to .github/workflows/_Linux-CPU.yml

+40-27
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
1-
name: PR-CI-Py3
1+
name: Linux-CPU
22

33
on:
44
workflow_call:
55

66
env:
77
dockerfile: Dockerfile.cuda9_cudnn7_gcc48_py35_centos6
8-
docker_image: 077ca344c322
8+
docker_image: 3d2fa88da0da
99
PR_ID: ${{ github.event.pull_request.number }}
1010
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
11-
TASK: paddle-CI-${{ github.event.pull_request.number }}-py3
11+
work_dir: /paddle
12+
PADDLE_ROOT: /paddle
13+
TASK: paddle-CI-${{ github.event.pull_request.number }}-cpu
1214
ci_scripts: ${{ github.workspace }}/ci
15+
BRANCH: ${{ github.event.pull_request.base.ref }}
16+
CI_name: cpu
1317

1418
defaults:
1519
run:
1620
shell: bash
1721

1822
jobs:
1923
build-and-test:
24+
name: Build and test
2025
runs-on:
2126
group: GZ_BD-CPU
2227

2328
steps:
2429
- name: Check docker image and run container
2530
env:
26-
BRANCH: develop
27-
work_dir: ${{ github.workspace }}
28-
PADDLE_ROOT: ${{ github.workspace }}
2931
WITH_SHARED_PHI: "ON"
3032
WITH_MKL: "OFF"
3133
WITH_TESTING: "ON"
@@ -43,17 +45,17 @@ jobs:
4345
CCACHE_MAXSIZE: 150G
4446
CCACHE_LIMIT_MULTIPLE: 0.8
4547
WITH_AVX: "OFF"
46-
CCACHE_DIR: "/root/.ccache/py3"
48+
CCACHE_DIR: "/root/.ccache/cpu"
4749
run: |
48-
# bash ${{ github.workspace }}/paddle/scripts/paddle_build/check_docker_image.sh
49-
container_name=${TASK}-$(date +%s)
50+
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
5051
echo "container_name=${container_name}" >> ${{ github.env }}
5152
docker run -d -t --name ${container_name} \
5253
-v "/home/data/cfs:/home/data/cfs" \
53-
-v "/home/data/cfs/.cache:/root/.cache" \
54+
-v "/home/data/cfs/.cache/python35-cpu:/root/.cache" \
5455
-v "/home/data/cfs/.ccache:/root/.ccache" \
5556
-v "/dev/shm:/dev/shm" \
56-
-v "${{ github.workspace }}/../../../..:${{ github.workspace }}/../../../.." \
57+
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
58+
-v ${{ github.workspace }}:/paddle \
5759
-e BRANCH \
5860
-e PR_ID \
5961
-e COMMIT_ID \
@@ -79,49 +81,54 @@ jobs:
7981
-e ci_scripts \
8082
-e WITH_AVX \
8183
-e CCACHE_DIR \
82-
-w ${{ github.workspace }} --network host ${docker_image}
84+
-w /paddle --network host ${docker_image}
8385
84-
- name: Download paddle.tar.gz and merge develop
86+
- name: Download paddle.tar.gz and merge target branch
8587
env:
8688
work_dir: ${{ github.workspace }}
8789
run: |
8890
docker exec -t ${{ env.container_name }} /bin/bash -c '
89-
rm -rf * .[^.]*
90-
rm -rf /root/.cache && ln -s /home/data/cfs/.cache/python35-cpu /root/.cache
91+
rm -rf * .[^.]*
9192
set -e
93+
echo "Downloading Paddle.tar.gz"
9294
wget -q --no-proxy https://paddle-github-action.bj.bcebos.com/PR/Paddle/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
95+
echo "Extracting Paddle.tar.gz"
9396
tar xf Paddle.tar.gz --strip-components=1
9497
rm Paddle.tar.gz
9598
git config --global user.name "PaddleCI"
9699
git config --global user.email "paddle_ci@example.com"
97100
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
98-
. ../../../proxy
99-
git checkout develop
100-
git pull upstream develop
101-
git fetch upstream develop
101+
source ${{ github.workspace }}/../../../proxy
102+
git checkout $BRANCH
103+
git pull upstream $BRANCH
104+
git fetch upstream $BRANCH
102105
git checkout test
103-
git merge --no-edit develop
106+
git merge --no-edit $BRANCH
104107
'
105108
109+
- name: Check bypass
110+
id: check-bypass
111+
uses: ./.github/actions/check-bypass
112+
with:
113+
github-token: ${{ secrets.GITHUB_TOKEN }}
114+
workflow-name: cpu
115+
106116
- name: Build
107117
run: |
108118
docker exec -t ${{ env.container_name }} /bin/bash -c '
109-
. ../../../proxy
110-
bash ${ci_scripts}/run_setup.sh ${PYTHON_ABI:-""} bdist_wheel ${parallel_number:-""} py3
119+
source ${{ github.workspace }}/../../../proxy
120+
bash ${ci_scripts}/run_setup.sh bdist_wheel
111121
EXCODE=$?
112122
exit $EXCODE
113123
'
114124
115125
- name: Test
116126
run: |
117127
docker exec -t ${{ env.container_name }} /bin/bash -c '
118-
. ../../../proxy
128+
source ${{ github.workspace }}/../../../proxy
119129
bash ${ci_scripts}/run_linux_cpu_test.sh
120130
EXCODE=$?
121131
source ${ci_scripts}/utils.sh; clean_build_files
122-
echo "::group::Install bce-python-sdk"
123-
python -m pip install bce-python-sdk==0.8.74
124-
echo "::endgroup::"
125132
exit $EXCODE
126133
'
127134
@@ -132,14 +139,20 @@ jobs:
132139
paddle_whl: paddlepaddle-0.0.0-cp39-cp39-linux_x86_64.whl
133140
run: |
134141
docker exec -t ${{ env.container_name }} /bin/bash -c '
142+
echo "::group::Install bce-python-sdk"
143+
source ${{ github.workspace }}/../../../proxy
144+
python -m pip install bce-python-sdk==0.8.74
145+
echo "::endgroup::"
135146
export AK=paddle
136147
export SK=paddle
137148
if [ ! -f "${{ env.bos_file }}" ]; then
138149
wget -q --no-proxy -O ${{ env.home_path }}/bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate
139150
mkdir ${{ env.home_path }}/bos
140151
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
141152
fi
142-
cd ${{ github.workspace }}/dist
153+
cd dist
154+
echo "Uploading paddle_whl to bos"
155+
source ${{ github.workspace }}/../../../unproxy
143156
python3.9 ${{ env.bos_file }} ${{ env.paddle_whl }} paddle-github-action/PR/cpu_whl/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
144157
'
145158

0 commit comments

Comments
 (0)