PyTorch finally ships stateless RNG API after years of userland workarounds

ezyang · x · 2026-11-17

PyTorch core dev Edward Yang reveals the long-standing RNG reproducibility problem was never fixed upstream, leaving users with bodgy userland workarounds. Inspired by giffmana's push for stateless RNG and JAX's API design, jbschlosser finally implemented a stateless RNG API.

The thread revisits why earlier fixes stalled: they required carefully reconstructing the exact sampling process, and even a one-time BC break would still ideally require user code changes.

Original post →

More from coding & agent

coding & agent channel →