openmm / NNPOps

High-performance operations for neural network potentials
Other
79 stars 17 forks source link

Fix neighbourlist gradient calculation on CPU #91

Closed sef43 closed 1 year ago

sef43 commented 1 year ago

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 commented 1 year ago

@sef43 is this ready for review?

sef43 commented 1 year ago

@sef43 is this ready for review?

yes thanks