Support kAddTo for softmax backward#11836
Conversation
|
Experiencing some bugs on GPU side, changing to WIP. |
|
any update? |
|
@eric-haibin-lin There's a weird bug that I'm still investigating... |
| expected_fwd = np_softmax(data, axis=axis) | ||
| expected_bwd = np.zeros(shape) | ||
| check_symbolic_forward(sym, [data], [expected_fwd]) | ||
| for req in ['add', 'write']: |
There was a problem hiding this comment.
Maybe also add 'null' to the list?
|
@haojin2 I am curious what the bug you experienced earlier was and how did you fix it? I only see one commit in this PR. Thanks! |
|
@apeforest it was only some typo |
|
Thanks for clarifying. LGTM. |
|
@anirudh2290 @sandeep-krishnamurthy Can you help merge this PR at your convenience? Thanks |
|
|
||
| if (req_grad) { | ||
| mxnet_op::SoftmaxGrad<mshadow_op::mul, mxnet_op::softmax_bwd>(s, | ||
| mxnet_op::SoftmaxGrad<mshadow_op::mul, mxnet_op::softmax_bwd, kWriteTo>(s, |
There was a problem hiding this comment.
do we want to reenable cudnn_forward for ctcloss op ?
There was a problem hiding this comment.
It's not within the scope of this PR, this PR is purely for fixing the problem with the request type the backward of softmax can handle. I can probably take a look into the problem later though, but I think this PR should be good to merge.
Description
Fix for issue #11411.
Checklist
Essentials
Changes
Comments
Note: No need to add kAddTo support for forward pass, actually there's no way to specify req to be kAddTo for forward computation.
New version of test_new_softmax passed more than 10000 trials on both CPU & GPU: