deepmodeling / deepmd-kit

A deep learning package for many-body potential energy representation and molecular dynamics
https://docs.deepmodeling.com/projects/deepmd/
GNU Lesser General Public License v3.0
1.41k stars 486 forks source link

[BUG] PT: in customized OPs, ensure input tensors have continuous memory #3910

Closed njzjz closed 1 week ago

njzjz commented 1 week ago

Our kernels assume the memory of input tensors is continuous. It seems the torch's autograd may return tensors with non-continuous memory. Need to call the contiguous method to ensure the memory is contiguous.

njzjz commented 1 week ago

xref: https://github.com/pytorch/pytorch/issues/64529#issuecomment-914917507