Skip to content

Commit 190e183

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into fix1009
2 parents 4af6007 + c229733 commit 190e183

File tree

10 files changed

+153
-105
lines changed

10 files changed

+153
-105
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Paddle API Docs
2+
docs/api/paddle @jzhang533 @sunzhongkai588 @mattheliu

.github/workflows/check-bypass.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
workflow-name:
5+
required: true
6+
type: string
7+
secrets:
8+
github-token:
9+
required: true
10+
outputs:
11+
can-skip:
12+
description: "Whether the workflow can be skipped."
13+
value: ${{ jobs.check-bypass.outputs.can-skip }}
14+
15+
jobs:
16+
check-bypass:
17+
name: Check bypass
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
env:
22+
CI_TEAM_MEMBERS: '["tianshuo78520a", "swgu98", "risemeup1", "luotao1", "SigureMo", "ooooo-create"]'
23+
outputs:
24+
can-skip: ${{ steps.check-bypass.outputs.can-skip }}
25+
steps:
26+
- name: Cleanup
27+
run: |
28+
rm -rf * .[^.]*
29+
30+
- id: check-bypass
31+
name: Check Bypass
32+
uses: PFCCLab/ci-bypass@v2
33+
with:
34+
github-token: ${{ secrets.GITHUB_TOKEN }}
35+
non-pull-request-event-strategy: "never-skipped"
36+
type: "composite"
37+
composite-rule: |
38+
{
39+
"any": [
40+
{
41+
"type": "labeled",
42+
"label": ["skip-ci: ${{ inputs.workflow-name }}", "skip-ci: all"],
43+
"username": ${{ env.CI_TEAM_MEMBERS }}
44+
},
45+
{
46+
"type": "commented",
47+
"comment-pattern": [".*/skip-ci ${{ inputs.workflow-name }}.*", ".*/skip-ci all.*"],
48+
"username": ${{ env.CI_TEAM_MEMBERS }}
49+
}
50+
]
51+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Codestyle Check
2+
3+
on:
4+
pull_request:
5+
branches: ["develop"]
6+
7+
jobs:
8+
check-bypass:
9+
name: Check bypass
10+
if: ${{ inputs.can-skip != 'true' }}
11+
uses: ./.github/workflows/check-bypass.yml
12+
with:
13+
workflow-name: "codestyle"
14+
secrets:
15+
github-token: ${{ secrets.GITHUB_TOKEN }}
16+
17+
check-codestyle:
18+
name: Run codestyle check
19+
needs: check-bypass
20+
if: ${{ github.repository_owner == 'PaddlePaddle' && needs.check-bypass.outputs.can-skip != 'true' }}
21+
runs-on: ubuntu-latest
22+
env:
23+
PR_ID: ${{ github.event.pull_request.number }}
24+
BRANCH: develop
25+
26+
steps:
27+
- name: Cleanup
28+
run: |
29+
rm -rf * .[^.]*
30+
31+
- name: Checkout base repo
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event.pull_request.base.ref }}
35+
fetch-depth: 200
36+
37+
- name: Merge PR to test branch
38+
run: |
39+
git fetch origin pull/${PR_ID}/merge
40+
git checkout -b test FETCH_HEAD
41+
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@v6
44+
with:
45+
python-version: "3.13"
46+
enable-cache: true
47+
48+
- name: Install prek
49+
run: |
50+
uv tool install prek
51+
52+
- name: Run prek
53+
run: |
54+
set +e
55+
bash -x ci_scripts/check_code.sh;EXCODE=$?
56+
exit $EXCODE

ci_scripts/check_code.sh

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,22 @@ set +x
2222
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
2323
cd $SCRIPT_DIR/..
2424

