Neutron3529 commented on issue #19649:
URL:
https://github.com/apache/incubator-mxnet/issues/19649#issuecomment-758560138
> @Neutron3529 I think It has nothing to do with tf32. I've tested with
`NVIDIA_TF32_OVERRIDE=0` as you suggested, the problem is not solved.
my result (v1.x, compiled by myself):
```python
>>> import os
>>> os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
>>> import mxnet as mx
>>> import numpy as np
>>> from mxnet.gluon.model_zoo.vision.resnet import resnet18_v1
>>> def testrestnet(ctx=mx.gpu(0)):
mx_model = resnet18_v1(pretrained=True,ctx=ctx)
mx_model.hybridize()
x_mx = mx.nd.ones(shape=(1,3,224,224), ctx=ctx)
y_mx = mx_model.features[0:6](x_mx)
res = y_mx.asnumpy().sum()
print(res)
...
>>> testrestnet(mx.cpu())
Downloading
/me/mxnet/models/resnet18_v1-a0666292.zipa165046a-afde-4d5a-a034-0163a93f6047
from
https://apache-mxnet.s3-accelerate.dualstack.amazonaws.com/gluon/models/resnet18_v1-a0666292.zip...
13064.974
>>> testrestnet(mx.cpu())
13064.974
>>> testrestnet(mx.cpu())
13064.974
>>> testrestnet(mx.gpu())
13064.976
>>> testrestnet(mx.gpu())
13064.976
--- using mxnet without TF_OVERRIDE
>>> import os
>>> os.environ['MXNET_CUDNN_AUTOTUNE_DEFAULT'] = '0'
>>> import mxnet as mx
>>> import numpy as np
>>> from mxnet.gluon.model_zoo.vision.resnet import resnet18_v1
>>> def testrestnet(ctx=mx.gpu(0)):
mx_model = resnet18_v1(pretrained=True,ctx=ctx)
mx_model.hybridize()
x_mx = mx.nd.ones(shape=(1,3,224,224), ctx=ctx)
y_mx = mx_model.features[0:6](x_mx)
res = y_mx.asnumpy().sum()
print(res)
...
>>> testrestnet()
13065.814
>>> testrestnet(mx.cpu())
13064.974
```
it seems that `NVIDIA_TF32_OVERRIDE=0` works for me, and without it may
bring a huge bias.
what's more, my CPU generated the different result (`13064.974` vs
`13064.977`)compared to yours, maybe the error is normal and do not worth an
issue.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]