Skip to content

Commit 7bfabbb

Browse files
committed
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into accuracy_embedding
2 parents 99c1c17 + ac90ec8 commit 7bfabbb

Some content is hidden

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

57 files changed

+488
-526
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ jobs:
110110
slice:
111111
name: Slice
112112
uses: ./.github/workflows/_Slice.yml
113-
needs: [build-docker, build]
113+
needs: [clone, build-docker, build]
114114
with:
115115
can-skip: ${{ needs.build.outputs.can-skip }}
116116
docker_build_image: ${{ needs.build-docker.outputs.docker_build_image }}
117+
slice-check: ${{ needs.clone.outputs.slice-check }}

.github/workflows/Coverage.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ jobs:
140140
git checkout test
141141
echo "Pull upstream $BRANCH"
142142
source ${{ github.workspace }}/../../../proxy
143-
git pull upstream $BRANCH --no-edit
143+
bash ci/git_pull.sh $BRANCH
144144
'
145145
146146
- name: Check bypass
@@ -203,7 +203,7 @@ jobs:
203203
if: steps.check-bypass.outputs.can-skip != 'true'
204204
env:
205205
home_path: ${{ github.workspace }}/..
206-
bos_file: ${{ github.workspace }}/../bos/BosClient.py
206+
bos_file: ${{ github.workspace }}/../bos_retry/BosClient.py
207207
paddle_whl: paddlepaddle_gpu-0.0.0-cp39-cp39-linux_x86_64.whl
208208
run: |
209209
docker exec -t ${{ env.container_name }} /bin/bash -c '
@@ -214,9 +214,9 @@ jobs:
214214
export AK=paddle
215215
export SK=paddle
216216
if [ ! -f "${{ env.bos_file }}" ]; then
217-
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
218-
mkdir ${{ env.home_path }}/bos
219-
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
217+
wget -q --no-proxy -O ${{ env.home_path }}/bos_retry.tar.gz https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
218+
mkdir ${{ env.home_path }}/bos_retry
219+
tar xf ${{ env.home_path }}/bos_retry.tar.gz -C ${{ env.home_path }}/bos_retry
220220
fi
221221
cd /paddle/dist
222222
echo "Uploading coverage build size"
@@ -330,7 +330,7 @@ jobs:
330330
source ${{ github.workspace }}/../../../proxy
331331
git checkout test
332332
echo "Pull upstream develop"
333-
git pull upstream $BRANCH --no-edit
333+
bash ci/git_pull.sh $BRANCH
334334
'
335335
336336
- name: Test

.github/workflows/_Clone-linux.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
outputs:
1414
can-skip:
1515
value: ${{ jobs.clone.outputs.can-skip }}
16+
slice-check:
17+
value: ${{ jobs.clone.outputs.slice-check }}
1618

1719
permissions: read-all
1820

@@ -31,6 +33,7 @@ jobs:
3133
name: Clone Paddle
3234
outputs:
3335
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
36+
slice-check: ${{ steps.check-execution.outputs.slice-check }}
3437

3538
if: github.repository_owner == 'PaddlePaddle'
3639
runs-on:
@@ -45,6 +48,7 @@ jobs:
4548
fetch-depth: 1000
4649

4750
- name: Merge PR to test branch
51+
id: check-execution
4852
run: |
4953
git config --unset http.https://github.com/.extraheader
5054
git submodule foreach --recursive sh -c "git config --local --unset-all 'http.https://github.com/.extraheader'"
@@ -60,6 +64,7 @@ jobs:
6064
git fetch origin pull/${{ github.event.pull_request.number }}/head:pr
6165
git merge --no-ff pr
6266
git branch -d pr
67+
source ${ci_scripts}/check_execution.sh
6368
bash ${ci_scripts}/third_party_tag.sh
6469
6570
- name: Check bypass

.github/workflows/_Distribute-stable.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
source ${{ github.workspace }}/../../../proxy
137137
git checkout test
138138
echo "Pull upstream develop"
139-
git pull upstream $BRANCH --no-edit
139+
bash ci/git_pull.sh $BRANCH
140140
'
141141
142142
- name: Check bypass
@@ -178,10 +178,7 @@ jobs:
178178
md5sum fa_libs.tar |awk "{print \$1}" >MD5.txt
179179
cd .. && tar -zcf flashattn_libs_${{ env.flashattn_version }}.tar ./flashattn_libs_${{ env.flashattn_version }}
180180
fi
181-
cd ${work_dir}/build
182-
rm -rf $(find . -name "*.a")
183-
rm -rf $(find . -name "*.o")
184-
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
181+
bash ${ci_scripts}/compress_build.sh
185182
cd ${work_dir}/..
186183
tar --use-compress-program="pzstd -1" --warning=no-file-changed -cf Paddle.tar.gz paddle
187184
'
@@ -190,7 +187,7 @@ jobs:
190187
if: steps.check-bypass.outputs.can-skip != 'true'
191188
env:
192189
home_path: ${{ github.workspace }}/..
193-
bos_file: ${{ github.workspace }}/../bos/BosClient.py
190+
bos_file: ${{ github.workspace }}/../bos_retry/BosClient.py
194191
paddle_whl: paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
195192
run: |
196193
docker exec -t ${{ env.container_name }} /bin/bash -c '
@@ -202,9 +199,9 @@ jobs:
202199
python -m pip install bce-python-sdk==0.8.74
203200
echo "::endgroup::"
204201
if [ ! -f "${{ env.bos_file }}" ]; then
205-
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
206-
mkdir ${{ env.home_path }}/bos
207-
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
202+
wget -q --no-proxy -O ${{ env.home_path }}/bos_retry.tar.gz https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
203+
mkdir ${{ env.home_path }}/bos_retry
204+
tar xf ${{ env.home_path }}/bos_retry.tar.gz -C ${{ env.home_path }}/bos_retry
208205
fi
209206
cd ..
210207
source ${{ github.workspace }}/../../../unproxy
@@ -327,7 +324,7 @@ jobs:
327324
git checkout test
328325
echo "Pull upstream $BRANCH"
329326
source ${{ github.workspace }}/../../../proxy
330-
git pull upstream $BRANCH --no-edit
327+
bash ci/git_pull.sh $BRANCH
331328
'
332329
333330
- name: Test

.github/workflows/_Inference.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
git config pull.rebase false
125125
git checkout test
126126
echo "Pull upstream develop"
127-
git pull upstream $BRANCH --no-edit
127+
bash ci/git_pull.sh $BRANCH
128128
'
129129
130130
- name: Run build
@@ -140,19 +140,20 @@ jobs:
140140
if: steps.check-bypass.outputs.can_skip != 'true'
141141
env:
142142
home_path: /action-runner
143-
bos_file: /action-runner/bos/BosClient.py
143+
bos_file: /action-runner/bos_retry/BosClient.py
144144
run: |
145145
docker exec -t ${{ env.container_name }} /bin/bash -c '
146146
echo "::group::Install bce-python-sdk"
147147
source /action-runner/proxy
148148
python -m pip install bce-python-sdk==0.8.74
149149
echo "::endgroup::"
150+
rm -rf `find . -name "*.o"`
150151
export AK=paddle
151152
export SK=paddle
152153
if [ ! -f "${{ env.bos_file }}" ]; then
153-
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
154-
mkdir ${{ env.home_path }}/bos
155-
tar xf ${{ env.home_path }}/bos_new.tar.gz -C ${{ env.home_path }}/bos
154+
wget -q --no-proxy -O ${{ env.home_path }}/bos_retry.tar.gz https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
155+
mkdir ${{ env.home_path }}/bos_retry
156+
tar xf ${{ env.home_path }}/bos_retry.tar.gz -C ${{ env.home_path }}/bos_retry
156157
fi
157158
source /action-runner/unproxy
158159
cd /

