-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
[NewIR]Call _C_ops.xx in both dygraph and static mode #56809
Conversation
… modify-dy-static
… modify-dy-static
… modify-dy-static
… modify-dy-static
你的PR提交成功,感谢你对开源项目的贡献! |
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.
LGTM
@@ -209,6 +212,14 @@ def in_dygraph_mode(): | |||
return global_var._dygraph_tracer_ is not None | |||
|
|||
|
|||
def in_new_ir_mode(): | |||
return ir.core._use_new_ir_api() and not in_dygraph_mode() |
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.
既然这里已经有了in_new_ir_mode,后续可以删掉use_new_ir_api,统一写法
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.
好的后续可以统一一下,感谢
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.
LGTM
98cdc85
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.
LGTM
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.
LGTM
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.
LGTM for change in python/paddle/fluid
PR types
New features
PR changes
Others
Description
本PR完成以下的工作:
筛选了一下static_op_function.cc和eager_op_function.cc两个文件,api个数如下所示:
在ops_api.cc中,对于动静态图都有的api,生成了两个分支,在c++端进行动静态图的分发;对于只有静态图有的api(大部分是grad和xpu相关的api),在ops_api.cc中只生成了静态图的分支。在ops_api.cc中将所有生成的api都bind到了core.ir.ops这个module上
在python端,_ir_ops.xx()可以调用到所有ops_api.cc中的api;而对于_C_ops.xx()在本pr中只将mean这一个动静统一的api加到了_C_ops中,_C_ops中其他的api保持原样,后续会逐渐在白名单中添加api就可以进行覆盖
Pcard-67164