-
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]Codegen templete of Op vjp interface #56196
[NewIR]Codegen templete of Op vjp interface #56196
Conversation
你的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
""" | ||
|
||
OP_VJP_DEFINE_TEMPLATE = """ | ||
std::vector<std::vector<ir::OpResult>> {op_class_name}::Vjp( |
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.
这里的签名是 vector of vector,意味着这一层接口之外是不需要再考虑 combine 和 slice了,所有的pack和unpack都在 vjp 函数里默认做了?
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.
是的
Co-authored-by: Aurelius84 <[email protected]>
@@ -22,6 +22,86 @@ | |||
}} | |||
""" | |||
|
|||
OP_VJP_FORWARD_INPUT_OR_OUTPUT_TEMPLATE = """ | |||
{input_type} {input_name}(std::make_shared<primitive::experimental::DescTensor>(op_obj.{input_name}())); |
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.
这份代码将生成在 paddle::dialect namespace 下吧?primitive::experimental 是不是需要加上 paddle namespace?
PR types
Others
PR changes
Others
Description
paddle.dialect 下op定义生成vjp调用接口模版
![image](https://private-user-images.githubusercontent.com/100397923/259953526-89f05ddf-d06a-48b2-9faa-baa8f2188dac.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NzM1NjgsIm5iZiI6MTczOTY3MzI2OCwicGF0aCI6Ii8xMDAzOTc5MjMvMjU5OTUzNTI2LTg5ZjA1ZGRmLWQwNmEtNDhiMi05ZmFhLWJhYThmMjE4OGRhYy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNlQwMjM0MjhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05NTE4YTQyNDYyYjZhNTMxNDZiNDg4OGM3YWUwNTZiOGU5ZTAyOGY3OTJjMmZiMDEzMWU4OTFkYTI1MzQ3N2Q4JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.g3eTmmJCUzPoBZmiaAGxP6J5VU6PNuHqkODeHV8GdcM)
TODO 解析模版参数生成有效内容
pcard-67164