mliap_interface module

Full Documentation for hippynn.interfaces.lammps_interface.mliap_interface module. Click here for a summary page.

Interface for creating LAMMPS MLIAP Unified models.

class MLIAPInterface(*args: Any, **kwargs: Any)[source]

Bases: MLIAPUnified

Class for creating ML-IAP Unified model based on hippynn graphs.

as_tensor(array)[source]
clear_runtime_variables()[source]
comms_backward_hook(module, grad_input, grad_output)[source]
Parameters:
  • module – Torch Module for Interaction Layer

  • grad_input – Gradient (of atom energies) with respect to inputs of forward, only features missing comms.

  • grad_output – list of arguments intercepted from module’s forward, missing ghost inputs

Return modded_grad_input:

Gradient with respect to inputs now with comms.

Invokes blocking MPI exchanges within LAMMPS to retrieve ghost inputs

The gradient with respect to the input features in grad_input contains contributions to gradients for other ranks within this rank’s ghosts and is missing contributions to this rank’s owned atoms on other ranks. After comms, modded_grad_input will have zero’ed out the ghosts (sent to other processors) and added gradient contributions from other rank’s ghosts into this rank’s owned atoms.

comms_forward_pre_hook(module, args)[source]
Parameters:
  • module – Torch Module for Interaction Layer

  • args – list of arguments intercepted from module’s forward, features input missing features in ghosts

Return modded_args:

list of arguments passed on to forward now with ghost inputs

Invokes blocking MPI exchanges within LAMMPS to retrieve ghost inputs

compute_descriptors(data)[source]
compute_forces(data)[source]
Parameters:

data – MLIAPData object (provided internally by lammps)

:return None This function writes results to the input data.

compute_gradients(data)[source]
empty_tensor(dimensions)[source]
install_lammps_comm_hooks()[source]
perform_setup()[source]
uninstall_hooks()[source]