Skip to content

[NewIR]Gen new ir api for paddle::dialect::xxx - #56241

Merged
0x45f merged 5 commits into
PaddlePaddle:developfrom
0x45f:ir-gen-api
Aug 15, 2023
Merged

0x45f merged 5 commits into
PaddlePaddle:developfrom
0x45f:ir-gen-api

Conversation

@0x45f

@0x45f 0x45f commented Aug 13, 2023 •

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

Others

Description

Gen new ir api
image

image

pcard-67164

@paddle-bot

paddle-bot Bot commented Aug 13, 2023

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.


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});"""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后续这里的code可以酌情换行下,提升生成代码的可读性

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嗯嗯,后续的pr会考虑format下代码格式

primitive_vjp_experimental
SRCS ${VJP_SRCS}
DEPS primitive_backend_static_experimental)
add_dependencies(primitive_vjp_experimental pd_dialect)

Copy link
Copy Markdown
Collaborator

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?

Copy link
Copy Markdown
Collaborator Author

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);'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里需要考虑多个输出的情况

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后面会提pr支持多输出的情况感谢~

@0x45f 0x45f changed the title Gen new ir api [IR]Gen new ir api Aug 14, 2023
@Aurelius84 Aurelius84 changed the title [IR]Gen new ir api [NewIR]Gen new ir api Aug 14, 2023
@Aurelius84 Aurelius84 changed the title [NewIR]Gen new ir api [NewIR]Gen new ir api for paddle::dialect::xxx Aug 14, 2023
@0x45f
0x45f merged commit d6ebbd4 into PaddlePaddle:develop Aug 15, 2023
@0x45f
0x45f deleted the ir-gen-api branch August 15, 2023 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants