Does Julia have any utility to "split" RNGs for later use in parallel?

Thanks, I looked at the Julia source and didn’t find “jump” per-se, but did stumble on forkRand which seems to be doing a kind of simple thing which I suppose could be used to implement my split_rng as:

function split_rng(rng::Xoshiro, N)
    map(Random.XoshiroSimd.forkRand(rng, Val(N))...) do si...
        Xoshiro((s.value for s in si)...)
    end
end

And thanks for the links @ToucheSir I couldn’t quiclky get an implementation of exactly the thing I wanted out of that but yea if those have the same RNGs Jax uses then surely its possible to split them the same too.

Anyway, I’m taking all this to mean that there’s no unified API for splitting (would be nice to have!) but that its possible to hack together something specific as needed.

1 Like