Description
DPA4-Beta is trained using a multitask strategy on the modified OpenLAM datasets V2, same as DPA-3.3-1M.
Benchmark Results
Wiggle150
| Model | MAE (kcal/mol) β | RMSE (kcal/mol) β |
|---|---|---|
| DPA-3.1-3M | 1.722 | 2.239 |
| DPA-3.2-5M | 1.192 | 1.543 |
| DPA-3.3-1M | 1.527 | 2.067 |
| DPA4-Beta | 1.064 | 1.387 |
TorsionNet-500
| Model | MAE (kcal/mol) β | MAEB (kcal/mol) β | NABH β |
|---|---|---|---|
| DPA-3.1-3M | 0.338 | 0.551 | 76 |
| DPA-3.2-5M | 0.295 | 0.466 | 50 |
| DPA-3.3-1M | 0.324 | 0.503 | 54 |
| DPA4-Beta | 0.191 | 0.306 | 19 |
PhononMDR
| Model | MAE Ο_max β | MAE S β | MAE F β | MAE Cv β |
|---|---|---|---|---|
| DPA-3.1-3M | 13.24 | 13.06 | 4.03 | 3.88 |
| DPA-3.2-5M | 11.97 | 11.57 | 3.60 | 3.25 |
| DPA-3.3-1M | 15.87 | 15.01 | 4.81 | 4.73 |
| DPA4-Beta | 38.12 | 15.44 | 3.51 | 6.48 |
OC20NEB
| Model | MAE Ea (eV) β | MAE dE (eV) β | Ο_Transfer β | Ο_Dissociation β | Ο_Desorption β |
|---|---|---|---|---|---|
| DPA-3.1-3M | 1.172 | 0.158 | 65.1 | 69.0 | 59.8 |
| DPA-3.2-5M | 1.183 | 0.164 | 69.7 | 75.3 | 63.0 |
| DPA-3.3-1M | 1.098 | 0.109 | 44.0 | 49.4 | 29.9 |
| DPA4-Beta | 1.047 | 0.064 | 16.6 | 17.7 | 11.0 |
Inference throuput
How to use
Installation
DPA4/SeZM is available in the DeePMD-kit main branch (version 3.2.0). Install the latest code together with PyTorch 2.11 and CUDA 12.8:
pip install torch
pip install git+https://github.com/deepmodeling/deepmd-kit
For offline or backend-specific installation, see the
DeePMD-kit installation guide.
The compiled inference path (DP_COMPILE_INFER) additionally requires
torch >= 2.11 and CUDA >= 12.6.
Direct Inference
The pretrained model can be used directly for prediction tasks, such as serving as an ASE calculator.
This model is pretrained in a multi-task manner, featuring a unified backbone (referred to as the unified descriptor and the unified fitting net) and an dataset encoding vector for different tasks. For detailed information, refer to the DPA-3 paper.
The first step involves selecting a specific dataset id from the model to make predictions. To list the available fitting nets (model-branch) in this pretrained model, use the following command:
dp --pt show DPA4-Beta.pt model-branch
This will generate an output similar to the following:
Available model branches are ['Domains_Alloy', 'Domains_Anode', 'Domains_Cluster', 'Domains_FerroEle',
'Domains_SSE_PBE', 'Domains_SemiCond', 'H2O_H2O_PD', 'Metals_AlMgCu', 'Metals_AgAu_PBED3', 'Others_In2Se3',
'MPGen_OpenCSP', 'Alloy_APEX', 'SSE_ABACUS', 'Hybrid_Perovskite', 'Electrolyte', 'ODAC23', 'Alex2D', 'Omat24',
'OC20M', 'OC22', 'Organic_Reactions', 'OMol25', 'MPTrj', 'RANDOM'], where 'RANDOM' means using a randomly
initialized fitting net.
+-------------------+---------------------------+--------------------------------+--------------------------------+
| Model Branch | Alias | description | observed_type |
+-------------------+---------------------------+--------------------------------+--------------------------------+
| OMat24 | Default, Materials, | OMat24 is a large-scale open | ['H', 'He', 'Li', 'Be', 'B', |
| | Omat24, materials, omat24 | dataset containing over 110 | 'C', 'N', 'O', 'F', 'Ne', |
| | | million DFT calculations | 'Na', 'Mg', 'Al', 'Si', 'P', |
| | | spanning diverse structures | 'S', 'Cl', 'Ar', 'K', 'Ca', |
| | | and compositions. It is | 'Sc', 'Ti', 'V', 'Cr', 'Mn', |
| | | designed to support AI-driven | 'Fe', 'Co', 'Ni', 'Cu', 'Zn', |
| | | materials discovery by | 'Ga', 'Ge', 'As', 'Se', 'Br', |
| | | providing broad and deep | 'Kr', 'Rb', 'Sr', 'Y', 'Zr', |
| | | coverage of chemical space. | 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', |
| | | | 'Pd', 'Ag', 'Cd', 'In', 'Sn', |
| | | | 'Sb', 'Te', 'I', 'Xe', 'Cs', |
| | | | 'Ba', 'La', 'Ce', 'Pr', 'Nd', |
| | | | 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', |
| | | | 'Dy', 'Ho', 'Er', 'Tm', 'Yb', |
| | | | 'Lu', 'Hf', 'Ta', 'W', 'Re', |
| | | | 'Os', 'Ir', 'Pt', 'Au', 'Hg', |
| | | | 'Tl', 'Pb', 'Bi', 'Ac', 'Th', |
| | | | 'Pa', 'U', 'Np', 'Pu'] |
+-------------------+---------------------------+--------------------------------+--------------------------------+
Together with the available branch list, a table containing detailed information of each branch is provided. Select a model branch that closely matches your system. Ensure that the elements in your system are included in the corresponding task if you are conducting direct predictions or simulations. For more information on the pretrained datasets, refer to OpenLAM datasets V2.
*Note: If you are unsure which model branch to use, we recommend starting with Omat24, which performs well across a wide range of systems, including inorganic materials, catalytic systems, and molecular systems. If the accuracy of the Omat24 branch does not meet your needs for catalytic applications, consider trying the OC20M branch. For molecular systems, we recommend the OMol25 branch. For 2D inorganic materials, we recommend the Alex2D branch, and for inorganic materials under high pressure, the MPGen_OpenCSP branch. For alloy systems, we recommend the Alloy_APEX branch. *
Assuming you choose OMol25, you can first freeze the model branch from the multi-task pretrained model:
dp --pt freeze -c DPA4-Beta.pt -o frozen_model --model-branch OMol25
The PyTorch backend detects DPA4/SeZM and writes frozen_model.pt2. The .pt2
is an AOTInductor archive and is target-specific: it depends on the host
CPU/GPU, the GPU compute capability, and the libtorch version. Freeze on the
target machine rather than reusing a .pt2 across different hardware.
Inference precision is fixed at freeze time. The .pt2 is a forward-only
AOTInductor package, so the SO(2)-rotation kernel and matmul precision are
compiled into the graph at export and are not re-evaluated when the file is
later loaded by ASE or LAMMPS. Set the relevant environment variables before
running dp --pt freeze:
| Variable | Default | Effect |
|---|---|---|
DP_TF32_INFER |
0 (highest) |
float32 matmul precision:0 highest, 1 high, 2 medium. Keep 0 for MD and other PES-smoothness-sensitive workflows. |
DP_TRITON_INFER |
0 |
Opt-in fused Triton inference kernels (CUDA), cumulative:0 off; 1 universal kernels; 2 adds table-tuned SO(2) value-path kernels; 3 adds fp16 tensor-core mixing GEMMs. Levels 0β2 keep full float32 accumulation; 3's accuracy impact is negligible (it does not affect even second-order PES smoothness) and gives a large speedup on GPUs with strong tensor cores. |
Accepted boolean values: 1/true/yes/on and 0/false/no/off.
Then you can use the following Python code for prediction or optimization:
## Compute potential energy
from ase.build import molecule
from deepmd.calculator import DP as DPCalculator
dp = DPCalculator("frozen_model.pt2")
singlet = molecule("CH2_s1A1d")
#To set the total charge and spin multiplicity of a structure,
#update charge_spin as [charge, multiplicity]. The default is [0, 1].
singlet.info.update({"charge_spin": [0, 1]})
singlet.calc = dp
print(singlet.get_potential_energy())
print(singlet.get_forces())
## Run BFGS structure optimization
from ase.optimize import BFGS
dyn = BFGS(singlet)
dyn.run(fmax=1e-6)
print(singlet.get_positions())
Zero-Shot Inference
Given that energy labels calculated via DFT can vary by an arbitrary constant, LAMs are consistently used to predict the energy difference between the label and a dummy model that estimates potential energy solely based on the chemical formula. Specifically, the dummy model is defined as
$\qquad E = \sum_e n_{e} \times \hat{b}_e$;
where $E$ is the predicted energy, $n_{e}$ is the number of atoms of element $e$, and $\hat{b}_e$ is the per-atom energy of element $e$ obtained via least-squares fitting:
$ \qquad \hat{b} = \arg\min \sum_i \left( y_i - \sum_e n_{i,e}, b_e \right)^2$,
with $n_{i,e}$ denoting the number of atoms of element $e$ in sample $i$, and $y_i$ the corresponding DFT energy label. When applying the pretrained model to a new downstream system, it is advisable to adjust the energy bias term to better align with the DFT energy labels of the downstream system. This adjustment can enhance prediction accuracy without necessitating further training of the neural network parameters.
To be specific, given a new downstream system, we use dp --pt change-bias to do zero-shot procedure, which will inherit the neural network parameters of the pretrained multitask model, but updating the energy bias to better align with the downstream system.
dp --pt change-bias DPA4-Beta.pt -s <your_system> --model-branch OMat24
Fine-tuning
To fine-tune a pretrained model, you need to ensure that the model configuration (model/descriptor and model/fitting_net) matches exactly with the pretrained model. The input_finetune.json file provided on this page contains the same model configuration as the pretrained model.
To prepare for fine-tuning, replace the model/type_map and training/training(validation)_data sections in input_finetune.json with your specific dataset information, just the same as from scratch. Additionally, adjust the learning rate for fine-tuning, typically a small learning rate such as 1e-4 for learning_rate/start_lr is recommended. One can inherit a pretrained fitting net by using the --model-branch argument.
dp --pt train input_finetune.json --finetune DPA4-Beta.pt --model-branch OMat24

