paddle-pull-request
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesePaddle 仓库 PR 创建与更新
Paddle Repository PR Creation and Update
流程
Process
1. 检查分支状态
1. Check Branch Status
- 检查当前分支是否已经推送到远端;如果没有,执行 。
git push -u origin HEAD - 如果当前分支名是 或
main,在继续之前先向用户确认是否真的要在该分支上直接提 PR。master
- Check if the current branch has been pushed to the remote; if not, execute .
git push -u origin HEAD - If the current branch name is or
main, confirm with the user whether they really want to submit a PR directly on this branch before proceeding.master
2. 按逻辑主题整理改动
2. Organize Changes by Logical Theme
- 不要机械地罗列每一次 commit。
- 按照「功能 / 目的」对改动进行分组,回答:
- 为什么需要这次改动?
- 解决了什么问题?
- 大致改了哪些模块?
- Do not mechanically list each commit.
- Group changes by "Function / Purpose" and answer:
- Why is this change needed?
- What problem does it solve?
- Which modules are roughly modified?
3. 使用 Paddle 官方 PR 模板
3. Use Paddle Official PR Template
- PR 内容必须遵循 Paddle 官方 PR 模板:
- 模板链接:
https://github.com/PaddlePaddle/Paddle/blob/develop/.github/PULL_REQUEST_TEMPLATE.md - 模板使用**三级标题()**作为各小节标题,生成 PR 描述时需与之保持一致。
### - 模板结构(简化版):
- 模板链接:
markdown
undefined- PR content must follow the Paddle official PR template:
- Template link:
https://github.com/PaddlePaddle/Paddle/blob/develop/.github/PULL_REQUEST_TEMPLATE.md - The template uses level 3 headings () as the title of each section, and you need to keep consistency when generating the PR description.
### - Simplified template structure:
- Template link:
markdown
undefinedPR Category
PR Category
<!-- One of [ User Experience | Execute Infrastructure | Operator Mechanism | CINN | Custom Device | Performance Optimization | Distributed Strategy | Parameter Server | Communication Library | Auto Parallel | Inference | Environment Adaptation ] -->
<!-- One of [ User Experience | Execute Infrastructure | Operator Mechanism | CINN | Custom Device | Performance Optimization | Distributed Strategy | Parameter Server | Communication Library | Auto Parallel | Inference | Environment Adaptation ] -->
PR Types
PR Types
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Others ] -->
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Others ] -->
Description
Description
是否引起精度变化
是否引起精度变化
<!-- one of the following [ 是 | 否 ]-->
- 生成 PR 描述时,按以上四个小节依次填写:
- **PR Category**:高层次类别,例如 Bug fix、Feature、Refactor、Doc 等。
- **PR Types**:更细的类型说明,例如 API 变更、性能优化、算子新增等。
- **Description**:用自然语言简要说明该 PR 的背景、动机和主要改动点。**描述正文中不要使用三级及三级以上标题**(`###`、`##`、`#`),若需分段小标题,最多使用四级标题(`####`)。
- **是否引起精度变化**:明确说明是否会影响已有模型或任务的精度,并给出必要的说明。<!-- one of the following [ 是 | 否 ]-->
- When generating the PR description, fill in the following four sections in order:
- **PR Category**: High-level category, such as Bug fix, Feature, Refactor, Doc, etc.
- **PR Types**: More detailed type description, such as API change, performance optimization, new operator addition, etc.
- **Description**: Briefly explain the background, motivation, and main changes of the PR in natural language. **Do not use level 3 or higher headings (`###`, `##`, `#`) in the description body**. If subheadings are needed for segmentation, use at most level 4 headings (`####`).
- **Does it cause accuracy changes?**: Clearly state whether it will affect the accuracy of existing models or tasks, and provide necessary explanations.4. 使用 gh 命令创建 / 更新 PR
4. Use gh Command to Create / Update PR
- 使用 命令创建或更新 PR。
gh
- Use the command to create or update a PR.
gh
标题规范
Title Specification
- 标题整体用英文,保持简洁明了。
- 推荐格式:
[PR 大类] 简要说明- 示例:
[CINN] avoid wrong fusion for xxx op - 示例:
[LargeTensor] fix xxx kernel - 示例:
[CodeStyle] update code style
- 示例:
- 避免使用含糊标题,例如:
- /
fix bug/update code/test/temp等。WIP
- 尽量控制在一行内说清「做了什么」或「修改目的」,不需要罗列所有细节。
示例命令(根据实际情况替换标题和正文):
bash
gh pr create --title "[xxx] xxx" --body "$(cat <<'EOF'- The title should be in English overall, concise and clear.
- Recommended format:
[PR Category] Brief Description- Example:
[CINN] avoid wrong fusion for xxx op - Example:
[LargeTensor] fix xxx kernel - Example:
[CodeStyle] update code style
- Example:
- Avoid vague titles, such as:
- /
fix bug/update code/test/tempetc.WIP
- Try to clarify "what was done" or "the purpose of the modification" in one line, without listing all details.
Example command (replace the title and body according to actual situation):
bash
gh pr create --title "[xxx] xxx" --body "$(cat <<'EOF'PR Category
PR Category
Operator Mechanism
Operator Mechanism
PR Types
PR Types
New features
New features
Description
Description
在这里说明该改动的动机和主要变化,可根据实际情况扩展。
在这里说明该改动的动机和主要变化,可根据实际情况扩展。
是否引起精度变化
是否引起精度变化
否
EOF
)"
undefined否
EOF
)"
undefined注意事项
Notes
- 始终使用 Paddle 官方 PR 模板的章节结构,标题层级与模板一致(模板使用三级标题 ),不要自定义新的顶层标题。
### - Description 描述正文中不要加三级及三级以上标题,若有分段需求,最多使用四级标题()。
#### - 优先强调「为什么需要这次改动」,而不是罗列所有实现细节。
- 如果业务或背景信息不清楚,应先向用户提问澄清,再生成 PR 描述。
- 成功创建或更新 PR 后,应返回 PR URL,方便用户查看。
- Always use the section structure of the Paddle official PR template, keep the title hierarchy consistent with the template (the template uses level 3 headings ), and do not customize new top-level headings.
### - Do not use level 3 or higher headings in the Description body. If segmentation is needed, use at most level 4 headings ().
#### - Prioritize emphasizing "why this change is needed" rather than listing all implementation details.
- If business or background information is unclear, ask the user for clarification first before generating the PR description.
- After successfully creating or updating the PR, return the PR URL for the user to view.