Skip to content

Commit d2bdeb7

Browse files
authored
Merge branch 'PaddlePaddle:develop' into develop
2 parents 59b5641 + 8061f74 commit d2bdeb7

1,570 files changed

Lines changed: 273421 additions & 45342 deletions

File tree

Some content is hidden

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

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
---
1717
Language: Cpp
1818
BasedOnStyle: Google
19-
IndentWidth: 4
19+
IndentWidth: 2
2020
TabWidth: 2
2121
ContinuationIndentWidth: 4
2222
AccessModifierOffset: -1 # The private/protected/public has no indent in class
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Rerun Workflow'
2+
description: 'Re-run GitHub Actions workflow for a given Pull Request'
3+
inputs:
4+
GITHUB_TOKEN:
5+
description: 'GitHub token with repo scope'
6+
required: true
7+
OWNER:
8+
description: 'Repository owner'
9+
required: true
10+
REPO:
11+
description: 'Repository name'
12+
required: true
13+
PR_ID:
14+
description: 'Pull Request ID'
15+
required: true
16+
JOB_NAME:
17+
description: 'Job name to rerun'
18+
required: true
19+
20+
runs:
21+
using: 'composite'
22+
steps:
23+
- run: bash ./.github/actions/rerun-workflow/rerun.sh
24+
shell: bash
25+
env:
26+
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
27+
OWNER: ${{ inputs.OWNER }}
28+
REPO: ${{ inputs.REPO }}
29+
PR_ID: ${{ inputs.PR_ID }}
30+
JOB_NAME: ${{ inputs.JOB_NAME }}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
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 -e
16+
17+
COMMIT_SHA=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
18+
"https://api.github.com/repos/$OWNER/$REPO/pulls/$PR_ID" | jq -r '.head.sha')
19+
20+
echo "Commit SHA: $COMMIT_SHA"
21+
22+
response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
23+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs?head_sha=$COMMIT_SHA&per_page=100")
24+
25+
echo "Response: $response"
26+
27+
run_ids=$(echo "$response" | jq -r '.workflow_runs[].id')
28+
29+
if [ -n "$run_ids" ]; then
30+
echo "Found run_ids for commit $COMMIT_SHA: $run_ids"
31+
32+
for run_id in $run_ids; do
33+
if [ "$JOB_NAME" = "all-failed" ]; then
34+
echo "Rerunning all failed jobs for run_id: $run_id"
35+
36+
rerun_response=$(curl -X POST -s -w "%{http_code}" -o /dev/null \
37+
-H "Accept: application/vnd.github.v3+json" \
38+
-H "Authorization: Bearer $GITHUB_TOKEN" \
39+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/rerun-failed-jobs")
40+
if [ "$rerun_response" -eq 201 ]; then
41+
echo "Successfully requested rerun for all blocked jobs in run_id: $run_id"
42+
else
43+
echo "Failed to request rerun for run_id: $run_id with status code $rerun_response"
44+
fi
45+
46+
else
47+
jobs_response=$(curl -s -H "Authorization: token $GITHUB_TOKEN" \
48+
"https://api.github.com/repos/$OWNER/$REPO/actions/runs/$run_id/jobs")
49+
50+
echo "Jobs Response for run_id $run_id: $jobs_response"
51+
52+
# if [[ "$JOB_NAME" == *"bypass"* ]]; then
53+
block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
54+
'.jobs[] | select(.name == $job_name) | .id')
55+
# else
56+
# block_jobs=$(echo "$jobs_response" | jq -r --arg job_name "$JOB_NAME" \
57+
# '.jobs[] | select(.name == $job_name and .conclusion != "success") | .id')
58+
# fi
59+
60+
if [ -n "$block_jobs" ]; then
61+
echo "Found block jobs for run_id $run_id: $block_jobs"
62+
63+
for job_id in $block_jobs; do
64+
echo "Rerunning job_id: $job_id"
65+
curl -X POST -H "Accept: application/vnd.github.v3+json" \
66+
-H "Authorization: token $GITHUB_TOKEN" \
67+
"https://api.github.com/repos/$OWNER/$REPO/actions/jobs/$job_id/rerun"
68+
done
69+
else
70+
echo "No block jobs found for run_id $run_id with name $JOB_NAME."
71+
fi
72+
fi
73+
done
74+
else
75+
echo "No matching workflow runs found for commit $COMMIT_SHA."
76+
exit 1
77+
fi

