4 ms·
Computations carried out on GPUs are hardly ever deterministic. Things happen in parallel and as we known not even something as basic as adding up a bunch of f
by KeplerBoy 4y ago
Computations carried out on GPUs are hardly ever deterministic.
Things happen in parallel and as we known not even something as basic as adding up a bunch of floats is associative. Combining that with the fact that CUDA makes few guarantees about the order your operations will be carried out (at the block level) makes true deterministic behavior unachievable.
- simonw 4y agoThank you! That really helped me understand this issue. I got ChatGPT Code Interpreter to generate an example for me: a = 0.1 b = 0.2 c = 0.3 result1 = (a + b) + c result2 = a + (b + c) (result1, result2, result1 == result2) Output: (0.6000000000000001, 0.6, False)
- monkeydust 4y agoInterestingly when I copy paste your example I get true. Perhaps that itself is the example