Skip to content

Releases: deepmodeling/deepmd-kit

v3.1.2

12 Dec 10:39
d798b33

Choose a tag to compare

Today marks the 8th birthday of the deepmodeling/deepmd-kit repository!

What's Changed

New features

  • feat(pt): add compression support for se_e3_tebd by @OutisLi in #4992
  • feat: Enhance process_systems to recursively search all paths in systems list by @OutisLi in #5033
  • feat(pt): type embedding can still be compress even if attn_layer != 0 by @OutisLi in #5066
  • feat(pt): Implement type embedding compression for se_atten by @OutisLi in #5057
  • feat(pt): Implement type embedding compression for se_e3_tebd by @OutisLi in #5059
  • feat(pt): Add support for SiLU activation function in gradient calculations by @OutisLi in #5055

Bugfix

  • fix: bump CMake minimum version to 3.25.2 by @Copilot in #5001
  • fix(cmake): improve CUDA C++ standard for compatibility with gcc-14 by @njzjz in #5036
  • fix: optimize atom type mapping by @OutisLi in #5043
  • fix(finetune): calculate fitting stat when using random fitting in finetuning process by @Chengqian-Zhang in #4928
  • fix(stat): Caculate correct fitting stat when using default fparam and using share fitting. by @Chengqian-Zhang in #5038
  • fix: set multiprocessing start method to 'fork' in pt env (since python3.14 defaults to forkserver) by @OutisLi in #5019
  • fix(jax): fix compatibility with flax 0.12 by @njzjz in #5067
  • Fix: model_output_type unify name by @anyangml in #5069
  • fix(pd): adapting code for hardware compatibility by @HydrogenSulfate in #5047

Enhancement

  • build: bump LAMMPS version to stable_22Jul2025_update2 by @Copilot in #5052
  • feat:support CUDA 13.0+ by @OutisLi in #5017
  • perf: accelerate data loading in training by @OutisLi in #5023
  • fix: remove hessian outdef if not necessary by @iProzd in #5045
  • feat: Performance Optimization: Data Loading and Statistics Acceleration by @OutisLi in #5040
  • build(deps-dev): update scikit-build-core requirement from !=0.6.0,<0.11,>=0.5 to >=0.5,!=0.6.0,<0.12 by @dependabot[bot] in #5076

Documentation

CI/CD

  • feat(pt/test): add unit test for the compression of se_e3_tebd by @OutisLi in #5060
  • test(common): add regression for atom type remap by @OutisLi in #5050
  • CI: stop running Horovod tests by @njzjz in #5079
  • build(deps): bump pypa/cibuildwheel from 3.1 to 3.2 by @dependabot[bot] in #4996
  • CI: Replace the macos-13 images with the macos-15-intel images by @njzjz in #5002
  • build(deps): bump github/codeql-action from 3 to 4 by @dependabot[bot] in #5011
  • build(deps): bump astral-sh/setup-uv from 6 to 7 by @dependabot[bot] in #5012
  • build(deps): bump actions/download-artifact from 5 to 6 by @dependabot[bot] in #5025
  • build(deps): bump actions/upload-artifact from 4 to 5 by @dependabot[bot] in #5026
  • test: add TensorFlow graph reset in teardown method for entrypoint tests and bias standard tests by @OutisLi in #5049
  • feat(test): add unit test for the compression of se_atten by @OutisLi in #5058
  • build(deps): bump actions/checkout from 5 to 6 by @dependabot[bot] in #5063
  • build(deps): bump pypa/cibuildwheel from 3.2 to 3.3 by @dependabot[bot] in #5064
  • chore: manage CI pinnings in pyproject.toml by @njzjz in #5068
  • CI: configure dependabot to bump Python deps by @njzjz in #5072
  • CI: pin cibuildwheel TF/PT deps to global pinnings by @njzjz in #5071
  • CI: free disk in package_c workflow by @njzjz in #5081
  • build(deps-dev): update torch requirement from ~=2.7.0 to >=2.7,<2.9 by @dependabot[bot] in #5075
  • build(deps-dev): update tensorflow-cpu requirement from ~=2.18.0 to >=2.18,<2.21 by @dependabot[bot] in #5074

