Hi, I am trying to run MACE neural-network potential via the MLIAP library. My system is a simple box of Al atoms at 300K, here’s my code:
units metal
atom_style atomic
atom_modify map yes
boundary p p p
newton on
variable inputfile string "uob/Al_wide_box.lmp"
variable outputfile1 string "lammps-output/Al_wide_minimize.data"
variable outputfile2 string "lammps-output/Al_wide_final.data"
variable modelfile string "models-uob/GPU_Models/BCC/mace01_64channel_stagetwo.model-mliap_lammps.pt"
read_data ${inputfile}
pair_style mliap unified ${modelfile} 0
pair_coeff * * Al
neighbor 1.0 bin
neigh_modify every 1 delay 5 check yes
fix nvt1 all nvt temp 300.0 300.0 1.0
timestep 0.001
thermo 1
run 1000
write_data ${outputfile2}
At run 1000
I get the following error:
Traceback (most recent call last):
File "mliap_unified_couple_kokkos.pyx", line 418, in mliap_unified_couple_kokkos.compute_forces_python_kokkos
File "mliap_unified_couple_kokkos.pyx", line 400, in mliap_unified_couple_kokkos.MLIAPUnifiedInterfaceKokkos.compute_forces
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/calculators/lammps_mliap_mace.py", line 160, in compute_forces
_, atom_energies, pair_forces = self.model(batch)
^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/calculators/lammps_mliap_mace.py", line 84, in forward
out = self.model(
^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/modules/models.py", line 418, in forward
node_feats, sc = interaction(
^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1751, in _wrapped_call_impl
return self._call_impl(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/nn/modules/module.py", line 1762, in _call_impl
return forward_call(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/modules/blocks.py", line 545, in forward
node_feats = self.handle_lammps(
^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/modules/blocks.py", line 355, in handle_lammps
node_feats = LAMMPS_MP.apply(node_feats, lammps_class)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/torch/autograd/function.py", line 575, in apply
return super().apply(*args, **kwargs) # type: ignore[misc]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/michele/mambaforge/envs/benchmark-mace/lib/python3.12/site-packages/mace/tools/utils.py", line 158, in forward
data.forward_exchange(feats, out, ctx.vec_len)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'mliap_unified_couple_kokkos.MLIAPDataPy' object has no attribute 'forward_exchange'
ERROR: Running mliappy unified compute_forces failure. (src/KOKKOS/mliap_unified_kokkos.cpp:82)
And I really have no clue what’s going on. I could not find anyone else having the same problem and I cannot really determine if it’s a MLAIP issue or a MACE issue (in the latter case I am preventively sorry for spamming on this forum).