Commit cd25fb6
committed
use correct wavefrontsize for device-side rng
Using the wrong wavefrontsize here technically could cause non-deterministic results even with a fixed seed. This is because mutiple threads inside the same wavefront are writing different values to the same memory location non-atomically. In CUDA, which value is actually stored is undefined and I am assuming ROCm makes similar assumptions, though I didn't find it documented anywhere. Testing with RDNA3.5 in wavefront64 mode though, I wasn't able to produce non-deterministic results from this, so it might not be an issue in practice. Still, I believe it's good practice to not rely on this being deterministic.
One issue that remains is that we are allocating 32 counters and keys, even though 16 would be sufficient for wavefront64 targets. I didn't find a good way to emit these globals in a target-specific way, any suggestions welcome!
closes #8191 parent 4069021 commit cd25fb6
1 file changed
+5
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
| 86 | + | |
86 | 87 | | |
87 | | - | |
88 | | - | |
89 | | - | |
| 88 | + | |
90 | 89 | | |
91 | 90 | | |
92 | 91 | | |
| |||
104 | 103 | | |
105 | 104 | | |
106 | 105 | | |
107 | | - | |
| 106 | + | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
0 commit comments