Closed mtsokol closed 6 months ago
I think that https://docs.julialang.org/en/v1/stdlib/Random/#Random.seed! should be able to seed the default_rng, but the stream of numbers it produces will not be the same across julia versions, right? I have no complaints with different RNGs, but I think the default rng is currently xoshiro. The challenge with rng is that often the generator changes with new updates. There's a StableRNG julia package with a stable random number generator across versions. I think we may simply want to avoid testing in a way that requires stability across versions.
You may need to call seed!(rng, 0)
instead of rng(0)
I don't expect stability across versions for sure. Only for consecutive runs.
You may need to call
seed!(rng, 0)
instead ofrng(0)
Sounds good to me - let me update the PR.
Hi @willow-ahrens @hameerabbasi,
I just noticed that
finch.random(..., random_state=...)
isn't providing reproducible tensors for a fixed random state.Should give the same result for multiple runs but it doesn't. I think the reason is that:
Also gives different results. The
default_rng
and underlyingTaskLocalRNG
(https://docs.julialang.org/en/v1/stdlib/Random/#Random.TaskLocalRNG) don't accept seed parameter (there could be at least a warning).In
finch-tensor
inrandom
we could replacedefault_rng
withXoshiro
as it supportsseed
parameter and provides reproducible runs:WDYT?