Full Changelog: v3.1.1...v3.1.2

v3.1.1

30 Sep 18:02
bfa6245

Choose a tag to compare

What's Changed

New features

  • feat(pt): add observed-type option for dp show by @iProzd in #4820
  • feat(pt): add Mean absolute percentage error (MAPE) loss for prop. pred. by @SchrodingersCattt in #4854
  • feat: Add eval-desc CLI command for descriptor evaluation with 3D output format by @Copilot in #4903
  • feat(tf): implement change-bias command by @Copilot in #4927
  • feat: add PyTorch profiler support to LAMMPS MD by @caic99 in #4969
  • pd(feat): support python inference with DP class by @HydrogenSulfate in #4987
  • Feat: support fparam/aparam in dp calculator by @anyangml in #4819
  • pd: support dpa3 dynamic shape for pd backend by @HydrogenSulfate in #4828
  • feat(pt): add hook to last fitting layer output by @iProzd in #4789
  • feat(pd): support dpa2/dpa3 C++ inference by @HydrogenSulfate in #4870
  • feat(pt): support zbl finetune by @iProzd in #4849
  • feat: add yaml input file support by @caic99 in #4894
  • feat(pd): support gradient accumulation by @HydrogenSulfate in #4920
  • feat(pt): add model branch alias by @iProzd in #4883
  • feat: handle masked forces in test by @caic99 in #4893
  • feat: support using train/valid data from input.json for dp test by @caic99 in #4859
  • feat(infer): add get_model method to DeepEval for accessing backend-specific model instances by @Copilot in #4931
  • feat(dp/pt): add default_fparam by @iProzd in #4888
  • feat(pt): implement DeepTensorPT by @Copilot in #4937

Enhancements

  • pd: add flag CINN_ALLOW_DYNAMIC_SHAPE for better performance with dynamic shape by @HydrogenSulfate in #4826
  • refactor(training): Average training loss for smoother and more representative logging by @OutisLi in #4850
  • chore: bump LAMMPS to stable_22Jul2025 by @njzjz in #4861
  • style: add comprehensive type hints to core modules excluding backends and tests by @Copilot in #4936
  • chore(deps): bump LAMMPS to stable_22Jul2025_update1 by @njzjz in #4955
  • perf: use contiguous memory stride for edge/angle indices by @caic99 in #4804
  • pd: support different label_dict in CINN by @HydrogenSulfate in #4795
  • pd: update loc_mapping for dpa3 in paddle backend by @HydrogenSulfate in #4797
  • style: complete type annotation enforcement for deepmd.pt by @Copilot in #4943
  • style(jax): enable ANN rule and add comprehensive type hints to JAX backend by @Copilot in #4967
  • perf: fix cuda-aware mpi in v3 by @caic99 in #4977

Documentation

  • doc: fix inconsistency between the docstring and the implementation of argument auto_batch_size of DeepEval with paddle and pytorch backend by @A-LOST-WAPITI in #4865
  • docs: add docs about LAMMPS D3 dispersion by @njzjz in #4875
  • doc(pd): update paddle installation scripts and paddle related content in dpa3 document by @HydrogenSulfate in #4887
  • docs(lmp): fix the usage of LAMMPS pair_style hybrid/overlay by @njzjz in #4951
  • docs: clarify atomic_dipole meaning for DPLR models by @Copilot in #4979
  • docs: add bfloat16 option to the model precision choice by @caic99 in #4866
  • docs: add comprehensive GitHub Copilot instructions and environment setup by @Copilot in #4911
  • docs: move copilot-instructions.md to AGENTS.md by @Copilot in #4982

