-
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
Optimize performance of log_softmax #38992
Conversation
Thanks for your contribution! |
fd01292
to
2125c83
Compare
Sorry to inform you that c894654's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
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 unity_build_rule.cmake
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.
ops::LogSoftmaxGradCUDNNKernel<float>, | ||
ops::LogSoftmaxGradCUDNNKernel<double>, | ||
ops::LogSoftmaxGradCUDNNKernel<plat::float16>); | ||
#endif |
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.
LGTM.
@@ -56,6 +65,11 @@ class LogSoftmaxOpMaker : public framework::OpProtoAndCheckerMaker { | |||
"The dimension index of Input(x) to perform log_softmax," | |||
"default -1 for last dimension") | |||
.SetDefault(-1); | |||
AddAttr<bool>( |
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.
不建议新增属性,直接改原CUDA Kernel吧。
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,thx
4329528
const bool log_mode, | ||
DenseTensor* out) { | ||
PADDLE_THROW( | ||
"This kernel is not supported when the dtype is bf16 and CUDNN_VERSION < " |
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_THROW
也要指明error
类型。
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, thx
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
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 PADDLE_ENFORCE
PR types
Performance optimization
PR changes
OPs
Describe
Optimize performance of log_softmax by the unified logic of softmax