Closed ashishfarmer closed 6 years ago
/cc @daniellowell
This epsilon is used to avoid div by zero; which mean any small enough value will do.
Cudnn introduces float epsilon here simply for floating point comparison. no functional difference IMHO
@petrex, I agree, no functional difference. You can copy what they do if you like. So long as the epsilon does its job.
I guess @ashishfarmer 's concern is the warning msg. I am going to set const double MIOPEN_BN_MIN_EPSILON = 1e-6;
so we will not hit the condition when compare this value to the default epsilon(1e-5) from SpatialBNOp
.
I am not expecting behavior change but if we miss anything let us know. thanks.
1e-6 should be fine.
The change in PR 91 fixes the issue. Thank you!
Running SpatialBatchNorm op in MIOpen path generates a warning on the command line:
This is happening because Caffe2 sets epsilon_ to 1e-5 which is same as MIOPEN_BN_MIN_EPSILON, which triggers the condition on ln 38 of spatial_batch_norm_opmiopen.cc CUDNN uses condition ```if (epsilon <= CUDNN_BN_MIN_EPSILON - FLTEPSILON)
instead of
if (epsilon <= MIOPEN_BN_MIN_EPSILON)```Need to investigate what is proper value of MIOPEN_BN_MIN_EPSILON and the condition