[XLA] Don't re-seed RNG on every call to HloEvaluator::Evaluate.
Some tests -- in particular, tests that do reductions and so invoke a small subcomputation many times -- invoke HloEvaluator::Evaluate() many times. Previously, each such invocation was creating an std::random_device. Creating std::random_device is very expensive -- it touches /dev/urandom and so on. This was creating a lot of overhead (25%+) in these tests. So instead, we do it only once, and do a simple atomic op to generate new seeds. PiperOrigin-RevId: 228963974
Loading
Please sign in to comment