-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[NPU] Add norm_grad kernel #35237
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
[NPU] Add norm_grad kernel #35237
Conversation
|
Thanks for your contribution! |
| // dx = ( dy/sqrt(sum(x*x)) ) * [1 - x*sum(x) / (sum(x*x) + e)] | ||
| // = [dy - dy * x * sum(x) / (sum(x*x) + e)] / sqrt(sum(x*x)) | ||
| // = [dy - x * sum(x*dy) / (sum(x*x) + e)] / sqrt(sum(x*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.
确认下,这个算子在P固定为2的情况下,前向和反向应该都可以和 L2Normalize & L2NormalizeGrad 对齐。
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.
done, thanks.
qili93
left a comment
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
zhangting2020
left a comment
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 for skip_check_grad_ci
* [NPU] fix for test_norm_op_npu * [NPU] add norm_grad * [NPU] add CheckAxis for axis * [NPU] delete debug codes * norm can not use L2Normalize, norm_grad can use L2NormalizeGrad * [NPU] delete useless codes * [NPU] optimize norm_grad OpMaker * Update python import path
PR types
New features
PR changes
OPs
Describe
Add norm_grad kernel