-
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
Fix NaN for softmax with long softmax_dim. #57851
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
Sorry to inform you that 15089a9's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
7fca389
to
06033bb
Compare
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
* Fix nan for softmax with long softmax_dim. * Simplify codes. * Remove the PADDLE_THROW in backward.
* Fix nan for softmax with long softmax_dim. * Simplify codes. * Remove the PADDLE_THROW in backward.
* Fix nan for softmax with long softmax_dim. * Simplify codes. * Remove the PADDLE_THROW in backward.
PR types
Bug fixes
PR changes
OPs
Description
Pcard-70459
softmax
函数出现NaN #55685 ,softmax长维度分支、前向结果在小输入数据出现NaN问题。KeMatrixSoftmaxForward
代码,主要包括以下几点:BatchSize
模板,外层实际传入的为BlockDim
,Kernel中实际并没有用到,增大了编译负担VecSize
模板,对于每种数据类型,使用的VecSize
是固定的,没有必要为多种VecSize
特化switch
的default
分支添加报错信息;反向添加报错后,log_softmax算子单测会fail,待反向计算问题解决后再添加。