Releases: deepmodeling/deepmd-kit
v3.1.3
Highlights
This release focuses on two major themes: easier access to pretrained models and the next stage of the PyTorch roadmap. DeePMD-kit can now download built-in pretrained models directly, and the same release series also introduces a new pretrained model, DPA3-Omol-Large, on top of that mechanism. In parallel, we have started building an experimental exportable PyTorch backend based on the Array API, torch.export, and torch.compile, motivated in part by the deprecation of torch.jit.
Beyond these headline items, v3.1.3 expands PyTorch training capabilities with new optimizers and distributed-training support, improves diagnostics and training safety, adds charge-spin and spin-virial related functionality, and continues to strengthen documentation, CI, packaging, and backend consistency across the project.
Try DPA3-Omol-Large in 3 steps:
# Install the latest version of DeePMD-kit (will be available a few days after this release)
curl -fsSL https://dp1s.deepmodeling.com | bash
# Restart the shell, and download the pretrained model
dp pretrained download DPA3-Omol-Large
# Evaluate your training/test data with the pretrained model
dp test -m ~/.cache/deepmd/pretrained/models/DPA3-Omol-Large.pt -s path_to_your_systemBreaking Changes
- Drop Python 3.9 by @njzjz in #5078
- Stop providing CUDA 11 pre-built wheels by @njzjz in #5080
- Prepare to deprecate the
develbranch by @njzjz in #5122
New Features
Pretrained models and model distribution
- Add a built-in pretrained model downloader and alias backend by @njzjz-bot in #5277
- Add
DPA-2.4-7Mto the pretrained model registry by @njzjz-bot in #5307 - Add
DPA3-Omol-Largeby @njzjz-bot in #5327
Experimental PyTorch backend
- Add PyTorch support to Array API utilities by @Copilot in #5198
- Add a new exportable PyTorch backend by @wanghan-iapcm in #5194
- Provide infrastructure for converting
dpmodelclasses to PyTorch modules by @wanghan-iapcm in #5204 - Implement
se_tandse_t_tebddescriptors in the experimental PyTorch backend by @wanghan-iapcm in #5208 - Add energy fitting in the experimental PyTorch backend by @wanghan-iapcm in #5218
- Add the atomic model in the experimental PyTorch backend by @wanghan-iapcm in #5220
- Add the full model in the experimental PyTorch backend by @wanghan-iapcm in #5244
- Auto-generate
forward/forward_lowerin thetorch_moduledecorator by @Copilot in #5246 - Add
dpa1,dpa2,dpa3, andhybriddescriptors in the experimental PyTorch backend by @wanghan-iapcm in #5248 - Add DOS, dipole, polar, and property fittings in the experimental PyTorch backend by @wanghan-iapcm in #5254
- Add dipole, polar, DOS, property, and DP-ZBL models with cross-backend consistency tests by @wanghan-iapcm in #5260
- Add training infrastructure for the experimental PyTorch backend by @wanghan-iapcm in #5270
- Implement the
.pteinference pipeline with dynamic shapes by @wanghan-iapcm in #5284 - Implement the energy Hessian model in the experimental PyTorch backend by @wanghan-iapcm in #5287
- Add DP freeze support and
dp testcoverage for.ptemodels by @wanghan-iapcm in #5302 - Add frozen-model support in the experimental PyTorch backend by @wanghan-iapcm in #5318
PyTorch training, optimization, and scaling
- Add cosine learning rate and
BaseLRby @iProzd in #5142 - Add the AdaMuon optimizer by @OutisLi in #5130
- Add
warmup_ratioto configure warmup steps more conveniently by @OutisLi in #5134 - Add the HybridMuon optimizer by @OutisLi in #5149
- Add parameter-count output by @OutisLi in #5147
- Use
num_epochto setnum_stepsby @OutisLi in #5148 - Support spin virial in the PyTorch backend by @OutisLi in #5156
- Finalize optimizer schema and backend handling by @OutisLi in #5157
- Add FSDP and ZeRO-1 support by @OutisLi in #5222
- Log pre-clip gradient
total_normand per-parameter norms to TensorBoard by @OutisLi in #5252 - Fully refactor the HybridMuon optimizer by @OutisLi in #5275
- Allow
--init-frz-modelfor PyTorch models converted from TensorFlow models by @ChiahsinChu in #5091 - Add a plugin for the data modifier in the PyTorch backend by @ChiahsinChu in #4661
Core functionality and usability
- Optimize data-modifier calls in
deepevalby @ChiahsinChu in #5120 - Add NaN detection during training by @njzjz in #5135
- Support Array API learning rates in
dpmodelby @njzjz in #5143 - Reuse
dpmodelEnvMatStatin PyTorch by @njzjz in #5139 - Add device-name display (for example,
A100instead of onlycuda) by @OutisLi in #5146 - Improve capitalization in info display by @OutisLi in #5145
- Add a
Nodeclass for serialization and implement display functionality by @njzjz in #5158 - Unify learning-rate schedulers with the Array API by @OutisLi in #5154
- Use data statistics for observed types in PyTorch /
dpmodelby @iProzd in #5269 - Add charge-spin embedding for the DP and PyTorch backends by @iProzd in #5295
- Add skills for adding new descriptors by @wanghan-iapcm in #5249
- Add a skill to debug gradient flow in the experimental PyTorch backend by @wanghan-iapcm in #5280
Documentation
- Update the DeepModeling domain to
deepmodeling.comby @njzjz-bot in #5111 - Add a citation for property fitting and multi-task fine-tuning by @Chengqian-Zhang in #5152
- Add
dp1sdocumentation by @njzjz in #5192 - Format Markdown documentation with
mdformatby @njzjz in #5209 - Add a theory section to the DPA3 documentation by @njzjz-bot in #5262
- Add a theory section to the DPA-2 documentation by @njzjz-bot in #5263
- Add mathematical formulas to fitting classes by @njzjz-bot in #5256
- Add mathematical formulas to atomic model classes by @njzjz-bot in #5257
- Add mathematical formulas to model classes by @njzjz-bot in #5258
- Add mathematical formulas to descriptor classes by @njzjz-bot in #5255
- Update the documented PaddlePaddle version to 3.3.0 and 3.4.0 (develop) by @HydrogenSulfate in #5306
Build & Releases
Packaging, dependencies, and release infrastructure
- Update the Torch requirement from
~=2.8.0to>=2.8,<2.10by @dependabot[bot] in #5114 - Update the Torch requirement from
>=2.8,<2.10to==2.10.0by @dependabot[bot] in #5170 - Update the Torch requirement from
~=2.8.0to>=2.8,<2.10by @dependabot[bot] in #5103 - Update the
scikit-build-corerequirement to>=0.5,!=0.6.0,<0.13by @dependabot[bot] in [#5271](https://github.com/deepmodeling/deep...
v3.1.2
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
- doc:fix error in doc of se_e3_tebd by @OutisLi in #5018
- docs: update DeepModeling email address by @njzjz-bot in #5062
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
What's Changed
New features
- feat(pt): add
observed-typeoption 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
DPclass 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_SHAPEfor 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_sizeofDeepEvalwith 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/overlayby @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.reshapeby @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_extensionby @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_precisiontoget_xp_precisionby @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
atolandrtolvalue 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...
v3.1.0
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
Other new features
- feat(pt/dp): support case embedding and sharable fitting by @iProzd in #4417
- feat(pt): train with energy Hessian by @1azyking in #4169
- feat: add new batch size rules for large systems by @caic99 in #4659
- feat: add method to access fele in pppm/dplr by @HanswithCMY in #4452
- feat (tf/pt): add atomic weights to tensor loss by @ChiahsinChu in #4466
- feat(pt): add
trainableto property fitting by @ChiahsinChu in #4599 - Feat(pt): Support fitting_net input statistics. by @Chengqian-Zhang in #4504
- feat(jax): Hessian by @njzjz in #4649
- feat: add plugin mode for data modifier by @ChiahsinChu in #4621
- feat(pt): add eta message for pt backend by @HydrogenSulfate in #4725
- feat: add huber loss by @iProzd in #4684
- feat(pt): add AdamW for pt training by @iProzd in #4757
- Feat:support customized rglob by @anyangml in #4763
- feat(pt/pd): add size option to dp show by @iProzd in #4783
All changes in v3.0.1, v3.0.2, and v3.0.3 are included.
Contributors
- @iProzd #4417 #4655 #4419 #4609 #4633 #4647 #4675 #4684 #4730 #4757 #4754 #4756 #4760 #4778 #4781 #4783 #4792
- @pre-commit-ci #4420 #4449 #4464 #4473 #4497 #4521 #4539 #4552 #4566 #4574 #4579 #4596 #4602 #4611 #4645 #4660 #4672 #4690 #4699 #4708 #4712 #4719 #4723 #4736 #4748 #4767 #4779 #4791
- @njzjz #4482 #4483 #4484 #4507 #4619 #4410 #4438 #4442 #4446 #4459 #4485 #4479 #4508 #4534 #4531 #4542 #4550 #4553 #4557 #4561 #4565 #4570 #4575 #4547 #4582 #4613 #4624 #4558 #4638 #4636 #4640 #4649 #4668 #4680 #4720 #4728 #4738 #4692 #4700 #4704 #4702 #4717 #4724 #4726 #4729 #4735 #4753 #4774 #4765 #4776 #4775 #4766 #4780 #4786 #4794
- @Chengqian-Zhang #4471 #4504 #4639
- @HydrogenSulfate #4418 #4489 #4673 #4302 #4439 #4414 #4480 #4493 #4488 #4512 #4467 #4514 #4617 #4556 #4656 #4694 #4701 #4715 #4725 #4768 #4770
- @QuantumMisaka #4510
- @1azyking #4169
- @caic99 #4535 #4615 #4659 #4434 #4426 #4435 #4433 #4437 #4463 #4505 #4478 #4541 #4513 #4597 #4622 #4662 #4669 #4677 #4678 #4688 #4687 #4737 #4747 #4746 #4761 #4772 #4773 #4784 #4751 #4790
- @dependabot #4408 #4630
- @anyangml #4423 #4432 #4587 #4763
- @HanswithCMY #4452
- @ChiahsinChu #4466 #4538 #4599 #4621
- @RMeli #4577
- @Yi-FanLi #4581
- @wanghan-iapcm #4653
- @SumGuo-88 #4593
- @SigureMo #4664
- @njzjz-bot #4796
New Contributors
- @HanswithCMY made their first contribution in #4452
- @QuantumMisaka made their first contribution in #4510
- @1azyking made their first contribution in #4169
- @RMeli made their first contribution in #4577
- @SumGuo-88 made their first contribution in #4593
- @SigureMo made their first contribution in #4664
Full Changelog: v3.0.0...v3.1.0rc0
v3.1.0rc0
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
Other new features
- feat(pt/dp): support case embedding and sharable fitting by @iProzd in #4417
- feat(pt): train with energy Hessian by @1azyking in #4169
- feat: add new batch size rules for large systems by @caic99 in #4659
- feat: add method to access fele in pppm/dplr by @HanswithCMY in #4452
- feat (tf/pt): add atomic weights to tensor loss by @ChiahsinChu in #4466
- feat(pt): add
trainableto property fitting by @ChiahsinChu in #4599 - Feat(pt): Support fitting_net input statistics. by @Chengqian-Zhang in #4504
- feat(jax): Hessian by @njzjz in #4649
- feat: add plugin mode for data modifier by @ChiahsinChu in #4621
- feat(pt): add eta message for pt backend by @HydrogenSulfate in #4725
- feat: add huber loss by @iProzd in #4684
- feat(pt): add AdamW for pt training by @iProzd in #4757
All changes in v3.0.1, v3.0.2, and v3.0.3 are included.
Contributors
- @iProzd #4417 #4655 #4419 #4609 #4633 #4647 #4675 #4684 #4730 #4757 #4754 #4756 #4760 #4778
- @pre-commit-ci #4420 #4449 #4464 #4473 #4497 #4521 #4539 #4552 #4566 #4574 #4579 #4596 #4602 #4611 #4645 #4660 #4672 #4690 #4699 #4708 #4712 #4719 #4723 #4736 #4748 #4767
- @njzjz #4482 #4483 #4484 #4507 #4619 #4410 #4438 #4442 #4446 #4459 #4485 #4479 #4508 #4534 #4531 #4542 #4550 #4553 #4557 #4561 #4565 #4570 #4575 #4547 #4582 #4613 #4624 #4558 #4638 #4636 #4640 #4649 #4668 #4680 #4720 #4728 #4738 #4692 #4700 #4704 #4702 #4717 #4724 #4726 #4729 #4735 #4753 #4774 #4765 #4776 #4775 #4766
- @Chengqian-Zhang #4471 #4504 #4639
- @HydrogenSulfate #4418 #4489 #4673 #4302 #4439 #4414 #4480 #4493 #4488 #4512 #4467 #4514 #4617 #4556 #4656 #4694 #4701 #4715 #4725 #4768 #4770
- @QuantumMisaka #4510
- @1azyking #4169
- @caic99 #4535 #4615 #4659 #4434 #4426 #4435 #4433 #4437 #4463 #4505 #4478 #4541 #4513 #4597 #4622 #4662 #4669 #4677 #4678 #4688 #4687 #4737 #4747 #4746 #4761 #4772 #4773
- @dependabot #4408 #4630
- @anyangml #4423 #4432 #4587
- @HanswithCMY #4452
- @ChiahsinChu #4466 #4538 #4599 #4621
- @RMeli #4577
- @Yi-FanLi #4581
- @wanghan-iapcm #4653
- @SumGuo-88 #4593
- @SigureMo #4664
New Contributors
- @HanswithCMY made their first contribution in #4452
- @QuantumMisaka made their first contribution in #4510
- @1azyking made their first contribution in #4169
- @RMeli made their first contribution in #4577
- @SumGuo-88 made their first contribution in #4593
- @SigureMo made their first contribution in #4664
Full Changelog: v3.0.0...v3.1.0rc0
v3.0.3
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_precisiontotensorfloat32(#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
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
- feat(pt/dp): support case embedding and sharable fitting by @iProzd in #4417
- feat(pt): train with energy Hessian by @1azyking in #4169
- feat: add new batch size rules for large systems by @caic99 in #4659
- feat: add method to access fele in pppm/dplr by @HanswithCMY in #4452
- feat (tf/pt): add atomic weights to tensor loss by @ChiahsinChu in #4466
- feat(pt): add
trainableto property fitting by @ChiahsinChu in #4599 - Feat(pt): Support fitting_net input statistics. by @Chengqian-Zhang in #4504
- feat(jax): Hessian by @njzjz in #4649
- feat: add plugin mode for data modifier by @ChiahsinChu in #4621
All changes in v3.0.1 and v3.0.2 are included.
Contributors
- @iProzd #4417 #4655 #4419 #4609 #4633 #4647 #4675
- @pre-commit-ci #4420 #4449 #4464 #4473 #4497 #4521 #4539 #4552 #4566 #4574 #4579 #4596 #4602 #4611 #4645 #4660 #4672
- @njzjz #4482 #4483 #4484 #4507 #4619 #4410 #4438 #4442 #4446 #4459 #4485 #4479 #4508 #4534 #4531 #4542 #4550 #4553 #4557 #4561 #4565 #4570 #4575 #4547 #4582 #4613 #4624 #4558 #4638 #4636 #4640 #4649 #4668 #4680
- @Chengqian-Zhang #4471 #4504 #4639
- @HydrogenSulfate #4418 #4489 #4673 #4302 #4439 #4414 #4480 #4493 #4488 #4512 #4467 #4514 #4617 #4556 #4656
- @QuantumMisaka #4510
- @1azyking #4169
- @caic99 #4535 #4615 #4659 #4434 #4426 #4435 #4433 #4437 #4463 #4505 #4478 #4541 #4513 #4597 #4622 #4662 #4669 #4677 #4678
- @dependabot #4408 #4630
- @anyangml #4423 #4432 #4587
- @HanswithCMY #4452
- @ChiahsinChu #4466 #4538 #4599 #4621
- @RMeli #4577
- @Yi-FanLi #4581
- @wanghan-iapcm #4653
- @SumGuo-88 #4593
- @SigureMo #4664
New Contributors
- @HanswithCMY made their first contribution in #4452
- @QuantumMisaka made their first contribution in #4510
- @1azyking made their first contribution in #4169
- @RMeli made their first contribution in #4577
- @SumGuo-88 made their first contribution in #4593
- @SigureMo made their first contribution in #4664
Full Changelog: v3.0.0...v3.1.0a0
v3.0.2
What's Changed
This patch version only contains minor features, bug fixes, enhancements, and documentation improvements.
New features
Enhancement
- Perf: replace unnecessary
torch.splitwith indexing by @caic99 in #4505 - Perf: use F.linear for MLP by @caic99 in #4513
- chore: improve neighbor stat log by @njzjz in #4561
- chore: bump pytorch to 2.6.0 by @njzjz in #4575
Bugfix
- Fix: Modify docs of DPA models by @QuantumMisaka in #4510
- fix(pt): fix clearing the list in set_eval_descriptor_hook by @njzjz in #4534
- [fix bug] load atomic_*.npy for tf tensor model by @ChiahsinChu in #4538
- fix: lower
num_workersto 4 by @caic99 in #4535 - fix: fix YAML conversion by @njzjz in #4565
- fix(cc): remove C++ 17 usage by @njzjz in #4570
- Fix version in DeePMDConfigVersion.cmake by @RMeli in #4577
- fix(pt): detach computed descriptor tensor to prevent OOM by @njzjz in #4547
- fix(pt): throw errors for GPU tensors and the CPU OP library by @njzjz in #4582
- use variable to store the bias of atomic polarizability by @Yi-FanLi in #4581
- Fix: pt tensor loss label name by @anyangml in #4587
- CI: pin jax to 0.5.0 by @njzjz in #4613
- fix(array-api): fix xp.where errors by @njzjz in #4624
Documentation
- docs: fix the header of the scaling test table by @njzjz in #4507
- docs: add
sphinx.configurationto .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
New Contributors
- @QuantumMisaka made their first contribution in #4510
- @RMeli made their first contribution in #4577
Full Changelog: v3.0.1...v3.0.2
v3.0.1
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
- build(deps): bump pypa/cibuildwheel from 2.21 to 2.22 by @dependabot in #4408
Full Changelog: v3.0.0...v3.0.1
v3.0.0
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
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.,.pbfor TensorFlow and.pthfor 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.
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
--finetuneargument in thedp --pt traincommand 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/Other new features
- Descriptor se_e3_tebd. (#4066)
- Fitting the property (#3867).
- New training parameters:
max_ckpt_keep(#3441),change_bias_after_training(#3993), andstat_file. - New command line interface:
dp change-bias(#3993) anddp 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
.pbextension. - 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_prefixkey is deprecated. (#3753) dp testnow 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
deepmdmodule was moved todeepmd.tfwithout other API changes, anddeepmd_utilswas moved todeepmdwithout other API changes. (#3177, #3178) - Python class
DeepTensor(includingDeepDiopleandDeepPolar) now returns atomic tensor in the dimension ofnatomsinstead ofnsel_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:
- @20171130
- @CaRoLZhangxy
- @amcadmus
- @guolinke
- @iProzd
- @nahso
- @njzjz
- @qin2xue3jian4
- @shishaochen
- @zjgemi
Contributors to the deepmd-kit repository:
- @CaRoLZhangxy: #3162 #3287 #3337 #3375 #3379 #3434 #3436 #3612 #3613 #3614 #3656 #3657 #3740 #3780 #3917 #3919 #4209 #4237
- @Chengqian-Zhang: #3615 #3796 #3828 #3840 #3867 #3912 #4120 #4145 #4280
- @ChiahsinChu: #4246 #4248
- @Cloudac7: #4031
- @HydrogenSulfate: #4117
- @LiuGroupHNU: #3978
- @Mancn-Xu: #3567
- @Yi-FanLi: #3822 #4013 #4084 #4283
- @anyangml: #3192 #3210 #3212 #3248 #3266 #3281 #3296 #3309 #3314 #3321 #3327 #3338 #3351 #3362 #3376 #3385 #3398 #3410 #3426 #3432 #3435 #3447 #3451 #3452 #3468 #3485 #3486 #3575 #3584 #3654 #3662 #3663 #3706 #3757 #3759 #3812 #3824 #3876 #3946 #3975 #4194 #4205 #4292 #4296 #4335 #4339 #4370 #4380
- @caic99: #3465 #4165 #4401
- @chazeon: #3473 #3652 #3653 #3739
- @cherryWangY: #3877 #4227 #4297 #4298 #4299 #4300
- @dependabot: #3231 #3312 #3446 #3487 #3777 #3882 #4045 #4127 #4374
- @hztttt: #3762
- @iProzd: #3180 #3203 #3245 #3261 #3301 #3355 #3359 #3367 #3371 #3378 #3380 #3387 #3388 #3409 #3411 #3441 #3442 #3445 #3456 #3480 #3569 #3571 #3573 #3607 #3616 #3619 #3696 #3698 #3712 #3717 #3718 #3725 #3746 #3748 #3758 #3763 #3768 #3773 #3774 #3775 #3781 #3782 #3785 #3803 #3813 #3814 #3815 #3826 #3837 #3841 #3842 #3843 #3873 #3906 #3914 #3916 #3925 #3926 #3927 #3933 #3944 #3945 #3957 #3958 #3967 #3971 #39...