.github/workflows/_Linux-CPU.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ jobs:
105105
git config --global user.email "paddle_ci@example.com"
106106
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
107107
source ${{ github.workspace }}/../../../proxy
108+
cp ci/git_pull.sh ci/git_pull_copy.sh
108109
git checkout $BRANCH
109-
git pull upstream $BRANCH
110+
bash ci/git_pull_copy.sh $BRANCH
110111
git fetch upstream $BRANCH
111112
git checkout test
112113
git merge --no-edit $BRANCH

.github/workflows/_Linux-NPU.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
git checkout test
5050
echo "Pull upstream develop"
5151
source ${{ github.workspace }}/../../../proxy
52-
git pull upstream $BRANCH --no-edit
52+
bash ci/git_pull.sh $BRANCH
5353
5454
- name: Determine the runner
5555
run: |

.github/workflows/_Linux-XPU.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ jobs:
122122
git config pull.rebase false
123123
git checkout test
124124
echo "Pull upstream develop or target branch"
125-
git pull upstream $BRANCH --no-edit
125+
bash ci/git_pull.sh $BRANCH
126126
'
127127
128128
- name: Run build
@@ -136,8 +136,7 @@ jobs:
136136
bash ${ci_scripts}/run_setup.sh bdist_wheel
137137
EXCODE=$?
138138
python -m pip install bce-python-sdk==0.8.74
139-
rm -rf `find . -name "*.a"`
140-
rm -rf `find . -name "*.o"`
139+
bash ${ci_scripts}/compress_build.sh
141140
exit $EXCODE
142141
'
143142

.github/workflows/_Linux-build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,9 @@ jobs:
132132
git config --global user.email "paddle_ci@example.com"
133133
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
134134
source ${{ github.workspace }}/../../../proxy
135+
cp ci/git_pull.sh ci/git_pull_copy.sh
135136
git checkout $BRANCH
136-
git pull upstream $BRANCH
137+
bash ci/git_pull_copy.sh $BRANCH
137138
git fetch upstream $BRANCH
138139
git checkout test
139140
git merge --no-edit $BRANCH
@@ -173,6 +174,7 @@ jobs:
173174
paddle_whl: paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
174175
run: |
175176
docker exec -t ${{ env.container_name }} /bin/bash -c '
177+
bash ${ci_scripts}/compress_build.sh
176178
export AK=paddle
177179
export SK=paddle
178180
if [ ! -f "${{ env.bos_file }}" ]; then

.github/workflows/_Mac.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,9 @@ jobs:
5858
git config --global user.name "PaddleCI"
5959
git config --global user.email "paddle_ci@example.com"
6060
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
61+
cp ci/git_pull.sh ci/git_pull_copy.sh
6162
git checkout $BRANCH
62-
git pull upstream $BRANCH
63+
bash ci/git_pull_copy.sh $BRANCH
6364
git fetch upstream $BRANCH
6465
git checkout test
6566
git merge --no-edit $BRANCH

.github/workflows/_SOT.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ jobs:
110110
git config --global user.email "paddle_ci@example.com"
111111
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
112112
source ${{ github.workspace }}/../../../proxy
113+
cp ci/git_pull.sh ci/git_pull_copy.sh
113114
git checkout $BRANCH
114-
git pull upstream $BRANCH
115+
bash ci/git_pull_copy.sh $BRANCH
115116
git fetch upstream $BRANCH
116117
git checkout test
117118
git merge --no-edit $BRANCH

.github/workflows/_Slice.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
can-skip:
1010
type: string
1111
required: false
12+
slice-check:
13+
type: string
14+
required: false
1215

1316
env:
1417
PR_ID: ${{ github.event.pull_request.number }}
@@ -28,7 +31,7 @@ defaults:
2831
jobs:
2932
slice:
3033
name: Slice test
31-
if: ${{ inputs.can-skip != 'true' }}
34+
if: ${{ inputs.can-skip != 'true' && inputs.slice-check == 'true' }}
3235
runs-on:
3336
group: slice
3437
steps:

