SuperAPI AI Directory

paddle-pull-request

General & other

View repository

Updated 10-16 03:14

About this skill

Paddle repository PR creation and update

Process

1. Check branch status

  • Check whether the current branch has already been pushed to the remote; if not, run git push -u origin HEAD。
  • If the current branch name is main or master, confirm with the user before continuing whether they really want to submit a PR directly on that branch.

2. Organize changes by logical topic

  • Do not mechanically list every commit.
  • Group the changes by "feature / purpose" and answer:
    • Why is this change needed?
    • What problem does it solve?
    • Which modules were roughly changed?

3. Use the official Paddle PR template

  • The PR content must follow the official Paddle PR template:
    • Template link:https://github.com/PaddlePaddle/Paddle/blob/develop/.github/PULL_REQUEST_TEMPLATE.md
    • The template uses **level-3 headings (###)** as section titles, and the generated PR description must be consistent with them.
    • Template structure (simplified):
### 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 ] -->

### PR Types
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Others ] -->

### Description

### 是否引起精度变化
<!-- one of the following [ 是 | 否 ]-->
  • When generating the PR description, fill in the above four sections in order:
    • PR Category: High-level category, such as Bug fix, Feature, Refactor, Doc, etc.
    • PR Types: A more detailed type description, such as API changes, performance optimization, new operators, 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, use at most level-4 headings (####)。
    • Whether it causes accuracy changes: Clearly state whether it will affect the accuracy of existing models or tasks, and provide the necessary explanation.

4. Run prek checks before submitting

  • Before creating or updating a PR, first run prek to perform format checks on all files:

    prek
    
  • If prek automatically modified files, add these modifications to a new commit, then push:

    git add .
    git commit -m "🔧 chore: apply prek fixes"
    git push
    
  • Only after the prek check passes (with no additional modifications), continue to create or update the PR.

  • If prek reports errors that cannot be fixed automatically (such as type checking or custom hook failures), manually fix them based on the error messages and rerun until all checks pass, then continue to create or update the PR.

5. Create / update a PR using the gh command

  • Use the gh command to create or update a PR.

Title conventions

  • Use English for the title overall, and keep it concise and clear.
  • Recommended format:[PR 大类] 简要说明
    • Example:[CINN] avoid wrong fusion for xxx op
    • Example:[LargeTensor] fix xxx kernel
    • Example:[CodeStyle] update code style
  • Avoid vague titles, such as:
    • fix bug / update code / test / temp / WIP , etc.
  • Try to clearly state "what was done" or "the purpose of the change" in one line; there is no need to list all details.

Example command (replace the title and body according to the actual situation):

gh pr create --title "[xxx] xxx" --body "$(cat <<'EOF'
### PR Category
Operator Mechanism

### PR Types
New features

### Description
在这里说明该改动的动机和主要变化,可根据实际情况扩展,优先使用中文。

### 是否引起精度变化
否

EOF
)"

Notes

  • Always use the section structure of the official Paddle PR template,with heading levels consistent with the template(the template uses level-3 headings ###); do not customize new top-level headings.
  • Description bodyDo not add level-3 or higher headings; if paragraph breaks are needed, use at most level-4 headings (####)。
  • Prioritize emphasizing "why this change is needed" rather than listing all implementation details.
  • If the business or background information is unclear, you should first ask the user for clarification, then generate the PR description.
  • After successfully creating or updating the PR, you should return the PR URL so the user can view it.
  • When generating PR descriptions, debugging notes, or issue analyses for Paddle-related repositories,prefer using Chinese, unless the upstream template or a specific scenario requires English.
  • Do not add any bot / machine account as a collaborator。