EnzymeAD / Enzyme.jl

Julia bindings for the Enzyme automatic differentiator
https://enzyme.mit.edu
MIT License
428 stars 59 forks source link

EnzymeTestUtils nondeterminstic failure #1397

Closed wsmoses closed 3 months ago

wsmoses commented 3 months ago

@sethaxen I'm seeing CI nondeeterminstically fail for EnzymeTestUtils as in https://github.com/EnzymeAD/Enzyme.jl/actions/runs/8767212680/job/24060205716?pr=1371

can we set a seed or something always?

sethaxen commented 3 months ago

Yeah, makes sense. IIRC test set always uses the global rng state without modifying it, so setting the seed once before evaluating any tests would fix this.

wsmoses commented 3 months ago

I guess there's two things here: 1) presumably we can just set a fixed seed in runtests 2) should we make the test functions take a seed?

sethaxen commented 3 months ago
2. should we make the test functions take a seed?

We could have the test functions take an rng, defaulting to Random.default_rng(). I don't really know when someone would want to change the RNG, but at least it would be possible. That's preferable to a seed.