Hi!
Upgrading PyTorch to newer one (2.8 => 2.12), I noticed that some of the models became non-deterministic.
After some debugging, searching through the code etc I found this PR: reland D89141291 add fused compute_grad_weight kernel when segments are few but large (landed in PyTorch 2.11 if I got it right)
From my understanding of it, after this, nn.Embedding backwards path became non-deterministic in some cases (depending on shapes).
A couple of questions that I’m trying to figure out:
- Is it overall an expected change in terms of determinism?
- Is it expected to have some detailed toggle for it in the future releases? Does it make sense opening an issue/PR for it? Right now it seems like it’s only can be disabled by the overall
torch.use_deterministic_algorithms(true), which also impacts a lot of other algorithms - Should it be documented in torch.use_deterministic_algorithms? It isn’t mentioned there right now.