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

Fix neighbourlist gradient calculation on CPU #91

Merged
merged 2 commits into from
Mar 8, 2023
Merged

Conversation

sef43
Copy link
Contributor

@sef43 sef43 commented Mar 7, 2023

This aims to fix #84

Adding distances.clone() (copying the existing deltas.clone()) stops autograd complaining about the in-place operation when using pytorch==1.13.

Also changed the test_neighbor_grad test so that it runs on CPU and GPU separately (so it can run on Github Actions CI) and compares the NNPOps gradients with reference gradients calculated using pytorch autograd.

@raimis
Copy link
Contributor

raimis commented Mar 8, 2023

@sef43 is this ready for review?

@sef43
Copy link
Contributor Author

sef43 commented Mar 8, 2023

@sef43 is this ready for review?

yes thanks

@raimis raimis requested review from raimis and peastman March 8, 2023 10:08
Copy link
Contributor

@raimis raimis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks for improving the test.

@raimis raimis merged commit 293d908 into openmm:master Mar 8, 2023
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

Successfully merging this pull request may close these issues.

TestNeighbors.py failures with pytorch 1.13
3 participants