Incubator-mxnet: cudnn Dropout reproducibility

Created on 26 Jul 2019  路  8Comments  路  Source: apache/incubator-mxnet

https://github.com/apache/incubator-mxnet/blob/master/src/operator/nn/dropout-inl.h#L491-L493

The seed of CUDNN dropout does not respect the random seed in mxnet

Backend Bug

All 8 comments

Hey, this is the MXNet Label Bot.
Thank you for submitting the issue! I will try and suggest some labels so that the appropriate MXNet community members can help resolve it.
Here are my recommended labels: Cuda, Bug

@ptrendx @DickJC123 just FYI

So all those places should be seeded propperly correct?

random/sampler.* and rnn_impl.* are for other operators, not dropout. But yes, in general those should also be fixed, and deserve separate github issues

below is a test case:

import mxnet as mx

a = mx.nd.ones((10,10), ctx=mx.gpu())
dropout = mx.gluon.nn.Dropout(0.5)
seed = 1234

mx.random.seed(seed)

with mx.autograd.record():
    b = dropout(a)

mx.random.seed(seed)

with mx.autograd.record():
    c = dropout(a)

print(b)
print(c)
mx.test_utils.assert_almost_equal(b.asnumpy(), c.asnumpy())

Reopen as fix is reverted due to performance issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dushoufu picture dushoufu  路  3Comments

realbns2008 picture realbns2008  路  3Comments

JonBoyleCoding picture JonBoyleCoding  路  3Comments

Shiro-LK picture Shiro-LK  路  3Comments

Ajoo picture Ajoo  路  3Comments