mir-group / pair_allegro

LAMMPS pair style for Allegro deep learning interatomic potentials with parallelization support
https://www.nature.com/articles/s41467-023-36329-y
MIT License
33 stars 8 forks source link

Exception: expected scalar type Double but found Float #48

Open peterTHC opened 3 days ago

peterTHC commented 3 days ago

Hi,

I was trying to use pair_allegro to run a simulation on LAMMPS. I have trained a model with 256 water molecules (trained with forces and energy). After I compiled my LAMMPS, I got this error and not able to run. I had an older version of pair_allegro and that works (seems like a file about a year ago). Do you know if there is any output type from my torch that is incorrect? (I am using CUDA 11.6 and torch 1.12.0.)

Here's the full error I got from LAMMPS: Exception: expected scalar type Double but found Float Exception raised from data_ptr at aten/src/ATen/core/TensorMethods.cpp:20 (most recent call first): frame #0: c10::Error::Error(c10::SourceLocation, std::string) + 0x42 (0x2ab7c7d06612 in /scratch/user/peterchao1/.conda/envs/allegro/lib/python3.7/site-packages/torch/lib/libc10.so) frame #1: c10::detail::torchCheckFail(char const, char const, unsigned int, std::string const&) + 0x5b (0x2ab7c7d02cab in /scratch/user/peterchao1/.conda/envs/allegro/lib/python3.7/site-packages/torch/lib/libc10.so) frame #2: double* at::TensorBase::data_ptr() const + 0x108 (0x2ab7815981c8 in /scratch/user/peterchao1/.conda/envs/allegro/lib/python3.7/site-packages/torch/lib/libtorch_cpu.so) frame #3: at::TensorAccessor<double, 2ul, at::DefaultPtrTraits, long> at::TensorBase::accessor<double, 2ul>() const & + 0x7d (0x6ab8ad in ../../lammps/build/lmp) frame #4: ../../lammps/build/lmp() [0x925095] frame #5: ../../lammps/build/lmp() [0x4ec0f6] frame #6: ../../lammps/build/lmp() [0x4ee627] frame #7: ../../lammps/build/lmp() [0x48b4f0] frame #8: ../../lammps/build/lmp() [0x48b886] frame #9: ../../lammps/build/lmp() [0x47acbd] frame #10: __libc_start_main + 0xf5 (0x2ab7c819a555 in /lib64/libc.so.6) frame #11: ../../lammps/build/lmp() [0x47c8d0]

If you need any further information, please let me know.

Thank you!

Linux-cpp-lisp commented 3 days ago

If your model is older, you may need to use pair_style allegro3232.

I recommend upgrading to the most recent nequip (0.6.0) moving forward however.