-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[NewIR]Gen new ir api for paddle::dialect::xxx #56241
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
|
||
COMBINE_OP_TEMPLATE = """auto {op_name} = APIBuilder::Instance().GetBuilder()->Build<ir::CombineOp>({in_name});""" | ||
|
||
COMPUTE_OP_TEMPLATE = """paddle::dialect::{op_class_name} {op_inst_name} = APIBuilder::Instance().GetBuilder()->Build<paddle::dialect::{op_class_name}>({args});""" |
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.
后续这里的code可以酌情换行下,提升生成代码的可读性
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.
嗯嗯,后续的pr会考虑format下代码格式
@@ -4,3 +4,4 @@ cc_library( | |||
primitive_vjp_experimental | |||
SRCS ${VJP_SRCS} | |||
DEPS primitive_backend_static_experimental) | |||
add_dependencies(primitive_vjp_experimental pd_dialect) |
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.
这一行需要显式地添加么?backend/CMakeLists.txt 中的 primitive_backend_static_experimental 已经DEPS了pd_dialect,所以这里不是隐式已经依赖了pd_dialect?
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.
这里需要显示添加add_dependencies
def _gen_return_result(self, op_info, op_inst_name): | ||
output_name_list = op_info.output_name_list | ||
assert len(output_name_list) == 1 | ||
return f'return {op_inst_name}.result(0);' |
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.
后面会提pr支持多输出的情况感谢~
PR types
Others
PR changes
Others
Description
Gen new ir api

pcard-67164