ci/check_execution.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
COMMIT_MESSAGE=$(git log -1 --pretty=%B)
16+
if [[ "$COMMIT_MESSAGE" == *"slice-check"* ]]; then
17+
echo "slice-check=true"
18+
echo "slice-check=true" >> $GITHUB_OUTPUT
19+
fi
20+
git checkout test

ci/compress_build.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
cd ${work_dir}/build
16+
find ./ -type f -size +200M | xargs du -lh
17+
rm -rf $(find . -name "*.a")
18+
rm -rf $(find . -name "*.o")
19+
rm -rf paddle_inference_install_dir
20+
rm -rf paddle_inference_c_install_dir
21+
rm -rf lib.linux-x86_64-310
22+
find ./ -name "eager_generator" -or -name "kernel_signature_generator" -or -name "eager_legacy_op_function_generator" | xargs rm -rf
23+
rm -rf ./python/build/lib.linux-x86_64-310/
24+
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

ci/git_pull.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
BRANCH=$1
16+
17+
MAX_RETRY=5
18+
n=0
19+
20+
while [ "$n" -lt "$MAX_RETRY" ]; do
21+
git pull upstream "$BRANCH" --no-edit && break
22+
n=$((n+1))
23+
echo "git pull failed, retrying in 5 seconds... ($n/$MAX_RETRY)"
24+
sleep 5
25+
done
26+
27+
if [ "$n" -eq "$MAX_RETRY" ]; then
28+
echo "Pull failed after $MAX_RETRY retries"
29+
exit 2
30+
fi

cmake/cudnn.cmake

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@ endif()
1717

1818
find_path(
1919
CUDNN_INCLUDE_DIR cudnn.h
20-
PATHS ${CUDNN_ROOT}
21-
${CUDNN_ROOT}/include
22-
${CUDNN_ROOT}/include/${TARGET_ARCH}-linux-gnu
23-
$ENV{CUDNN_ROOT}
24-
$ENV{CUDNN_ROOT}/include
25-
${CUDA_TOOLKIT_INCLUDE}
26-
/usr/local/lib/python${PY_VERSION}/dist-packages/nvidia/cudnn/include/
20+
PATHS ${CUDNN_ROOT} ${CUDNN_ROOT}/include
21+
${CUDNN_ROOT}/include/${TARGET_ARCH}-linux-gnu $ENV{CUDNN_ROOT}
22+
$ENV{CUDNN_ROOT}/include ${CUDA_TOOLKIT_INCLUDE}
2723
NO_DEFAULT_PATH)
2824

2925
get_filename_component(__libpath_hist ${CUDA_CUDART_LIBRARY} PATH)
@@ -66,7 +62,6 @@ find_library(
6662
CUDNN_LIBRARY
6763
NAMES ${CUDNN_LIB_NAME} # libcudnn_static.a
6864
PATHS ${CUDNN_CHECK_LIBRARY_DIRS} ${CUDNN_INCLUDE_DIR} ${__libpath_hist}
69-
/usr/local/lib/python${PY_VERSION}/dist-packages/nvidia/cudnn/lib/
7065
NO_DEFAULT_PATH
7166
DOC "Path to cuDNN library.")
7267

cmake/external/nvshmem.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ endif()
5555

5656
set(NVSHMEM_PATCH_PATH ${PADDLE_SOURCE_DIR}/patches/nvshmem/nvshmem.patch)
5757
set(NVSHMEM_PATCH_COMMAND
58-
git init && git config user.name "PaddlePaddle" && git config user.email
59-
"paddle@baidu.com" && git config --global --add safe.directory
60-
${NVSHMEM_SOURCE_DIR} && git add . && git commit -m "init" && git apply
58+
git init && git config --global --add safe.directory ${NVSHMEM_SOURCE_DIR}
59+
&& git config user.name "PaddlePaddle" && git config user.email
60+
"paddle@baidu.com" && git add . && git commit -m "init" && git apply
6161
${NVSHMEM_PATCH_PATH})
6262

6363
set(NVSHMEM_LIB ${NVSHMEM_INSTALL_DIR}/lib/libnvshmem.a)

0 commit comments

Comments
 (0)