Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

softrelu activation clipping bug in MKLDNN #11804

Closed
safrooze opened this issue Jul 18, 2018 · 12 comments
Closed

softrelu activation clipping bug in MKLDNN #11804

safrooze opened this issue Jul 18, 2018 · 12 comments

Comments

@safrooze
Copy link
Contributor

safrooze commented Jul 18, 2018

Description

With MKLDNN (enabled in mxnet-cuxxmkl builds), using softrelu activation, the output is clipped to maximum value of 88.37625885009766. This regression was introduced in 1.2.0 when MKLDNN was enabled for activations other than relu in #10336.

Looking at MKLDNN implementation of softrelu, I don't see any overflow prevention logic, so most likely the exp() function overflows and results in this bug.

Environment info (Required)

mxnet-cu90mkl >= 1.2.0b20180403

Minimum reproducible example

nd.Activation(nd.array([100]), act_type='softrelu')

output:

[ 88.37625885]
<NDArray 1 @cpu(0)>

@jinhuang415

@safrooze safrooze changed the title softrelu activation clipping in MKLDNN softrelu activation clipping bug in MKLDNN Jul 18, 2018
@safrooze
Copy link
Contributor Author

@pengzhao-intel @zheng-da

@pengzhao-intel
Copy link
Contributor

@safrooze thanks for the analysis :) @ZhennanQin please help take a look for this issue.

@ZhennanQin
Copy link
Contributor

@safrooze Thanks for reporting this. We confirmed this is a bug in mkldnn, and will fix this in future. considering input > 88 is a corner case in most of models, most users shouldn't face this problem when using soft_relu with mkldnn. If you're having trouble with this on a certain model, please let us know.

@azai91
Copy link
Contributor

azai91 commented Jul 31, 2018

@ZhennanQin do we have an ETA when this would be fixed? should we fallback if input too large?

@ZhennanQin
Copy link
Contributor

ZhennanQin commented Aug 1, 2018

@azai91 , this defect will be addressed within the next sprint, with expected target date around 15th Aug.

@safrooze
Copy link
Contributor Author

@ZhennanQin Is this fixed in MKLDNN now?

@ZhennanQin
Copy link
Contributor

@safrooze Patch is ready for internal test. Will push to github repo in next promotion.

@safrooze
Copy link
Contributor Author

@ZhennanQin Is this pushed now?

@ZhennanQin
Copy link
Contributor

@safrooze Yes, the commit is oneapi-src/oneDNN@23f45a2. Thanks.

@apeforest
Copy link
Contributor

@safrooze Please verify at your earliest convenience if this issue has been fixed. Thanks!

@apeforest
Copy link
Contributor

apeforest commented Sep 25, 2018

@safrooze I have verified that using the master from intel/mkl-dnn module the problem has been fixed.

from mxnet import ndarray as nd

nd.Activation(nd.array([100]), act_type='softrelu')

[100.]
<NDArray 1 @cpu(0)>

@sandeep-krishnamurthy @nswamy Please close this issue.

@safrooze
Copy link
Contributor Author

@apeforest Thanks! Closing this issue. Just for reference this fix will be included in MKLDNN 0.17 release.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants