4.7. Descriptor DPA3
#
Note
Supported backends: PyTorch , JAX
, DP
DPA3 is an advanced interatomic potential leveraging the message passing architecture. Designed as a large atomic model (LAM), DPA3 is tailored to integrate and simultaneously train on datasets from various disciplines, encompassing diverse chemical and materials systems across different research domains. Its model design ensures exceptional fitting accuracy and robust generalization both within and beyond the training domain. Furthermore, DPA3 maintains energy conservation and respects the physical symmetries of the potential energy surface, making it a dependable tool for a wide range of scientific applications.
Reference: DPA3 paper.
Training example: examples/water/dpa3/input_torch.json.
4.7.1. Hyperparameter tests#
We systematically conducted DPA3 training on six representative DFT datasets (available at AIS-Square): metallic systems (Alloy, AlMgCu, W), covalent material (Boron), molecular system (Drug), and liquid water (Water). Under consistent training conditions (0.5M training steps, batch_size “auto:128”), we rigorously evaluated the impacts of some critical hyperparameters on validation accuracy.
The comparative analysis focused on average RMSEs (Root Mean Square Error) for both energy, force and virial predictions across all six systems, with results tabulated below to guide scenario-specific hyperparameter selection:
Model | comment | nlayers | n_dim | e_dim | a_dim | e_sel | a_sel | start_lr | stop_lr | loss prefactors | rmse_e (meV/atom) | rmse_f (meV/Å) | rmse_v (meV/atom) | Training wall time (h) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DPA3-L3 | Default | 3 | 256 | 128 | 32 | 120 | 30 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 5.74 | 85.4 | 43.1 | 9.8 |
Small dimension | 3 | 128 | 64 | 32 | 120 | 30 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 6.99 | 93.6 | 46.7 | 8.0 | |
Large sel | 3 | 256 | 128 | 32 | 154 | 48 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 5.70 | 83.7 | 43.4 | 14.1 | |
DPA3-L6 | Default | 6 | 256 | 128 | 32 | 120 | 30 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 4.85 | 79.9 | 39.7 | 19.2 |
Small dimension | 6 | 128 | 64 | 32 | 120 | 30 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 5.11 | 77.7 | 41.2 | 14.1 | |
Large sel | 6 | 256 | 128 | 32 | 154 | 48 | 1e-3 | 3e-5 | 0.2|20, 100|60, 0.02|1 | 4.76 | 78.4 | 40.2 | 31.8 | |
DPA2-L6 (medium) | Default | 6 | - | - | - | - | - | 1e-3 | 3.51e-08 | 0.02|1, 1000|1, 0.02|1 | 12.12 | 109.3 | 83.1 | 12.2 |
The loss prefactors (0.2|20, 100|60, 0.02|1) correspond to (start_pref_e|limit_pref_e, start_pref_f|limit_pref_f, start_pref_v|limit_pref_v) respectively. Virial RMSEs were averaged exclusively for systems containing virial labels (Alloy, AlMgCu, W, and Boron).
Note that we set float32 in all DPA3 models, while float64 in other models by default.
4.7.2. Requirements of installation from source code
#
To run the DPA3 model on LAMMPS via source code installation (users can skip this step if using easy installation), the custom OP library for Python interface integration must be compiled and linked during the model freezing process.
The customized OP library for the Python interface can be installed by setting environment variable DP_ENABLE_PYTORCH to 1 during installation.
If one runs LAMMPS with MPI, the customized OP library for the C++ interface should be compiled against the same MPI library as the runtime MPI. If one runs LAMMPS with MPI and CUDA devices, it is recommended to compile the customized OP library for the C++ interface with a CUDA-Aware MPI library and CUDA, otherwise the communication between GPU cards falls back to the slower CPU implementation.
The customized OP library for the Python interface can be installed by
cd deepmd-kit/source/op/pd
python setup.py install
If one runs LAMMPS with MPI, the customized OP library for the C++ interface should be compiled against the same MPI library as the runtime MPI. If one runs LAMMPS with MPI and CUDA devices, it is recommended to compile the customized OP library for the C++ interface with a CUDA-Aware MPI library and CUDA, otherwise the communication between GPU cards falls back to the slower CPU implementation.
4.7.3. Limitations of the JAX backend with LAMMPS
#
When using the JAX backend, 2 or more MPI ranks are not supported. One must set map to yes using the atom_modify command.
atom_modify map yes
See the example examples/water/lmp/jax_dpa.lammps.
4.7.4. Data format#
DPA3 supports both the standard data format and the mixed type data format.
4.7.5. Type embedding#
Type embedding is within this descriptor with the same dimension as the node embedding: n_dim argument.
4.7.6. Model compression#
Model compression is not supported in this descriptor.