Commit d65ce69
authored
Update PhiloxRNG.jl to v1.1.1 and fix counter overflow with UInt64 (#717)
Philox4x32-10 takes a 128-bit counter `(ctr0, ctr1)` and a 64-bit key. The scheme is:
- **key** = the 64-bit seed (identifies the RNG instance).
- **ctr1** = a 64-bit per-launch counter, incremented host-side after each kernel that consumes the RNG.
- **ctr0** = a 64-bit counter `gid + nthreads * localcounter`, varying inside the kernel: `gid` partitions across threads, `localcounter` increments per Philox call from that thread. This allows for over 2^32 threads with fewer Philox calls per thread, or over 2^32 Philox calls per thread with fewer threads without having a collision.
`ctr1` is also randomized when seeding from a `RandomDevice` to make collisions less likely.1 parent ec10cee commit d65ce69
1 file changed
Lines changed: 229 additions & 99 deletions
0 commit comments