pytorch-hessian-eigenthings
pytorch-hessian-eigenthings copied to clipboard
Eigenvalue and eigenvector deviation with GPU hardware
I have observed that the eigenvalues and eigenvectors change marginally if the underlying GPU or memory configurations are different. How to fix this issue? I am using random seed value to reproduce the results, but the hardware configuration change does not guarantee the exact eigenvalues and eigenvectors. It is affecting the accuracy of the algorithm. Can someone please help? Thank you.
Only setting seed does not guarantee deterministic behaviour on GPU. Have you tried using torch.use_deterministic_algorithms
or torch.backends.cudnn.deterministic
. Here is an article about it just in case you haven't seen it https://pytorch.org/docs/stable/notes/randomness.html
Hi devansh20la,
I am already using the following:
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False