-
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
Optimize perf of softmax_with_cross_entropy #39553
Conversation
Thanks for your contribution! |
} else { | ||
loss[label_id] = loss_value; | ||
} | ||
} |
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.
else 的情况会有问题吗?好像有些情况没有给 loss 赋值
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.
label_value的有效范围是[0, size),而loss_id的遍历范围也是[0, size),因此不会出现loss不被赋值的情况
return val; | ||
} | ||
|
||
template <typename T, typename AccT, typename LabelT, int VecSize, |
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.
好的,下个PR会加一些注释。
…)" This reverts commit bbe5228.
* add align for WorkQueue * add spinlock * merge develop * merge * Add EventsWaiter * Revert "Add EventsWaiter" This reverts commit e206173. * Add host_trace_level env variable * Revert "Optimize perf of softmax_with_cross_entropy (#39553)" This reverts commit bbe5228. Co-authored-by: liutiexing <liutiexing@google.com> Co-authored-by: ZzSean <18818272991@163.com>
PR types
Performance optimization
PR changes
OPs
Describe
Optimize perf of softmax_with_cross_entropy
Replace cudnn with CUDA kernel, and make the process of cross entrop into softmax