-
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
【Hackathon 5th No.112】move fused_gemm_epilogue to phi and add the yaml of identity_loss #59363
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/phi/api/yaml/op_compat.yaml
Outdated
- op: write_to_array | ||
backward : fused_gemm_epilogue_grad |
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.
这就改,(:з」∠)
这个算子已经在manual_op.cc里有了手写的pir代码,无法再次通过yaml文件来生成,所以会出现如上错误,这个比较特殊,这里无法将原来的op.cc文件彻底删除,只能删除原文件的Kernel实现部分,将op定义保留,可以参考一下fused_softmax_mask这个算子。 |
谢谢老师,我学习一下~ |
op->SetInput(framework::GradVarName("Out"), this->OutputGrad("Out")); | ||
|
||
op->SetOutput("DX", this->InputGrad("X")); | ||
op->SetOutput("DY", this->InputGrad("Y")); | ||
op->SetOutput("DBias", this->InputGrad("Bias")); | ||
op->SetOutput(framework::GradVarName("X"), this->InputGrad("X")); | ||
op->SetOutput(framework::GradVarName("Y"), this->InputGrad("Y")); | ||
op->SetOutput(framework::GradVarName("Bias"), this->InputGrad("Bias")); |
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.
这里随意修改Op定义会有问题,因为在op定义后,很多其他组件可能就默认使用定义好的名字,这里修改后会造成命名对不上,建议恢复原状
REGISTER_OPERATOR(fused_gemm_epilogue_grad, | ||
ops::FusedGemmEpilogueGradOp, | ||
ops::FusedGemmEpilogueGradOpMaker); | ||
FusedGemmEpilogueGradInferShapeFunctor); |
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.
这里可以不删除ops::FusedGemmEpilogueGradOpMaker吗
4c34b68
to
c41b7eb
Compare
|
@zeroRains sig文件写的有问题,这样改试试:
|
@YuanRisheng 好像可以了 |
paddle/phi/api/yaml/ops.yaml
Outdated
data_type : x | ||
backend : x |
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只有一个x, 这里的dtype和backend可以不配置
paddle/phi/infermeta/binary.h
Outdated
void IdentityLossGradInferMeta(const MetaTensor& x, | ||
const MetaTensor& out_grad, | ||
const int reduction, | ||
MetaTensor* x_grad); | ||
|
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.
InferMeta函数按照字母序放置
PR types
Others
PR changes
Others
Description
move fused_gemm_epilogue to phi