leezu commented on a change in pull request #17547: Fix cudnn Dropout
reproducibility
URL: https://github.com/apache/incubator-mxnet/pull/17547#discussion_r406867814
##########
File path: src/operator/rnn-inl.h
##########
@@ -1495,7 +1500,7 @@ class RNNOp {
cudnnRNNInputMode_t input_mode_;
cudnnDropoutDescriptor_t dropout_desc_;
Storage::Handle reserve_space_;
- uint64_t seed_ = 17 + rand() % 4096; // NOLINT(runtime/threadsafe_fn)
Review comment:
This `seed_` is used for `rand_r` in the forward implementations. That's
very bad practice, not portable and should be fixed.
As this PR already passes CI, it's fine to fix it in a follow-up PR. In fac,
https://github.com/apache/incubator-mxnet/pull/17984 is blocked by the usage of
`rand_r` so I may fix it there.
More info:
https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services