.github/copilot-instructions.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# GitHub Copilot Custom Review Instructions
2+
3+
When reviewing code, focus on:
4+
5+
## Security Critical Issues
6+
- Check for hardcoded secrets, API keys, or credentials
7+
- Look for SQL injection and XSS vulnerabilities
8+
- Verify proper input validation and sanitization
9+
- Review authentication and authorization logic
10+
11+
## Performance Red Flags
12+
- Identify N+1 database query problems
13+
- Spot inefficient loops and algorithmic issues
14+
- Check for memory leaks and resource cleanup
15+
- Review caching opportunities for expensive operations
16+
17+
## Code Quality Essentials
18+
- Functions should be focused and appropriately sized
19+
- Use clear, descriptive naming conventions
20+
- Ensure proper error handling throughout
21+
22+
## Review Style
23+
- Be specific and actionable in feedback
24+
- Explain the "why" behind recommendations
25+
- Acknowledge good patterns when you see them
26+
- Ask clarifying questions when code intent is unclear
27+
28+
Always prioritize security vulnerabilities and performance issues that could impact users.
29+
30+
Always suggest changes to improve readability. For example, this suggestion seeks to make the code more readable and also makes the validation logic reusable and testable.
31+
32+
// Instead of:
33+
if (user.email && user.email.includes('@') && user.email.length > 5) {
34+
submitButton.enabled = true;
35+
} else {
36+
submitButton.enabled = false;
37+
}
38+
39+
// Consider:
40+
function isValidEmail(email) {
41+
return email && email.includes('@') && email.length > 5;
42+
}
43+
44+
submitButton.enabled = isValidEmail(user.email);
45+
46+
## Description for pull request
47+
48+
- Please check the title of the Pull Request. It needs to follow the format of [CLASS]Title, for example, [BugFix] Fix memory leak of data processor. If the title is incorrect, provide suggestions on how the committer should modify it.
49+
- Please check the description information of the Pull Request. At a minimum, it should explain why these modifications are being made in this Pull Request and what problem is being solved. If the committer hasn't written the corresponding information or the information is incomplete, prompt the committer to make modifications.
50+
51+
## Others
52+
- 对于所有提交的PR,你提交的评论都使用中文语言,但需要注意,代码中的注释仍然需要使用英文
53+
- 在你提交Pull Request时,需要注意代码风格要满足本Repo的设定,commit代码前需要`pip install pre-commit==4.2.0`并且执行`pre-commit install`

.github/pull_request_template.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!-- TemplateReference: https://github.com/PaddlePaddle/FastDeploy/blob/develop/.github/pull_request_template.md -->
2+
3+
<!-- Thank you for your contribution! Please follow these guidelines to enhance your pull request. If anything is unclear, submit your PR and reach out to maintainers for assistance. -->
4+
5+
## Motivation
6+
7+
<!-- Describe the purpose and goals of this pull request. -->
8+
9+
> :bulb: If this PR is a Cherry Pick, the PR title needs to follow the format by adding the [Cherry-Pick] label at the very beginning and appending the original PR ID at the end. For example, [Cherry-Pick][CI] Add check trigger and logic(#5191)
10+
11+
> :bulb: 如若此PR是Cherry Pick,PR标题需遵循格式,在最开始加上[Cherry-Pick]标签,以及最后面加上原PR ID,例如[Cherry-Pick][CI] Add check trigger and logic(#5191)
12+
13+
## Modifications
14+
15+
<!-- Detail the changes made in this pull request. -->
16+
17+
## Usage or Command
18+
19+
<!-- You should provide the usage if this pr is about the new function. -->
20+
<!-- You should provide the command to run if this pr is about the performance optimization or fixing bug. -->
21+
22+
## Accuracy Tests
23+
24+
<!-- If this pull request affects model outputs (e.g., changes to the kernel or model forward code), provide accuracy test results. -->
25+
26+
## Checklist
27+
28+
- [ ] Add at least a tag in the PR title.
29+
- Tag list: [`[FDConfig]`,`[APIServer]`,`[Engine]`, `[Scheduler]`, `[PD Disaggregation]`, `[Executor]`, `[Graph Optimization]`, `[Speculative Decoding]`, `[RL]`, `[Models]`, `[Quantization]`, `[Loader]`, `[OP]`, `[KVCache]`, `[DataProcessor]`, `[BugFix]`, `[Docs]`, `[CI]`, `[Optimization]`, `[Feature]`, `[Benchmark]`, `[Others]`, `[XPU]`, `[HPU]`, `[GCU]`, `[DCU]`, `[Iluvatar]`, `[Metax]`]
30+
- You can add new tags based on the PR content, but the semantics must be clear.
31+
- [ ] Format your code, run `pre-commit` before commit.
32+
- [ ] Add unit tests. Please write the reason in this PR if no unit tests.
33+
- [ ] Provide accuracy results.
34+
- [ ] If the current PR is submitting to the `release` branch, make sure the PR has been submitted to the `develop` branch, then cherry-pick it to the `release` branch with the `[Cherry-Pick]` PR tag.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Check PR Template
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- 'release/*'
8+
9+
jobs:
10+
check:
11+
name: Check PR Template
12+
if: ${{ github.repository_owner == 'PaddlePaddle' }}
13+
runs-on: ubuntu-latest
14+
env:
15+
PR_ID: ${{ github.event.pull_request.number }}
16+
BASE_BRANCH: ${{ github.event.pull_request.base.ref }}
17+
AUTHOR: ${{ github.event.pull_request.user.login }}
18+
19+
steps:
20+
- name: Cleanup
21+
run: |
22+
rm -rf * .[^.]*
23+
24+
- name: Checkout base branch
25+
uses: actions/checkout@v4
26+
with:
27+
ref: ${{ github.event.pull_request.base.ref }}
28+
fetch-depth: 1000
29+
30+
- name: Merge PR to test branch
31+
run: |
32+
git fetch origin pull/${PR_ID}/merge
33+
git checkout -b test FETCH_HEAD
34+
35+
- name: Setup Python 3.10
36+
uses: actions/setup-python@v5
37+
with:
38+
python-version: '3.10'
39+
cache: 'pip'
40+
41+
- name: Install Python dependencies
42+
run: |
43+
python -m pip install --upgrade pip
44+
pip install httpx
45+
46+
- name: Check PR Template
47+
env:
48+
AGILE_PULL_ID: ${{ env.PR_ID }}
49+
AGILE_COMPILE_BRANCH: ${{ env.BASE_BRANCH }}
50+
AGILE_CHECKIN_AUTHOR: ${{ env.AUTHOR }}
51+
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
52+
run: |
53+
python scripts/CheckPRTemplate.py; EXCODE=$?
54+
exit $EXCODE

0 commit comments

Comments
 (0)