Source-linked AI summary
DeePMD-kit v2: A software package for Deep Potential models
Jinzhe Zeng, Duo Zhang, Denghui Lu, Pinghui Mo, Zeyu Li, Yixiao Chen, Marián Rynik, Li'ang Huang, Ziyao Li, Shaochen Shi, Yingze Wang, Haotian Ye, Ping Tuo, Jiabin Yang, Ye Ding, Yifan Li, Davide Tisi, Qiyu Zeng, Han Bao, Yu Xia, Jiameng Huang, Koki Muraoka, Yibo Wang, Junhan Chang, Fengbo Yuan, Sigbjørn Løland Bore, Chun Cai, Yinnian Lin, Bo Wang, Jiayan Xu, Jia-Xin Zhu, Chenxing Luo, Yuzhi Zhang, Rhys E. A. Goodall, Wenshuo Liang, Anurag Kumar Singh, Sikai Yao, Jingchao Zhang, Renata Wentzcovitch, Jiequn Han, Jie Liu, Weile Jia, Darrin M. York, Weinan E, Roberto Car, Linfeng Zhang, Han Wang
TL;DR
DeePMD-kit has evolved substantially since its initial release, motivating an overview of its current major additions. The article presents these features and technical details, benchmarks model accuracy and efficiency, and reports that NVNMD is 50x-100x faster than regular MD.
Problem
DeePMD-kit has evolved significantly compared with its initial release, creating a need to characterize the current package.
Method
The article overviews DeePMD-kit’s major additions and technical details, benchmarks model accuracy and efficiency, and discusses ongoing developments.
Results
50x-100x faster than regular MD is the reported NVNMD performance for training and inference.
Takeaways & Limitations
DeePMD-kit supports simulations across a wide range of systems, including almost all periodic systems.
Abstract
from arXiv · showhide
DeePMD-kit is a powerful open-source software package that facilitates molecular dynamics simulations using machine learning potentials (MLP) known as Deep Potential (DP) models. This package, which was released in 2017, has been widely used in the fields of physics, chemistry, biology, and material science for studying atomistic systems. The current version of DeePMD-kit offers numerous advanced features such as DeepPot-SE, attention-based and hybrid descriptors, the ability to fit tensile properties, type embedding, model deviation, Deep Potential - Range Correction (DPRc), Deep Potential Long Range (DPLR), GPU support for customized operators, model compression, non-von Neumann molecular dynamics (NVNMD), and improved usability, including documentation, compiled binary packages, graphical user interfaces (GUI), and application programming interfaces (API). This article presents an overview of the current major version of the DeePMD-kit package, highlighting its features and technical details. Additionally, the article benchmarks the accuracy and efficiency of different models and discusses ongoing developments.
I. INTRODUCTION
DeePMD-kit is an open-source package for molecular dynamics with Deep Potential models, supporting broad atomistic applications and a rapidly expanding feature set. This article reviews its components, descriptors, fitting capabilities, usability improvements, and ongoing development.
- Scope and adoption: Deep Potential models in DeePMD-kit support atomistic simulations across physics, chemistry, biology, and material science.Applications include metallic and non-metallic inorganic materials, water, organic systems, solutions, gases, macromolecules, and interfaces.
- Scope and adoption: DeePMD-kit can simulate systems containing almost all periodic table elements across broad temperature and pressure ranges, including molecules, ions, transition states, and excited states.
- Major additions: Version 2.2.1 adds descriptors, tensorial-property fitting, type embedding, model deviation, long-range and range-correction methods, GPU operators, compression, and NVNMD.The listed descriptors include DeepPot-SE, attention-based, and hybrid variants.
- Major additions: The package also improves usability through documentation, compiled binary packages, graphical user interfaces, and application programming interfaces.Compiled binaries are intended to simplify installation and include integrations such as the LAMMPS plugin, i-PI driver, and GROMACS support.
- Article scope: The article presents DeePMD-kit components and technical details, benchmarks model accuracy and efficiency, and discusses ongoing developments.Components are organized as Python classes with corresponding TensorFlow static graphs created at runtime.
- Descriptors: DeepPot-SE is continuous through its second-order derivative, whereas the local frame descriptor is non-smooth at cutoff and neighbor-order exchanges.The paper recommends other descriptors when these local-frame limitations matter; three-body DeepPot-SE incorporates bond-angle information to improve accuracy.
2. Fitting networks
The fitting networks map descriptors to scalar, vector, or tensorial atomic properties, supporting potential energies, forces, virials, dipoles, and polarizabilities. Their outputs can incorporate atomic and frame-specific parameters and be shared across chemical species through type embedding.
- Fitting tensorial properties: The fitting network can predict potential energy together with force and virial properties, as well as tensorial properties such as dipole and polarizability.Tensorial models can calculate IR and Raman spectra.
- Fitting potential energies: The fitting network maps a descriptor to atomic potential-energy contributions, whose sum predicts the system's total potential energy.The scalar output can also represent other atomic scalar properties, such as partial charge.
- Fitting potential energies: The model derives atomic forces and the virial tensor from the potential energy E.The virial tensor applies when periodic boundary conditions are used.
- Fitting tensorial properties: First-order tensorial properties are represented by an M-dimensional vector output, while second-order properties use a separate M-dimensional vector output.The second-order formulation requires descriptors with the same or similar form as DeepPot-SE.
- Fitting tensorial properties: The total dipole or polarizability is computed as the sum of the corresponding atomic tensors.The total tensor T is defined from atomic tensor contributions.
- Handling multiple chemical species: Without type embedding, fitting-network parameters are chemical-species-wise; with type embedding, all species share network parameters and receive type information as input.Type embedding inserts the embedding into the fitting-network input, while atoms are sorted by chemical species for performance.
3. Deep Potential Range Correction (DPRc)
DPRc extends DeePMD-kit by correcting short- and mid-range non-bonded interactions through a range-correction scheme. It modifies the model to disable MM–MM interactions and supports broader similar-interaction applications.
- Motivation: DPRc was designed to correct potentials from fast, linear-scaling low-level semiempirical QM/MM theory toward high-level ab initio QM/MM theory.The correction targets short- and mid-range non-bonded interactions using non-bonded lists common in molecular dynamics force fields.
- Motivation: Long-range electrostatic interactions can be modeled efficiently with particle mesh Ewald or extensions for multipolar and QM/MM potentials.
- DPRc formulation: DPRc modifies the switch function to disable MM–MM interactions, ensuring that forces between MM atoms are zero.
- DPRc formulation: The fitting network is revised to remove energy bias from MM atoms.
- Scope: DPRc is not limited to its initial QM/MM correction design and can be expanded to similar interactions.
4. Deep Potential Long Range (DPLR)
DPLR augments the standard short-range Deep Potential energy with an electrostatic contribution modeled from Gaussian approximations of the system’s electronic structure. The resulting electrostatic approximation has an error dominated by dipole–quadrupole interactions that decay as r^-4.
- Model construction: DPLR adds electrostatic energy to the total energy of a separated dipole model.
- Model construction: The short-range contribution EDP uses the standard energy model and is fitted against E*−Eele.
- Electrostatics: Eele is calculated in Fourier space from Gaussian distributions approximating the system’s electronic structure.The Gaussian spread is controlled by the tunable parameter β, with L defining the Fourier-space cutoff.
- Electrostatics: The structure factor uses ion coordinates, ion charges, and Wannier centroids.
- Error behavior: r^-4 describes the decay of the dominant dipole–quadrupole contribution to the Gaussian-approximation error.
5. Interpolation with a pairwise potential
DeePMD-kit supports interpolation between a Deep Potential and an empirical pairwise potential for cases where atoms approach distances that make DFT calculations fail. The interpolation smoothly switches between the two descriptions over a specified distance range.
- Motivation: Radiation-damage simulations may encounter interatomic distances so small that DFT calculations fail.
- Motivation: The DP approximation is replaced by an empirical potential such as the Ziegler–Biersack–Littmark screened nuclear repulsion potential.
- Interpolation: DeePMD-kit supports interpolation between DP and an empirical pairwise potential.
- Interpolation: Within [ra, rb], the DP model switches off smoothly while the pairwise potential switches on.
- Interpolation: The pairwise potential is supplied by a user-defined table on an evenly discretized grid from zero to the cutoff distance.
- Neural networks and compression: The neural-network implementation supports multiple layer forms, several activation functions, and model compression techniques.Listed activations include tanh, ReLU, ReLU6, softplus, sigmoid, GELU, and identity; compression uses tabulated inference, operator merging, and precise neighbor indexing.
- Neural networks and compression: Operator merging avoids allocation of Gi and memory movement between register and host/device memories.
- Neural networks and compression: Precise neighbor indexing saves computational costs by avoiding multiplication involving padding zeros when neighbor counts are below the expected maximum.
B. Trainer
The DeePMD-kit trainer optimizes model parameters using a decaying learning rate and a weighted loss composed of fitting-property losses. These losses support frame and atomic properties, including energy, force, virial, and relative energy.
- Trainer design: The trainer defines model-parameter training, including weights and biases, together with the learning rate, loss function, and training process.
- Learning-rate schedule: The learning rate decays exponentially according to hyperparameters specifying the stopping step, stopping rate, and decay steps.
- Loss function: The total loss is a weighted sum of fitting-property losses.
- Loss function: Each fitting-property loss uses mean squared error with normalization by the number of atoms for frame properties.
- Loss function: Supported fitting properties include energy, force, virial, relative energy, or combinations of these properties.
- Loss function: Atomic-force losses can use atom-specific prefactors, while relative force losses can account for force magnitude.
3. Training process
The training process uses Adam to optimize task-specific losses, including a multi-task setup that shares descriptor parameters while retaining separate fitting networks. Model deviation estimates coverage and guides data expansion or active learning.
- Adam minimizes the loss during training, with a learning rate scheduled by a prescribed scheme and training stopped at hyperparameter τstop.τstop is usually set to several million steps.
- Multi-task training handles datasets representing properties that cannot be fitted in one network, such as calculations using different functionals or basis sets.
- All tasks share a trainable descriptor, while each task retains its own fitting network; a randomly selected task updates its parameters at each step.
- Fitting networks with the same architecture can share parameters of selected layers to improve training efficiency.
- Model deviation is the standard deviation of properties predicted by independently initialized ensemble models and can estimate error for a data frame.
- Small force model deviation indicates learned data, whereas larger deviation signals uncovered configurations requiring expanded training data; maximum force deviation is the best error indicator for active learning.
A. Code architecture
DeePMD-kit combines TensorFlow graph-based model definitions with independently built CPU and GPU libraries, APIs, and accelerated custom operators. Its architecture also includes a GPU-oriented neighbor-sorting procedure for environment construction.
- Code architecture: TensorFlow computational graphs combine operators and inputs, while Python model definitions organize operators and parameters into restorable inference graphs.
- Code architecture: The independently built core C++ library implements customized operators for atomic environments, neighbor lists, and compressed neural networks.
- Code architecture: Optional CUDA or ROCm GPU libraries accelerate customized operators on GPU devices and are independently built and tested.
- Code architecture: Python, C++, C, and header-only C++ APIs support inference, while the C API provides a more stable ABI and backward compatibility.
- Code architecture: Critical custom operators for atomic environments and tabulated embedding inference are parallelized with OpenMP, CUDA, and ROCm on CPUs and GPUs.
- Code architecture: Neighbor sorting orders atoms by type, distance, and index after compressing these values into a 64-bit integer S.S = αj × 10^15 + floor(rij × 10^8) × 10^5 + j.
2. MPI implementation for multi-device training and MD simulations
DeePMD-kit adds MPI-based support for multi-device training and molecular dynamics, while NVNMD addresses data-transfer bottlenecks with a non-von Neumann accelerator. The package also improves installation and usability through binaries, documentation, and automatic arguments.
- MPI implementation supports multi-device training and molecular dynamics to achieve faster performance and larger memory.
- Horovod distributes training batches across workers, which average trainable parameter gradients while avoiding batch-size and tensor-shape conflicts.
- NVNMD: More than 95% of time and energy can be consumed by DP-model inference, while over 90% may be wasted transferring data in von Neumann architectures.
- NVNMD: NVNMD uses a non-von Neumann chip containing processing and memory units to accelerate DP-model inference.
- NVNMD: On-chip model storage avoids intermediate-result transfers and repeated parameter loading from off-chip memory during calculation.
- NVNMD: NVNMD combines DP-model accuracy with NvN-chip computational efficiency.
- Usability: Compiled binary packages for Linux, macOS, and Windows let users install DeePMD-kit in a few minutes.
3. Input data
DeePMD-kit supports efficient binary data formats, multiple inference interfaces, third-party integrations, and extensibility through plugins. Its surrounding packages support data preparation, workflow execution, documentation, and broader scientific-computing collaboration.
- Input data: Training and testing accept NumPy binary and HDF5 files, which are designed for efficient parallel reading compared with text files.
- Input data: HDF5 stores multiple arrays in one file, simplifying transfer between machines, while DP-Data can generate training files from electronic-calculation outputs.
- Interfaces: Python, C++, C, and header-only C++ APIs expose inference to third-party software, including ASE, LAMMPS, i-PI, GROMACS, AMBER, OpenMM, and ABACUS.
- Interfaces: API integration lets researchers perform simulations and minimization without being restricted by DeePMD-kit’s software features and combine DP models with other potentials.
- Extensibility: The object-oriented plugin system allows developers to add customized components without modifying the DeePMD-kit package.
- Ecosystem: Related packages support DP-model workflows, including DP-GEN for concurrent learning, DP-Ti for thermodynamic integration, and DP-Dispatcher for HPC job management.
IV. BENCHMARKING
The benchmarking compares descriptor accuracy, training, and molecular-dynamics performance across multiple atomistic datasets, precisions, hardware platforms, and model variants. Results show trade-offs among accuracy, generalization, speed, memory, and descriptor applicability.
- None of the models outperforms the others in accuracy for all datasets.
- The local frame descriptor is fastest on CPUs, but it has not yet been implemented on GPUs.
- DeepPot-SE offers greater generalization in accuracy and performance, while compressed models are 1x-10x faster than original models for training and inference.
- NVNMD is 50x-100x faster than regular molecular dynamics.
- Attention-based models with type embedding improve HEA accuracy, retain equivalent dipeptide accuracy, and train faster on GPUs by reducing neural-network count.
- Attention-based descriptors use less CPU or GPU memory for many chemical species, supporting OC2M with over 60 species and SPICE with about 20 species.
- FP32 is 0.5x to 2x faster than FP64 with similar validation errors in nearly all systems.
V. SUMMARY
DeePMD-kit is a community-developed open-source package for molecular-dynamics simulations with machine-learning potentials. Its performance, usability, extensibility, and APIs support use across research fields and integration with other simulation packages.
- DeePMD-kit is a community-developed open-source package for molecular-dynamics simulations using machine-learning potentials.
- Its performance, usability, and extensibility have made it popular among researchers in various fields.
- The LGPL-3.0 license allows users to use, modify, and extend the software freely.
- Object-oriented Python modules, computing graphs, TensorFlow, and customized operators support model addition and optimization.
- Rich and flexible APIs make DeePMD-kit easier to integrate with other molecular-simulation packages.
- The package, datasets, models, simulation systems, and benchmarking scripts are openly hosted through GitHub repositories.