Skip to content

Commit c229733

Browse files
fix: support only report the url in pr change && fix _en.rst's url (#7528)
--------- Co-authored-by: Nyakku Shigure <[email protected]>
1 parent a6c6cf8 commit c229733

File tree

3 files changed

+29
-8
lines changed

3 files changed

+29
-8
lines changed

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)