-
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
[Prim][PIR] Support the dynamic shape for layer_norm_grad #68274
base: develop
Are you sure you want to change the base?
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
|
if (bias_ptr->dtype() == phi::DataType::FLOAT16 || | ||
bias_ptr->dtype() == phi::DataType::BFLOAT16) { | ||
bias_grad_tmp = cast<T>(bias_grad_tmp, bias_ptr->dtype()); | ||
} |
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.
这里的判断逻辑有一个函数ConvertoMT可以使用
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.
不行吧,我看ConvertoMT里面用是将半精度转成float32,但是这个部分是从float32转回半精度
} | ||
set_output<T>(bias_grad_tmp, bias_grad); | ||
} else { | ||
bias_grad = nullptr; |
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.
动静shape 相同的代码只写一份吧
@@ -49,6 +49,7 @@ | |||
"pd_op.gather_nd", | |||
"pd_op.gelu", | |||
"pd_op.hardswish", | |||
"pd_op.layer_norm", |
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.
反向动态shape 基本支持完备了,可以看看怎么删除这个list吧
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
Sorry to inform you that 6b46c2b's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
Operator Mechanism
PR Types
New features
Description
为layer_norm_grad添加动态shape支持,Mac和cpu精度不足