-
Notifications
You must be signed in to change notification settings - Fork 907
[API Compatibility] Modify and supplement documents Edit By AI Agent #7901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,8 @@ | ||||||
| --- | ||||||
| name: create-pr | ||||||
| description: 仅用于《Paddle API 对齐 PyTorch 项目》,负责 Step5:代码提交,负责在前序步骤都完成后,分别对 Paddle、PaConvert、Docs 三个仓库创建或更新 Pull Request | ||||||
| description: 负责《Paddle API 对齐 PyTorch 项目》中 Step5:代码提交,分别对 Paddle、PaConvert、Docs 三个仓库创建或更新 Pull Request | ||||||
| allowed-tools: Bash(git *) | ||||||
| denied-tools: [] | ||||||
| disable-model-invocation: false | ||||||
| --- | ||||||
|
|
||||||
|
|
@@ -14,42 +15,95 @@ disable-model-invocation: false | |||||
|
|
||||||
| ## Step 1:检查三个仓库的改动状态 | ||||||
|
|
||||||
| 验证三个仓库都已有需要提交的改动: | ||||||
| 三个仓库的本地目录名称分别为 Paddle、PaConvert、docs,自行找到对应本地路径,检查三个仓库是否有未提交的改动,**只对有代码改动的仓库进行后续提交**(排除未跟踪文件): | ||||||
|
|
||||||
| ```bash | ||||||
| cd /path/to/Paddle && git status | ||||||
| cd /path/to/PaConvert && git status | ||||||
| cd /path/to/docs && git status | ||||||
| cd /path/to/Paddle && git status --untracked-files=no | ||||||
| cd /path/to/PaConvert && git status --untracked-files=no | ||||||
| cd /path/to/docs && git status --untracked-files=no | ||||||
| ``` | ||||||
|
|
||||||
| ## Step 2:添加改动并提交 | ||||||
| 判断标准: | ||||||
| - 若仓库中有 `M`、`A`、`D` 等标记的**已跟踪文件**,则该仓库**需要提交** | ||||||
| - 若仓库中只有 `??` 标记的**未跟踪文件**,则该仓库**无需提交** | ||||||
| - 若仓库无任何改动,则该仓库**无需提交** | ||||||
|
Comment on lines
+18
to
+29
|
||||||
|
|
||||||
| 对每个仓库执行以下操作(顺序:Paddle → Docs → PaConvert): | ||||||
| ## Step 2:获取 PyTorch API 名单 | ||||||
|
|
||||||
| 根据各仓库的改动状态,自行从多个渠道获取 PyTorch API 名单,**最后需要取并集**: | ||||||
|
|
||||||
| **渠道一:从上下文获取** | ||||||
|
|
||||||
| ```bash | ||||||
| # 从 api-change-decider、python-decorator、cpp-sink 等前序步骤的上下文中自动提取 API 名单 | ||||||
| ``` | ||||||
|
|
||||||
| **渠道二:从用户输入获取** | ||||||
|
|
||||||
| ```bash | ||||||
| # 用户直接提供 PyTorch API 名单,例如:torch.relu、torch.sigmoid、torch.tanh 等 | ||||||
| ``` | ||||||
|
|
||||||
| **渠道三:从 Paddle 仓库分析获取** | ||||||
|
|
||||||
| 若 Paddle 仓库有改动,分析以下位置: | ||||||
|
|
||||||
| ```bash | ||||||
| cd /path/to/Paddle | ||||||
| # 1. 分析任意 Python 文件的改动 | ||||||
| git diff origin/develop -- '*.py' | grep -E "^\+.*def|^\+.*class" | ||||||
|
|
||||||
| # 2. 分析 python_api_info.yaml 的改动 | ||||||
| git diff origin/develop -- python_api_info.yaml | ||||||
| ``` | ||||||
|
|
||||||
| **渠道四:从 PaConvert 仓库分析获取** | ||||||
|
|
||||||
| 若 PaConvert 仓库有改动,从 `api_mapping.json` 提取标记为 `ChangePrefixMatcher` 的 API: | ||||||
|
|
||||||
| ```bash | ||||||
| cd /path/to/PaConvert | ||||||
| # 分析 api_mapping.json 中标记为 ChangePrefixMatcher 的 API | ||||||
| git diff origin/master -- api_mapping.json | grep -E "ChangePrefixMatcher|torch\." | ||||||
| ``` | ||||||
|
|
||||||
| **API 名单合并** | ||||||
|
|
||||||
| ```bash | ||||||
| # 将从各渠道获取的 API 名单取并集,确保不重复,生成最终的统一 API 名单 | ||||||
| # 例如:torch.relu, torch.sigmoid, torch.tanh, ... | ||||||
| ``` | ||||||
|
|
||||||
| ## Step 3:添加改动并提交 | ||||||
|
|
||||||
| 仅对**有代码改动的仓库**执行以下操作(顺序:Paddle → Docs → PaConvert): | ||||||
|
|
||||||
| ```bash | ||||||
| # Paddle 仓库 | ||||||
| cd /path/to/Paddle | ||||||
| git add -A | ||||||
| git add -u | ||||||
| git commit -m "[API Compatibility] api_name_1/api_name_2/api_name_3/... Edit By AI Agent" | ||||||
| # 等待 pre-commit hook 完成 | ||||||
|
Comment on lines
82
to
86
|
||||||
| # 如果 pre-commit 失败,修复问题后重新 git add 和 commit | ||||||
|
|
||||||
| # docs 仓库 | ||||||
| cd /path/to/docs | ||||||
| git add -A | ||||||
| git add -u | ||||||
| git commit -m "[API Compatibility] api_name_1/api_name_2/api_name_3/... Edit By AI Agent" | ||||||
| # 等待 pre-commit hook 完成 | ||||||
| # 如果 pre-commit 失败,修复问题后重新 git add 和 commit | ||||||
|
|
||||||
| # PaConvert 仓库 | ||||||
| cd /path/to/PaConvert | ||||||
| git add -A | ||||||
| git add -u | ||||||
| git commit -m "[API Compatibility] api_name_1/api_name_2/api_name_3/... Edit By AI Agent" | ||||||
| # 等待 pre-commit hook 完成 | ||||||
| # 如果 pre-commit 失败,修复问题后重新 git add 和 commit | ||||||
| ``` | ||||||
|
|
||||||
| ## Step 3:推送代码到 upstream claude 分支 | ||||||
| ## Step 4:推送代码到 upstream claude 分支 | ||||||
|
|
||||||
| 仅对**有代码改动的仓库**执行推送操作: | ||||||
|
|
||||||
| ```bash | ||||||
| # Paddle 仓库 | ||||||
|
|
@@ -65,9 +119,9 @@ cd /path/to/PaConvert | |||||
| git push upstream HEAD:claude -f | ||||||
| ``` | ||||||
|
|
||||||
| ## Step 4:创建 PR | ||||||
| ## Step 5:创建 PR | ||||||
|
|
||||||
| 根据自动获取的 PyTorch API 名单生成 PR,执行以下命令创建 PR(顺序:Paddle → Docs → PaConvert): | ||||||
| 根据自动获取的 PyTorch API 名单生成 PR,**仅对有代码改动的仓库**执行以下命令创建 PR(顺序:Paddle → Docs → PaConvert): | ||||||
|
||||||
| 根据自动获取的 PyTorch API 名单生成 PR,**仅对有代码改动的仓库**执行以下命令创建 PR(顺序:Paddle → Docs → PaConvert): | |
| 根据 Step 2 获取/汇总的 PyTorch API 名单生成 PR,**仅对有代码改动的仓库**执行以下命令创建 PR(顺序:Paddle → Docs → PaConvert): |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| --- | ||
| name: pytorch-alignment-validator | ||
| description: 仅用于《Paddle API 对齐 PyTorch 项目》,负责 Step3:Pytorch 对齐验证,基于 PaConvert 工具验证 Paddle API 与 PyTorch API 是否用法完全对齐一致 | ||
| description: 负责《Paddle API 对齐 PyTorch 项目》中 Step3:Pytorch 对齐验证,基于 PaConvert 工具验证 Paddle API 与 PyTorch API 是否用法完全对齐一致 | ||
|
||
| allowed-tools: Read Grep Glob Write Edit Bash(python *) | ||
| disable-model-invocation: false | ||
| --- | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
该描述中英文与中文之间缺少空格(如“C++下沉”“C++层”)。按本仓库中文文档书写规范,建议改为“C++ 下沉”“C++ 层”,以保持中英文混排一致性。