25-
# use pre-commit 2.17
26-
if ! [[ $(pre-commit --version) == *"2.17.0"* ]]; then
27-
pip install pre-commit==2.17.0 1>nul
28-
fi
29-
3025
diff_files=$(git diff --name-only --diff-filter=ACMR ${BRANCH})
3126
num_diff_files=$(echo "$diff_files" | wc -l)
3227
echo -e "diff files between pr and ${BRANCH}:\n${diff_files}"
3328

29+
PRE_COMMIT_EXE="pre-commit"
30+
# Use prek to replace pre-commit if prek is installed
31+
if command -v prek &> /dev/null
32+
then
33+
echo "Detected prek, use prek to check code style for better performance."
34+
PRE_COMMIT_EXE="prek"
35+
else
36+
echo "prek not found, use pre-commit to check code style."
37+
fi
38+
3439
echo "Checking code style by pre-commit ..."
35-
pre-commit run --files ${diff_files};check_error=$?
40+
$PRE_COMMIT_EXE run --files ${diff_files};check_error=$?
3641

3742
if test ! -z "$(git diff)"; then
3843
echo -e '\n************************************************************************************'
@@ -47,7 +52,7 @@ if [ ${check_error} != 0 ];then
4752
echo "Your PR code style check failed."
4853
echo "Please install pre-commit locally and set up git hook scripts:"
4954
echo ""
50-
echo " pip install pre-commit==2.17.0"
55+
echo " pip install pre-commit"
5156
echo " pre-commit install"
5257
echo ""
5358
if [[ $num_diff_files -le 100 ]];then

ci_scripts/check_pr_approval.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

ci_scripts/checkapproval.sh

Lines changed: 0 additions & 27 deletions
This file was deleted.

ci_scripts/ci_start.sh

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,11 @@ else
102102
fi
103103

104104
EXIT_CODE=0
105-
# 3 check code style/format.
106-
ls ${DIR_PATH}
107-
/bin/bash -x ${DIR_PATH}/check_code.sh
108-
if [ $? -ne 0 ];then
109-
EXIT_CODE=1
110-
fi
111105

112106
git merge --no-edit upstream/${BRANCH}
113107
need_check_cn_doc_files=$(find_all_cn_api_files_modified_by_pr)
114108
echo $need_check_cn_doc_files
115-
# 4 Chinese api docs check
109+
# 3 Chinese api docs check
116110
if [ "${need_check_cn_doc_files}" = "" ] ; then
117111
echo "chinese api doc fileslist is empty, skip check."
118112
else
@@ -127,7 +121,7 @@ else
127121
fi
128122
fi
129123

130-
# 5 Chinese api_label check
124+
# 4 Chinese api_label check
131125
/bin/bash -x ${DIR_PATH}/check_api_label_cn.sh
132126
if [ $? -ne 0 ];then
133127
set +x
@@ -141,18 +135,12 @@ fi
141135
if [ ${EXIT_CODE} -ne 0 ]; then
142136
set +x
143137
echo "=========================================================================================="
144-
echo "Code style check or API Chinese doc check failed! Please check the error info above carefully."
138+
echo "API Chinese doc check failed! Please check the error info above carefully."
145139
echo "=========================================================================================="
146140
set -x
147141
exit ${EXIT_CODE}
148142
fi
149143

150-
# 6 Approval check
151-
/bin/bash ${DIR_PATH}/checkapproval.sh
152-
if [ $? -ne 0 ];then
153-
exit 1
154-
fi
155-
156144
echo "PADDLE_WHL=${PADDLE_WHL}"
157145
# print preview url
158146
echo "${PREVIEW_URL_PROMPT}"

ci_scripts/report_preview_url.sh

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,26 @@ generate_preview_url() {
1111
local file_path="$1"
1212
local pr_id="$2"
1313
local path_no_ext="${file_path%.*}"
14-
local base_url="http://preview-pr-${pr_id}.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/"
14+
15+
# Check if file ends with _en (English version)
16+
# _en.rst will only reach English preview, _en.md can be reached in both English and Chinese previews
17+
# To Simplify, we treat all _en files as English version
18+
if [[ "$path_no_ext" == *_en ]]; then
19+
local base_url="http://preview-pr-${pr_id}.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/en/"
20+
else
21+
# Use /zh/ path for Chinese version
22+
local base_url="http://preview-pr-${pr_id}.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/"
23+
fi
24+
1525
local final_url="${base_url}${path_no_ext}.html"
1626
echo "$final_url"
1727
}
1828

