-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Autogen Prim Operants] Autogen prim eager and static tensor operants #50558
[Autogen Prim Operants] Autogen prim eager and static tensor operants #50558
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
api_prims = yaml.safe_load(f) | ||
# white list temporarily | ||
api_prims = ('add', 'subtract', 'multiply', 'divide') |
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.
第一句的api_prims赋值有什么作用,另外api_prims = ('add', 'subtract', 'multiply', 'divide')
这个应该会多次做出修改,是不是可以作为一个全局变量放在外边,方便修改维护
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.
现在只重载了四则运算,api_prims = ('add', 'subtract', 'multiply', 'divide')
只是一个短期的白名单。后续会直接将这行代码删掉,根据 api_prims = yaml.safe_load(f)
生成 prim 的 api。
api_prims = ('add', 'subtract', 'multiply', 'divide')
is a temporary whitelist solution because tensor operants only overload arithmetic operators. In the future, this line of code will be deleted and generate prim api according to api_prims = yaml.safe_load(f)
@@ -0,0 +1,273 @@ | |||
# Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved. |
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.
2022 -> 2023
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.
Done, thx
api_prims = ('add', 'subtract', 'multiply', 'divide') | ||
|
||
for api in apis: | ||
eager_api = EagerPrimAPI(api, api_prims) |
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.
从长期来看 tensor operants 和 EagerPrimAPI 是不解耦开比较好些?Operants本身和PrimAPI不是一个强绑定的关系,如果以后要新增一套支持C++组网训练的API,可能operants还需要从prim里面分出来
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.
Done
… prim_operants_autogen
PR types
New features
PR changes
Others
Describe
Auto-generate tensor operants codes, code example:
eager_tensor_operants.h
eager_tensor_operants.cc
static_tensor_operants.h
static_tensor_operants.cc