Bugfix

  • pd: fix local_rank and in mutlti nodes training by @HydrogenSulfate in #4811
  • fix: fix pytorch in the cuda11 image by @njzjz in #4841
  • Profile bug fix when both enable_profiler and profiling are set to true. by @OutisLi in #4855
  • fix: use tuple in xp.reshape by @caic99 in #4808
  • fix: training speed might be incorrect by @caic99 in #4806
  • fix(jax): use more safe_for_vector_norm by @njzjz in #4809
  • fix: omit virial in dp test summary if not available by @caic99 in #4818
  • fix(jax): fix the usage of jaxlib.xla_extension by @njzjz in #4824
  • fix(dpmodel/pt/pd/jax): pass trainable to layer & support JAX trainable & support TF tensor fitting trainable by @njzjz in #4793
  • fix(cc): use insert_or_assign instead of insert by @CaRoLZhangxy in #4844
  • fix(CI): prefer stable versions by @njzjz in #4857
  • fix: merge get_np_precision to get_xp_precision by @njzjz in #4867
  • fix: no pinning memory on CPU by @caic99 in #4874
  • Fix: support "max:N" and "filter:N" batch_size rules in DeepmdDataSystem by @OutisLi in #4876
  • fix(pt/pd): fix eta computation by @HydrogenSulfate in #4886
  • fix: get correct intensive property prediction when using virtual atoms by @Chengqian-Zhang in #4869
  • fix(tf): fix compatibility with TF 2.20 by @njzjz in #4890
  • fix: relax atol and rtol value of padding atoms UT by @Chengqian-Zhang in #4892
  • fix(pt): fix CMake compatibility with PyTorch 2.8 by @njzjz in #4891
  • Fix(pt): add comm_dict for zbl, linear, dipole, dos, polar model to fix bugs mentioned in issue #4906 by @OutisLi in #4908
  • fix(pt,pd): remove redundant tensor handling to eliminate tensor construction warnings by @Copilot in #4907
  • fix: Avoid setting pin_memory in tests by @caic99 in #4919
  • fix(pd): change numel function return type from int to size_t to prevent overflow by @Copilot in #4924
  • fix(tf): fix serialization of dipole fitting with sel_type by @Copilot in #4934
  • style(dpmodel): enforce type annotations by @Copilot in #4953
  • fix: change eV/A to eV/Å for dp test by @OutisLi in #4978
  • fix: fix unit display in dp test by @njzjz in #4980
  • fix(tf): make dipole, polar, and dos models consistent with dpmodel by @Copilot in #4962

CI/CD

  • build(deps): bump pypa/cibuildwheel from 2.23 to 3.0 by @dependabot[bot] in #4805
  • fix(CI): clean up mpi4py index by @njzjz in #4822
  • build(deps): bump pypa/cibuildwheel from 3.0 to 3.1 by @dependabot[bot] in #4851
  • build(deps): bump actions/download-artifact from 4 to 5 by @dependabot[bot] in #4881
  • build(deps): bump actions/checkout from 4 to 5 by @dependabot[bot] in #4897
  • build(deps): bump actions/upload-pages-artifact from 3 to 4 by @dependabot[bot] in #4918
  • chore(CI): bump PyTorch from 2.7 to 2.8 by @njzjz in #4884
  • feat(ci): skip workflows on bot branches to avoid redundant CI runs by @Copilot in #4916
  • build(deps): bump actions/checkout from 4 to 5 by @dependabot[bot] in #4966
  • build(deps): bump actions/labeler from 5 to 6 by @dependabot[bot] in #4964
  • build(deps): bump actions/setup-python from 5 to 6 by @dependabot[bot] in #49...
Read more

v3.1.0

11 Jun 06:01
b494a0d

Choose a tag to compare

What's Changed

Highlights

DPA3

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 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.

Refer to examples/water/dpa3/input_torch.json for the training script. After training, the PyTorch model can be converted to the JAX model.

PaddlePaddle backend

