You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a side result from recent vectorization work, I discovered that XORWOW RNG dominates the memory bandwidth requirements of the neuron kernel when using simple point neuron models and stochasticity. There are two factors at play here:
Under the hood, XORWOW uses a fairly standard Marsaglia generator which is probably a sensible choice. However, it is one with 2^192 sequence length and corresponding 192 bit state space (64-bit seed, 64-bit subsequence and 64-bit offset). This is arguably excessive for our use case:
64-bit seed is excessive
GeNN has a 32-bit limit on number of neurons else where so subsequences is also excessive
Even if each neuron sampled the RNG 10x during a 0.1ms timestep, a 64-bit offset allows for millions of years of simulation
As well as the 192 bit of state, the curandStateXORWOW struct stores 160 bits of box muller transform state so values can be re-used between calls. There is no point keeping this between kernel launches.
2 can be solved trivially by not using the curand structure directly and will result in significant performance improvemnets. Moving away from a curand RNG would be slightly more annoying but, if we reduced seed to 32-bit, and sequence length and offset to 48-bit, we could drop down to an RNG with an 128-bit state space.
The text was updated successfully, but these errors were encountered:
As a side result from recent vectorization work, I discovered that XORWOW RNG dominates the memory bandwidth requirements of the neuron kernel when using simple point neuron models and stochasticity. There are two factors at play here:
curandStateXORWOW
struct stores 160 bits of box muller transform state so values can be re-used between calls. There is no point keeping this between kernel launches.2 can be solved trivially by not using the curand structure directly and will result in significant performance improvemnets. Moving away from a curand RNG would be slightly more annoying but, if we reduced seed to 32-bit, and sequence length and offset to 48-bit, we could drop down to an RNG with an 128-bit state space.
The text was updated successfully, but these errors were encountered: