Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

randperm not consistent with set seed #117

Open
vmgaribay opened this issue Sep 2, 2024 · 5 comments
Open

randperm not consistent with set seed #117

vmgaribay opened this issue Sep 2, 2024 · 5 comments

Comments

@vmgaribay
Copy link

vmgaribay commented Sep 2, 2024

I have noticed some small differences between reruns with the same seed. I am going to attempt to replace randperm with torch.rand(), which so far has not been a problem. Fingers crossed that this takes care of it.

@vmgaribay
Copy link
Author

vmgaribay commented Sep 2, 2024

Other note, when I tried:
gen = torch.Generator().set_state(torch.default_generator.get_state())
mask_edges = torch.randperm(upper_triangular.val.size()[0],generator=gen) < threshold
It almost worked, but it oscillated between two arrangements. Not sure if that is a clue as to the deeper issue.

@vmgaribay
Copy link
Author

initialization of the network and random_edge_noise appear not to be the problem. Search continues.

@vmgaribay
Copy link
Author

the torch.randint in line 20 of local_attachment_basic_homophily.py is fine. However, torch.rand for prob_tensor is not always consistent.

@vmgaribay
Copy link
Author

I have read on forums that this is an issue that may be due to the multithreading aspect of pytorch. I think I will give up. If anyone else has an idea, let me know.

@vmgaribay
Copy link
Author

vmgaribay commented Sep 2, 2024

Yeah, I tried it (setting threads and restoring them after rand stuff) anyway, and as anticipated, so slow. Obviously not a solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant