-
Notifications
You must be signed in to change notification settings - Fork 89
[Tools] Migrate NO_NEED_CONVERT to api_mapping.json and rename matcher class
#807
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: master
Are you sure you want to change the base?
Conversation
|
Thanks for your contribution! |
The NO_NEED_CONVERT_LIST in global_var.py contained numerous duplicate and unnecessary entries, which made the list difficult to maintain and review. This commit cleans up the list by removing all redundant items, leaving only the essential entries that are genuinely required. The cleanup improves code clarity and reduces potential confusion when managing the conversion exclusions.
- Rename NoNeedConvertMatcher class to ChangePrefixMatcher in api_matcher.py - Update API mapping in CONTRIBUTING.md to reflect matcher name change - Update references in global_var.py and basic_transformer.py
… and adjust tests
NO_NEED_CONVERT to api_mapping.json and rename matcher class
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.
- torch.fft.fftfreq这个能用ChangePrefixMatcher吗
- GlobalManager.NO_NEED_CONVERT_LIST这个名单不再需要了,后面直接改api_mappin.json就行。GlobalManager.NO_NEED_CONVERT_LIST这些其他位置代码也都移除了,这个概念以后就不需要了
- 目前优先级NO_NEED_CONVERT_LIST>ALIAS_MAPPING>API_MAPPING,移除NO_NEED_CONVERT_LIST后会导致ALIAS优先生效,因此需要清理ALIAS_MAPPING,API_MAPPING中的key不应该在ALIAS_MAPPING中出现。
- 为了确保ChangePrefixMatcher真正实现了『API完全一致』效果,单测基类APIBase里还得增强下,检查转换完后的代码必须有
self.pytorch_api[1:](类方法为self.pytorch_api[-1]),防止被别名替换了。
可以,rfftfreq 和 fftfreq 都可以
Done
下个 commit 再提, BTW 这个链接访问不了 |
PR Docs
本 PR 将 NO_NEED_CONVERT APIs 收入 api_mapping 统一管理,并更名为 ChangePrefixMatcher
PR APIs
具体包括:
Docs 仓工具需要配套修改,关联PR PaddlePaddle/docs#7683
Note:
https://github.com/PaddlePaddle/Paddle/pull/77431/changes 引入 Broken 更新,本 PR 固定 Paddle 为 0119 以测试 CI