NVIDIA / cuda-samples

Samples for CUDA Developers which demonstrates features in CUDA Toolkit
Other
6.49k stars 1.84k forks source link

Inconsistent inference accuracy of pytorch model caused by cuda version #283

Open zhangchen98 opened 4 months ago

zhangchen98 commented 4 months ago

When I use the gpu version of pytorch for model inference, I found that the output tensor accuracy is inconsistent, as follows: Screenshot from 2024-07-16 12-22-10

When I switch to cpu, this problem does not occur. Furthermore, I can also get consistent results when using lower cuda versions (11.6->11.3). Screenshot from 2024-07-16 12-25-53

Environment: