hippynn icon indicating copy to clipboard operation
hippynn copied to clipboard

Using hippynn via mliap interface on CPU causes it to fail

Open wusatosi opened this issue 5 months ago • 5 comments

Using hippynn via mliap causes script to fail:

Setting up Verlet run ...
  Unit style    : metal
  Current step  : 0
  Time step     : 0.001
Traceback (most recent call last):
  File "mliap_unified_couple_kokkos.pyx", line 412, in mliap_unified_couple_kokkos.compute_forces_python_kokkos
  File "mliap_unified_couple_kokkos.pyx", line 394, in mliap_unified_couple_kokkos.MLIAPUnifiedInterfaceKokkos.compute_forces
  File "/home/bradwu/hippynn/hippynn/interfaces/lammps_interface/mliap_interface.py", line 86, in compute_forces
    data.eatoms = atom_energy.numpy().astype(np.double)
AttributeError: attribute 'eatoms' of 'mliap_unified_couple_kokkos.MLIAPDataPy' objects is not writable
ERROR: Running mliappy unified compute_forces failure. (src/KOKKOS/mliap_unified_kokkos.cpp:82)
Last command: run             10000

Which points to this if-else branch: https://github.com/lanl/hippynn/blob/f8ed7390beb8261c8eec75580c683f5121226b30/hippynn/interfaces/lammps_interface/mliap_interface.py#L84-L89

Known fixes (which we are unsure if is correct) is:

  1. Update line 86 to eatoms = atom_energy.numpy().astype(np.double)
  2. Remove the if return_device=='cpu' branch.

wusatosi avatar Jan 18 '24 17:01 wusatosi