The PaddlePaddle backend features a similar Python interface to the PyTorch backend, ensuring compatibility and flexibility in model development. PaddlePaddle has introduced dynamic-to-static functionality and PaddlePaddle JIT compiler (CINN) in DeePMD-kit, which allow for dynamic shapes and higher-order differentiation. The dynamic-to-static functionality automatically captures the user’s dynamic graph code and converts it into a static graph. After conversion, the CINN compiler is used to optimize the computational graph, thereby enhancing the efficiency of model training and inference. In experiments with the DPA-2 model, we achieved approximately a 40% reduction in training time compared to the dynamic graph, effectively improving the model training efficiency.

Breaking changes

  • breaking: enable PyTorch backend for PyPI LAMMPS by @njzjz in #4728

Other new features

All changes in v3.0.1, v3.0.2, and v3.0.3 are included.

Contributors

New Contributors

Full Changelog: v3.0.0...v3.1.0rc0

v3.1.0rc0

31 May 18:31
265d094

Choose a tag to compare

v3.1.0rc0 Pre-release
Pre-release

What's Changed

Highlights

DPA-3

DPA-3 is an advanced interatomic potential leveraging the message-passing architecture. Designed as a large atomic model (LAM), DPA-3 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 within and beyond the training domain. Furthermore, DPA-3 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.

Refer to examples/water/dpa3/input_torch.json for the training script. After training, the PyTorch model can be converted to the JAX model.

PaddlePaddle backend

The PaddlePaddle backend features a similar Python interface to the PyTorch backend, ensuring compatibility and flexibility in model development. PaddlePaddle has introduced dynamic-to-static functionality and PaddlePaddle JIT compiler (CINN) in DeePMD-kit, which allow for dynamic shapes and higher-order differentiation. The dynamic-to-static functionality automatically captures the user’s dynamic graph code and converts it into a static graph. After conversion, the CINN compiler is used to optimize the computational graph, thereby enhancing the efficiency of model training and inference. In experiments with the DPA-2 model, we achieved approximately a 40% reduction in training time compared to the dynamic graph, effectively improving the model training efficiency.

Breaking changes

  • breaking: enable PyTorch backend for PyPI LAMMPS by @njzjz in #4728

Other new features

All changes in v3.0.1, v3.0.2, and v3.0.3 are included.

Contributors

New Contributors

Full Changelog: v3.0.0...v3.1.0rc0

v3.0.3

23 May 17:27
e7eb16e

Choose a tag to compare

What's Changed

