I am trying to refactor an application and testing new against old version by comparing outputs. At the first pytorch conv layer using identical input I get identical output when using CPU. However using cuda on GPU the output tensors differ in the 5th decimal place on some cells. Is there any way to eliminate this difference? I am already setting:
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.backends.cudnn.deterministic = True
cpu and gpu can't produce the same result even if the seeds are set equal. Refer to this and this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With