I’m very new to PyTorch, coming at it from playing with Stable Diffusion. A couple of days ago I noticed that I was no longer able to reproduce SD output on my laptop that I was getting in Google Colab, despite using the same seed and other parameters. Furthermore and confusingly, this appears to have changed on my laptop somehow: an image I was previously able to reproduce now looks different when I generate it locally.
I’ve tracked down the difference to the output of torch.randn(N, device=cuda)
. Locally vs on Colab, the sequence begins to diverge after N=10240. That is, every value from index 0…10239 is identical. Value at index 10240 is different, and from there on the sequence diverges.
Is this expected or unusual? Are there any obvious reasons why this would suddenly change without any known change to my hardware or software? I have since upgraded my drivers to the latest and am still getting the (same) diverging output.
To verify I used the following small script:
import torch
cuda = torch.device("cuda")
torch.manual_seed(12345)
torch.randn(10241, device=cuda)
Locally this outputs:
tensor([ 0.5786, -0.5248, -0.2919, ..., -0.2040, -1.8688, 0.2480],
device='cuda:0')
On Colab (note the last element is different):
tensor([ 0.5786, -0.5248, -0.2919, ..., -0.2040, -1.8688, -0.1346],
device='cuda:0')
I’m running Windows 10 x64, GeForce GTX 950M, Core i7-6700HQ.