DeePMD-kit v3: A Multiple-Backend Framework for Machine Learning Potentials

Jinzhe Zeng, Duo Zhang, Anyang Peng, Xiangyu Zhang, S Z He, Yan Wang, Xinzijian Liu, Hangrui Bi, Yifan Li, Chun Cai, Chengqian Zhang, Yiming Du, Jiaxin Zhu, Pinghui Mo, Zhengtao Huang, Qiyu Zeng, Shaochen Shi, Xuejian Qin, Zhaoxi Yu, Chenxing Luo, Ye Ding, Yun‐Pei Liu, Ruosong Shi, Zhenyu Wang, Sigbjørn Løland Bore, Junhan Chang, Zhe Deng, Zhaonan Ding, Siyuan Han, Wanrun Jiang, Guolin Ke, Zhaoqing Liu, Denghui Lu, Koki Muraoka, Hananeh Oliaei, Anurag Kumar Singh, Haohui Que, Weihong Xu, Zhangmancang Xu, Yong‐Bin Zhuang, Jiayu Dai, Timothy J. Giese, Weile Jia, Ben Bin Xu, Darrin M. York, Linfeng Zhang, Handong WangJournal of Chemical Theory and Computation 2025 · DOI

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.

The DeePMD-kit ecosystem, illustrating its integration with various machine learning frameworks, programming APIs, molecular dynamics engines, and workflows.

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.
Software architecture of DeePMD-kit v3, highlighting the new multiple-backend interfaces and the integration of PyTorch alongside the existing TensorFlow infrastructure.

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-GNN package 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

BibTeX
@article{zeng2025deepmd,
  author = {Jinzhe Zeng and Duo Zhang and Anyang Peng and Xiangyu Zhang and S Z He and Yan Wang and Xinzijian Liu and Hangrui Bi and Yifan Li and Chun Cai and Chengqian Zhang and Yiming Du and Jiaxin Zhu and Pinghui Mo and Zhengtao Huang and Qiyu Zeng and Shaochen Shi and Xuejian Qin and Zhaoxi Yu and Chenxing Luo and Ye Ding and Yun‐Pei Liu and Ruosong Shi and Zhenyu Wang and Sigbjørn Løland Bore and Junhan Chang and Zhe Deng and Zhaonan Ding and Siyuan Han and Wanrun Jiang and Guolin Ke and Zhaoqing Liu and Denghui Lu and Koki Muraoka and Hananeh Oliaei and Anurag Kumar Singh and Haohui Que and Weihong Xu and Zhangmancang Xu and Yong‐Bin Zhuang and Jiayu Dai and Timothy J. Giese and Weile Jia and Ben Bin Xu and Darrin M. York and Linfeng Zhang and Handong Wang},
  title = {{DeePMD-kit v3: A Multiple-Backend Framework for Machine Learning Potentials}},
  journal = {Journal of Chemical Theory and Computation},
  year = {2025},
  doi = {10.1021/acs.jctc.5c00340},
}
Figure