19-
mapfile -t all_git_files < <(git diff --name-only --diff-filter=ACMR develop | sed 's#^docs/##')
29+
# Use merge-base to find the common ancestor between PR branch and develop
30+
# This ensures we only get changes from this PR, excluding commits merged to develop after PR creation
31+
BASE_COMMIT=$(git merge-base HEAD develop 2>/dev/null || echo "develop")
32+
33+
mapfile -t all_git_files < <(git diff --name-only --diff-filter=ACMR "$BASE_COMMIT" | sed 's#^docs/##')
2034

2135
output_lines=()
2236

@@ -31,9 +45,16 @@ done
3145
if [ ${#output_lines[@]} -gt 0 ]; then
3246
cat <<-EOF
3347
<details>
34-
<summary>📚 本次 PR 文档预览链接 (点击展开)</summary>
35-
36-
以下是本次 PR 中变更文档的预览链接:
48+
<summary>📚 本次 PR 文档预览链接(点击展开)</summary>
49+
50+
<table>
51+
<tr>
52+
<td>
53+
ℹ️ <b>预览提醒</b><br>
54+
请等待 <code>Docs-NEW</code> 流水线运行完成后再点击预览链接,否则可能会看到旧版本内容或遇到链接无法访问的情况。
55+
</td>
56+
</tr>
57+
</table>
3758
3859
$(printf '%s\n' "${output_lines[@]}")
3960

docs/guides/flags/cudnn_en.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ FLAGS_conv_workspace_size_limit
77
*******************************************
88
(since 0.13.0)
99

10-
The workspace limit size in MB unit for choosing cuDNN convolution algorithms. The inner funciton of cuDNN obtain the fastest suited algorithm that fits within this memory limit. Usually, large workspace size may lead to choose faster algorithms, but significant increasing memory workspace. Users need to trade-off between memory and speed.
10+
The workspace limit size in MB unit for choosing cuDNN convolution algorithms. The inner function of cuDNN obtain the fastest suited algorithm that fits within this memory limit. Usually, large workspace size may lead to choose faster algorithms, but significant increasing memory workspace. Users need to trade-off between memory and speed.
1111

1212
Values accepted
1313
---------------
@@ -60,7 +60,7 @@ FLAGS_cudnn_exhaustive_search
6060
*******************************************
6161
(since 1.2.0)
6262

63-
Whether to use exhaustive search method to choose convolution algorithms. There are two search methods, heuristic search and exhaustive search in cuDNN. The exhaustive search attempts all cuDNN algorithms to choose the fastest algorithm. This method is time-consuming, the choosed algorithm will be cached for the given layer specifications. Once the layer specifications (like batch size, feature map size) are changed, it will search again.
63+
Whether to use exhaustive search method to choose convolution algorithms. There are two search methods, heuristic search and exhaustive search in cuDNN. The exhaustive search attempts all cuDNN algorithms to choose the fastest algorithm. This method is time-consuming, the chosen algorithm will be cached for the given layer specifications. Once the layer specifications (like batch size, feature map size) are changed, it will search again.
6464

6565
Values accepted
6666
---------------

docs/guides/performance_improving/profiling_model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ Time Unit: s, IPS Unit: steps/s
575575

576576
### 3.3 Benchmark 信息展示
577577

578-
Benckmark 信息用于展示模型的吞吐量以及时间开销。
578+
Benchmark 信息用于展示模型的吞吐量以及时间开销。
579579

580580
```plain
581581
============================================Perf Summary============================================

0 commit comments

Comments
 (0)