Abstract
In recent years, machine learning potentials (MLPs) have become indispensable tools in physics, chemistry, and materials science, driving the development of software packages for molecular dynamics (MD) simulations and related applications. These packages, typically built on specific machine learning frameworks, such as TensorFlow, PyTorch, or JAX, face integration challenges when advanced applications demand communication across different frameworks. The previous TensorFlow-based implementation of the DeePMD-kit exemplified these limitations. In this work, we introduce DeePMD-kit version 3, a significant update featuring a multibackend framework that supports TensorFlow, PyTorch, JAX, and PaddlePaddle backends, and demonstrate the versatility of this architecture through the integration of other MLP packages and of differentiable molecular force fields. This architecture allows seamless back-end switching with minimal modifications, enabling users and developers to integrate DeePMD-kit with other packages using different machine learning frameworks. This innovation facilitates the development of more complex and interoperable workflows, paving the way for broader applications of MLPs in scientific research.
What Problem Does This Paper Address?
In the world of computational chemistry, Machine Learning Potentials (MLPs) have revolutionized how we simulate the movement of atoms. However, the field has been plagued by "framework lock-in." Most software packages are built on a single library—usually TensorFlow or PyTorch.
If a researcher wanted to use a state-of-the-art Graph Neural Network (GNN) built in PyTorch alongside a simulation engine optimized for TensorFlow, they faced a massive technical barrier. Maintaining separate versions of the same tool for different frameworks is inefficient for developers and frustrating for users. DeePMD-kit v3 addresses this by creating a "pluggable" architecture that works across all major AI ecosystems.
Methods
The authors introduced several architectural innovations to make this multi-backend support possible:
- The Array API: By using a standardized interface for array operations, the developers can write core logic once and have it function across different backends with minimal duplication.
- Metaprogramming: The team uses metaprogramming to automatically generate backend-specific classes from a reference implementation, ensuring consistency.
- The "Atomic Model" Component: A new abstraction that decomposes physical quantities (like total energy) into atomic contributions. This simplifies the calculation of forces and virials (stress) using the automatic differentiation capabilities native to each framework.
- Custom C++ Operators: To handle the complex communication required for GNNs (like the DPA-2 model) across multiple GPUs, they implemented customized operators using the Message Passing Interface (MPI).
- LLM-Assisted Porting: Interestingly, the authors highlight the use of Large Language Models (like DeepSeek R1) to help convert legacy code between backends, showcasing a modern approach to software maintenance.
Datasets and Benchmarks
The framework was evaluated using a liquid water system benchmark. This system was tested at various scales, ranging from small clusters of 192 atoms to massive simulations involving nearly 100,000 atoms. The models trained on these datasets included:
- DPA-1: A "Deep Potential with Attention" model (tested with and without attention layers).
- DPA-2: A more complex, state-of-the-art "Large Atomic Model."
Key Insights and Results
- No "One Backend to Rule Them All": The benchmarks reveal that the "best" framework depends entirely on the model and hardware. While JAX generally achieved the highest performance for computationally demanding models (DPA-1 with attention and DPA-2), TensorFlow (with model compression) remains the speed king for simpler ones like DPA-1 (L=0).
- Seamless Interoperability: Because of the new plugin system, DeePMD-kit can now act as a host for external models. For example, the
DeePMD-GNNpackage allows users to run PyTorch-based models like MACE within the DeePMD ecosystem. - Hessian Training Made Easy: Previous versions relied on custom TensorFlow operators that made calculating second-order derivatives (Hessians) difficult. The new backends use native auto-diff, making it much easier to train models on sophisticated properties like vibrational frequencies.
- Hardware Versatility: Benchmarks were provided for high-end enterprise cards (NVIDIA H100, A800) and consumer-grade hardware (RTX 4090), showing consistent relative performance across backends.
Limitations and Future Work
While v3 is a massive leap forward, some features are still framework-specific. Currently, only the DPA-1 (L=0) model supports model compression, and the TensorFlow backend does not yet support the newer DPA-2 model. Additionally, the PaddlePaddle backend is still under active development.
The authors plan to continue expanding the plugin system and optimizing the JAX and PyTorch backends to match or exceed the specialized optimizations previously only available in TensorFlow, ensuring the framework remains at the cutting edge of molecular simulation technology.
Summary updated