Breaking changes

  • breaking(wheel): bump minimal macos version to 11.0 (#4704)

Bugfixes

  • fix(tf): fix dplr Python inference (#4753)
  • fix: data type of nloc, nall-nloc in the input of border_op (#4653)
  • fix(data): Throw error when data's element is not present in input.json/type_map (#4639)
  • fix(ase): aviod duplicate stress calculation for ase calculator (#4633)
  • fix(pt): improve OOM detection (#4638)
  • fix(tf): always use float64 for the global tensor (#4735)
  • fix(jax): set default_matmul_precision to tensorfloat32 (#4726)
  • fix(jax): fix NaN in sigmoid grad (#4724)
  • fix: fix compatibility with CMake 4.0 (#4680)

CI/CD

  • fix(CI): set CMAKE_POLICY_VERSION_MINIMUM environment variable (#4692)
  • CI: bump PyTorch to 2.7 (#4717)
  • fix(tests): fix tearDownClass and release GPU memory (#4702)
  • fix(CI): upgrade setuptools to fix its compatibility with wheel (#4700)

Full Changelog: v3.0.2...v3.0.3

v3.1.0a0

30 Mar 01:47
52f8ece

Choose a tag to compare

v3.1.0a0 Pre-release
Pre-release

What's Changed

Highlights

DPA-3

DPA-3 is an advanced interatomic potential leveraging the message-passing architecture. Designed as a large atomic model (LAM), DPA-3 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 within and beyond the training domain. Furthermore, DPA-3 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.

Refer to examples/water/dpa3/input_torch.json for the training script. After training, the PyTorch model can be converted to the JAX model.

PaddlePaddle backend

The PaddlePaddle backend features a similar Python interface to the PyTorch backend, ensuring compatibility and flexibility in model development. PaddlePaddle has introduced dynamic-to-static functionality and PaddlePaddle JIT compiler (CINN) in DeePMD-kit, which allow for dynamic shapes and higher-order differentiation. The dynamic-to-static functionality automatically captures the user’s dynamic graph code and converts it into a static graph. After conversion, the CINN compiler is used to optimize the computational graph, thereby enhancing the efficiency of model training and inference. In experiments with the DPA-2 model, we achieved approximately a 40% reduction in training time compared to the dynamic graph, effectively improving the model training efficiency.

Other new features

All changes in v3.0.1 and v3.0.2 are included.

Contributors

New Contributors

Full Changelog: v3.0.0...v3.1.0a0

v3.0.2

02 Mar 03:32
70bc6d8

Choose a tag to compare

What's Changed

This patch version only contains minor features, bug fixes, enhancements, and documentation improvements.

New features

  • feat(tf): support tensor fitting with hybrid descriptor by @njzjz in #4542

Enhancement

Bugfix

Documentation

  • docs: fix the header of the scaling test table by @njzjz in #4507
  • docs: add sphinx.configuration to .readthedocs.yml by @njzjz in #4553
  • docs: add v3 paper citations by @njzjz in #4619
  • docs: add PyTorch Profiler support details to TensorBoard documentation by @caic99 in #4615

CI/CD

  • CI: switch linux_aarch64 to GitHub hosted runners by @njzjz in #4557

New Contributors

Full Changelog: v3.0.1...v3.0.2

v3.0.1

23 Dec 20:14

Choose a tag to compare

This patch version only contains bug fixes, enhancements, and documentation improvements.

What's Changed

Enhancements

  • Perf: print summary on rank 0 (#4434)
  • perf: optimize training loop (#4426)
  • chore: refactor training loop (#4435)
  • Perf: remove redundant checks on data integrity (#4433)
  • Perf: use fused Adam optimizer (#4463)

Bug fixes

  • Fix: add model_def_script to ZBL (#4423)
  • fix: add pairtab compression (#4432)
  • fix(tf): pass type_one_side & exclude_types to DPTabulate in se_r (#4446)
  • fix: print dlerror if dlopen fails (#4485)

Documentation

  • chore(pt): update multitask example (#4419)
  • docs: update DPA-2 citation (#4483)
  • docs: update deepmd-gnn URL (#4482)
  • docs: fix a minor typo on the title of install-from-c-library.md (#4484)

Other Changes

Full Changelog: v3.0.0...v3.0.1

v3.0.0

23 Nov 08:10
e695a91

Choose a tag to compare

DeePMD-kit v3: Multiple-backend Framework, DPA-2 Large Atomic Model, and Plugin Mechanisms

After eight months of public tests, we are excited to present the first stable version of DeePMD-kit v3, an advanced version that enables deep potential models with TensorFlow, PyTorch, or JAX backends. Additionally, DeePMD-kit v3 introduces support for the DPA-2 model, a novel architecture optimized for large atomic models. This release enhances plugin mechanisms, making integrating and developing new models easier.

Highlights

Multiple-backend framework: TensorFlow, PyTorch, and JAX support

image

DeePMD-kit v3 adds a versatile, pluggable framework providing consistent training and inference experience across multiple backends. Version 3.0.0 includes:

  • TensorFlow backend: Known for its computational efficiency with a static graph design.
  • PyTorch backend: A dynamic graph backend that simplifies model extension and development.
  • DP backend: Built with NumPy and Array API, a reference backend for development without heavy deep-learning frameworks.
  • JAX backend: Based on the DP backend via Array API, a static graph backend.
Features TensorFlow PyTorch JAX DP
Descriptor local frame
Descriptor se_e2_a
Descriptor se_e2_r
Descriptor se_e3
Descriptor se_e3_tebd
Descriptor DPA1
Descriptor DPA2
Descriptor Hybrid
Fitting energy
Fitting dipole
Fitting polar
Fitting DOS
Fitting property
ZBL
DPLR
DPRc
Spin
Gradient calculation
Model training
Model compression
Python inference
C++ inference

Critical features of the multiple-backend framework include the ability to:

  • Train models using different backends with the same training data and input script, allowing backend switching based on your efficiency or convenience needs.
# Training a model using the TensorFlow backend
dp --tf train input.json
dp --tf freeze
dp --tf compress

# Training a model using the PyTorch backend
dp --pt train input.json
dp --pt freeze
dp --pt compress
  • Convert models between backends using dp convert-backend, with backend-specific file extensions (e.g., .pb for TensorFlow and .pth for PyTorch).
# Convert from a TensorFlow model to a PyTorch model
dp convert-backend frozen_model.pb frozen_model.pth
# Convert from a PyTorch model to a TensorFlow model
dp convert-backend frozen_model.pth frozen_model.pb
# Convert from a PyTorch model to a JAX model
dp convert-backend frozen_model.pth frozen_model.savedmodel
# Convert from a PyTorch model to the backend-independent DP format
dp convert-backend frozen_model.pth frozen_model.dp
  • Run inference across backends via interfaces like dp test, Python/C++/C interfaces, or third-party packages (e.g., dpdata, ASE, LAMMPS, AMBER, Gromacs, i-PI, CP2K, OpenMM, ABACUS, etc.).
# In a LAMMPS file:
# run LAMMPS with a TensorFlow backend model
pair_style deepmd frozen_model.pb
# run LAMMPS with a PyTorch backend model
pair_style deepmd frozen_model.pth
# run LAMMPS with a JAX backend model
pair_style deepmd frozen_model.savedmodel
# Calculate model deviation using different models
pair_style deepmd frozen_model.pb frozen_model.pth frozen_model.savedmodel out_file md.out out_freq 100
  • Add a new backend to DeePMD-kit much more quickly if you want to contribute to DeePMD-kit.

DPA-2 model: a large atomic model as a multi-task learner

The DPA-2 model offers a robust architecture for large atomic models (LAM), accurately representing diverse chemical systems for high-quality simulations. In this release, DPA-2 can be trained using the PyTorch backend, supporting both single-task (see examples/water/dpa2) or multi-task (see examples/water_multi_task/pytorch_example) training schemes. DPA-2 is available for Python/C++ inference in the JAX backend.

The DPA-2 descriptor comprises repinit and repformer, as shown below.

DPA-2

The PyTorch backend supports training strategies for large atomic models, including:

  • Parallel training: Train large atomic models on multiple GPUs for efficiency.
torchrun --nproc_per_node=4 --no-python dp --pt train input.json
  • Multi-task training: For large atomic models trained across a broad range of data calculated on different DFT levels with shared descriptors. An example is given in examples/water_multi_task/pytorch_example/input_torch.json.
  • Finetune: Training a pre-train large atomic model on a smaller, task-specific dataset. The PyTorch backend has supported --finetune argument in the dp --pt train command line.

Plugin mechanisms for external models

In version 3.0.0, the plugin capabilities have been implemented to support the development and integration of potential energy models using TensorFlow, PyTorch, or JAX backends, leveraging DeePMD-kit's trainer, loss functions, and interfaces. A plugin example is deepmd-gnn, which supports training the MACE and NequIP models in the DeePMD-kit with the familiar commands.

dp --pt train mace.json
dp --pt freeze
dp --pt test -m frozen_model.pth -s ../data/

image

Other new features

  • Descriptor se_e3_tebd. (#4066)
  • Fitting the property (#3867).
  • New training parameters: max_ckpt_keep (#3441), change_bias_after_training (#3993), and stat_file.
  • New command line interface: dp change-bias (#3993) and dp show (#3796).
  • Support generating JSON schema for integration with VSCode (#3849).
  • The latest LAMMPS version (stable_29Aug2024_update1) is supported. (#4088, #4179)

Breaking changes

  • The deepmodeling conda channel is deprecated. Use the conda-forge channel instead. (#3462, #4385)
  • The offline package and conda packages for CUDA 11 are dropped.
  • Python 3.7 and 3.8 supports are dropped. (#3185, #4185)
  • The minimal versions of deep learning frameworks: TensorFlow 2.7, PyTorch 2.1, JAX 0.4.33, and NumPy 1.21.
  • We require all model files to have the correct filename extension for all interfaces so a corresponding backend can load them. TensorFlow model files must end with .pb extension.
  • Bias is removed by default from type embedding. (#3958)
  • The spin model is refactored, and its usage in the LAMMPS module has been changed. (#3301, #4321)
  • Multi-task training support is removed from the TensorFlow backend. (#3763)
  • The set_prefix key is deprecated. (#3753)
  • dp test now uses all sets for training and test. In previous versions, only the last set is used as the test set in dp test. (#3862)
  • The Python module structure is fully refactored. The old deepmd module was moved to deepmd.tf without other API changes, and deepmd_utils was moved to deepmd without other API changes. (#3177, #3178)
  • Python class DeepTensor (including DeepDiople and DeepPolar) now returns atomic tensor in the dimension of natoms instead of nsel_atoms. (#3390)
  • C++ 11 support is dropped. (#4068)

For other changes, refer to Full Changelog: v2.2.11...v3.0.0rc0

Contributors

The PyTorch backend was developed in the dptech-corp/deepmd-pytorch repository, and then it was fully merged into the deepmd-kit repository in #3180. Contributors to the deepmd-pytorch repository:

Contributors to the deepmd-kit repository:

Read more

v3.0.0rc0

14 Nov 19:36
0ad4289

Choose a tag to compare

v3.0.0rc0 Pre-release
Pre-release

DeePMD-kit v3: Multiple-backend Framework, DPA-2 Large Atomic Model, and Plugin Mechanisms

We are excited to present the first release candidate of DeePMD-kit v3, an advanced version that enables deep potential models with TensorFlow, PyTorch, or JAX backends. Additionally, DeePMD-kit v3 introduces support for the DPA-2 model, a novel architecture optimized for large atomic models. This release enhances plugin mechanisms, making integrating and developing new models easier.

Highlights

Multiple-backend framework: TensorFlow, PyTorch, and JAX support

image

DeePMD-kit v3 adds a versatile, pluggable framework providing consistent training and inference experience across multiple backends. Version 3.0.0 includes:

  • TensorFlow backend: Known for its computational efficiency with a static graph design.
  • PyTorch backend: A dynamic graph backend that simplifies model extension and development.
  • DP backend: Built with NumPy and Array API, a reference backend for development without heavy deep-learning frameworks.
  • JAX backend: Based on the DP backend via Array API, a static graph backend.
Features TensorFlow PyTorch JAX DP
Descriptor local frame
Descriptor se_e2_a
Descriptor se_e2_r
Descriptor se_e3
Descriptor se_e3_tebd
Descriptor DPA1
Descriptor DPA2
Descriptor Hybrid
Fitting energy
Fitting dipole
Fitting polar
Fitting DOS
Fitting property
ZBL
DPLR
DPRc
Spin
Gradient calculation
Model training
Model compression
Python inference
C++ inference

Critical features of the multiple-backend framework include the ability to:

  • Train models using different backends with the same training data and input script, allowing backend switching based on your efficiency or convenience needs.
# Training a model using the TensorFlow backend
dp --tf train input.json
dp --tf freeze
dp --tf compress

# Training a model using the PyTorch backend
dp --pt train input.json
dp --pt freeze
dp --pt compress
  • Convert models between backends using dp convert-backend, with backend-specific file extensions (e.g., .pb for TensorFlow and .pth for PyTorch).
# Convert from a TensorFlow model to a PyTorch model
dp convert-backend frozen_model.pb frozen_model.pth
# Convert from a PyTorch model to a TensorFlow model
dp convert-backend frozen_model.pth frozen_model.pb
# Convert from a PyTorch model to a JAX model
dp convert-backend frozen_model.pth frozen_model.savedmodel
# Convert from a PyTorch model to the backend-independent DP format
dp convert-backend frozen_model.pth frozen_model.dp
  • Run inference across backends via interfaces like dp test, Python/C++/C interfaces, or third-party packages (e.g., dpdata, ASE, LAMMPS, AMBER, Gromacs, i-PI, CP2K, OpenMM, ABACUS, etc.).
# In a LAMMPS file:
# run LAMMPS with a TensorFlow backend model
pair_style deepmd frozen_model.pb
# run LAMMPS with a PyTorch backend model
pair_style deepmd frozen_model.pth
# run LAMMPS with a JAX backend model
pair_style deepmd frozen_model.savedmodel
# Calculate model deviation using different models
pair_style deepmd frozen_model.pb frozen_model.pth frozen_model.savedmodel out_file md.out out_freq 100
  • Add a new backend to DeePMD-kit much more quickly if you want to contribute to DeePMD-kit.

DPA-2 model: Towards a universal large atomic model for molecular and material simulation

The DPA-2 model offers a robust architecture for large atomic models (LAM), accurately representing diverse chemical systems for high-quality simulations. In this release, DPA-2 is trainable in the PyTorch backend, with an example configuration available in examples/water/dpa2. DPA-2 is available for Python inference in the JAX backend.

The DPA-2 descriptor comprises repinit and repformer, as shown below.

DPA-2

The PyTorch backend supports training strategies for large atomic models, including:

  • Parallel training: Train large atomic models on multiple GPUs for efficiency.
torchrun --nproc_per_node=4 --no-python dp --pt train input.json
  • Multi-task training: For large atomic models trained across a broad range of data calculated on different DFT levels with shared descriptors. An example is given in examples/water_multi_task/pytorch_example/input_torch.json.
  • Finetune: Training a pre-train large atomic model on a smaller, task-specific dataset. The PyTorch backend has supported --finetune argument in the dp --pt train command line.

Plugin mechanisms for external models

In v3.0.0, plugin capabilities allow you to develop models with TensorFlow, PyTorch, or JAX, leveraging DeePMD-kit's trainer, loss functions, and interfaces. A plugin example is deepmd-gnn, which supports training the MACE and NequIP models in the DeePMD-kit with the familiar commands.

dp --pt train mace.json
dp --pt freeze
dp --pt test -m frozen_model.pth -s ../data/

image

Other new features

  • Descriptor se_e3_tebd. (#4066)
  • Fitting the property (#3867).
  • New training parameters: max_ckpt_keep (#3441), change_bias_after_training (#3993), and stat_file.
  • New command line interface: dp change-bias (#3993) and dp show (#3796).
  • Support generating JSON schema for integration with VSCode (#3849).
  • The latest LAMMPS version (stable_29Aug2024_update1) is supported. (#4088, #4179)

Breaking changes

  • Python 3.7 and 3.8 supports are dropped. (#3185, #4185)
  • We require all model files to have the correct filename extension for all interfaces so a corresponding backend can load them. TensorFlow model files must end with .pb extension.
  • Bias is removed by default from type embedding. (#3958)
  • The spin model is refactored, and its usage in the LAMMPS module has been changed. (#3301, #4321)
  • Multi-task training support is removed from the TensorFlow backend. (#3763)
  • The set_prefix key is deprecated. (#3753)
  • dp test now uses all sets for training and test. In previous versions, only the last set is used as the test set in dp test. (#3862)
  • The Python module structure is fully refactored. The old deepmd module was moved to deepmd.tf without other API changes, and deepmd_utils was moved to deepmd without other API changes. (#3177, #3178)
  • Python class DeepTensor (including DeepDiople and DeepPolar) now returns atomic tensor in the dimension of natoms instead of nsel_atoms. (#3390)
  • C++ 11 support is dropped. (#4068)

For other changes, refer to Full Changelog: v2.2.11...v3.0.0rc0

Contributors

The PyTorch backend was developed in the dptech-corp/deepmd-pytorch repository, and then it was fully merged into the deepmd-kit repository in #3180. Contributors to the deepmd-pytorch repository:

Contributors to the deepmd-kit repository:

Read more