Skip to content

Releases: deepmodeling/deepmd-kit

v2.2.10

06 Apr 19:28
Compare
Choose a tag to compare

What's Changed

New features

Enhancement

  • Neighbor stat is 80x accelerated by @njzjz in #3275
  • support checkpoint path (instead of directory) in dp freeze by @njzjz in #3254
  • add fparam/aparam support for finetune by @njzjz in #3313
  • chore(build): move static part of dynamic metadata to pyproject.toml by @njzjz in #3618
  • test: add LAMMPS MPI tests by @njzjz in #3572
  • support Python 3.12 by @njzjz in #3343

Documentation

  • docs: rewrite README; deprecate manually written TOC by @njzjz in #3179
  • docs: apply type_one_side=True to se_a and se_r by @njzjz in #3364
  • docs: add deprecation notice for the official conda channel and more conda docs by @njzjz in #3462
  • docs: Replace quick_start.ipynb with a new version. by @Mancn-Xu in #3567
  • issue template: change TF version to backend version by @njzjz in #3244
  • chore: remove incorrect memset TODOs by @njzjz in #3600

Bugfix

  • c: change the required shape of electric field to nloc * 3 by @njzjz in #3237
  • Fix LAMMPS plugin symlink path on macOS platform by @chazeon in #3473
  • fix_dplr.cpp delete redundant setup by @shiruosong in #3344
  • fix_dplr.cpp set atom->image when pre_force by @shiruosong in #3345
  • fix: fix type hint of sel by @njzjz in #3624
  • fix: make se_atten_v2 masking smooth when davg is not zero by @njzjz in #3632
  • fix: do not install tf-keras for cu11 by @njzjz in #3444

CI/CD

Dependency update

  • bump LAMMPS to stable_2Aug2023_update3 by @njzjz in #3399
  • build(deps): bump codecov/codecov-action from 3 to 4 by @dependabot in #3231
  • build(deps): bump pypa/cibuildwheel from 2.16 to 2.17 by @dependabot in #3487
  • pin nvidia-cudnn-cu{11,12} to <9 by @njzjz in #3610
  • pin docker actions to major versions by @njzjz in #3238
  • build(deps): bump the npm_and_yarn group across 1 directories with 1 update by @dependabot in #3312
  • bump scikit-build-core to 0.8 by @njzjz in #3369
  • build(deps): bump softprops/action-gh-release from 1 to 2 by @dependabot in #3446

New Contributors

Full Changelog: v2.2.9...v2.2.10

v3.0.0a0

03 Mar 09:22
ec32340
Compare
Choose a tag to compare
v3.0.0a0 Pre-release
Pre-release

DeePMD-kit v3: A multiple-backend framework for deep potentials

We are excited to announce the first alpha version of DeePMD-kit v3. DeePMD-kit v3 allows you to train and run deep potential models on top of TensorFlow or PyTorch. DeePMD-kit v3 also supports the DPA-2 model, a novel architecture for large atomic models.

Highlights

Multiple-backend framework

image

DeePMD-kit v3 adds a pluggable multiple-backend framework to provide consistent training and inference experiences between different backends. You can:

  • Use the same training data and the input script to train a deep potential model with different backends. Switch backends based on efficiency, functionality, or convenience:
# Training a model using the TensorFlow backend
dp --tf train input.json
dp --tf freeze

# Training a mode using the PyTorch backend
dp --pt train input.json
dp --pt freeze
  • Use any model to perform inference via any existing interfaces, including dp test, Python/C++/C interface, and third-party packages (dpdata, ASE, LAMMPS, AMBER, Gromacs, i-PI, CP2K, OpenMM, ABACUS, etc). Take an example on LAMMPS:
# 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
# Calculate model deviation using both models
pair_style deepmd frozen_model.pb frozen_model.pth out_file md.out out_freq 100
  • Convert models between backends, using dp convert-backend, if both backends support a model:
dp convert-backend frozen_model.pb frozen_model.pth
dp convert-backend frozen_model.pth frozen_model.pb
  • Add a new backend to DeePMD-kit much more quickly if you want to contribute to DeePMD-kit.

PyTorch backend: a backend designed for large atomic models and new research

We added the PyTorch backend in DeePMD-kit v3 to support the development of new models, especially for large atomic models.

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

DPA-2 model is a novel architecture for Large Atomic Model (LAM) and can accurately represent a diverse range of chemical systems and materials, enabling high-quality simulations and predictions with significantly reduced efforts compared to traditional methods. The DPA-2 model is only implemented in the PyTorch backend. An example configuration is in the examples/water/dpa2 directory.

The DPA-2 descriptor includes two primary components: repinit and repformer. The detailed architecture is shown in the following figure.

DPA-2

Training strategies for large atomic models

The PyTorch backend has supported multiple training strategies to develop large atomic models.

Parallel training: Large atomic models have a number of hyper-parameters and complex architecture, so training a model on multiple GPUs is necessary. Benefiting from the PyTorch community ecosystem, the parallel training for the PyTorch backend can be driven by torchrun, a launcher for distributed data parallel.

torchrun --nproc_per_node=4 --no-python dp --pt train input.json

Multi-task training: Large atomic models are trained against data in a wide scope and at different DFT levels, which requires multi-task training. The PyTorch backend supports multi-task training, sharing the descriptor between different An example is given in examples/water_multi_task/pytorch_example/input_torch.json.

Finetune: Fine-tune is useful to train a pre-train large model on a smaller, task-specific dataset. The PyTorch backend has supported --finetune argument in the dp --pt train command line.

Developing new models using Python and dynamic graphs

Researchers may feel pain about the static graph and the custom C++ OPs from the TensorFlow backend, which sacrifices research convenience for computational performance. The PyTorch backend has a well-designed code structure written using the dynamic graph, which is currently 100% written with the Python language, making extending and debugging new deep potential models easier than the static graph.

Supporting traditional deep potential models

People may still want to use the traditional models already supported by the TensorFlow backend in the PyTorch backend and compare the same model among different backends. We almost rewrote all of the traditional models in the PyTorch backend, which are listed below:

  • Features supported:
    • Descriptor: se_e2_a, se_e2_r, se_atten, hybrid;
    • Fitting: energy, dipole, polar, fparam/apram support
    • Model: standard, DPRc
    • Python inference interface
    • C++ inference interface for energy only
    • TensorBoard
  • Features not supported yet:
    • Descriptor: se_e3, se_atten_v2, se_e2_a_mask
    • Fitting: dos
    • Model: linear_ener, DPLR, pairtab, linear_ener, frozen, pairwise_dprc, ZBL, Spin
    • Model compression
    • Python inference interface for DPLR
    • C++ inference interface for tensors and DPLR
    • Paralleling training using Horovod
  • Features not planned:
    • Descriptor: loc_frame, se_e2_a + type embedding, se_a_ebd_v2
    • NVNMD

Warning

As part of an alpha release, the PyTorch backend's API or user input arguments may change before the first stable version.

DP backend and format: reference backend for other backends

DP is a reference backend for development that uses pure NumPy to implement models without using any heavy deep-learning frameworks. It cannot be used for training but only for Python inference. As a reference backend, it is not aimed at the best performance but only the correct results. The DP backend uses HDF5 to store model serialization data, which is backend-independent.
The DP backend and the serialization data are used in the unit test to ensure different backends have consistent results and can be converted between each other.
In the current version, the DP backend has a similar supporting status to the PyTorch backend, while DPA-1 and DPA-2 are not supported yet.

Authors

The above highlights were mainly contributed by

Breaking changes

  • Python 3.7 support is dropped. by @njzjz in #3185
  • 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.
  • Python class DeepTensor (including DeepDiople and DeepPolar) now returns atomic tensor in the dimension of natoms instead of nsel_atoms. by @njzjz in #3390
  • For developers: 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. by @njzjz in #3177, #3178

Other changes

Enhancement

  • Neighbor stat for the TensorFlow backend is 80x accelerated. by @njzjz in #3275
  • i-PI: remove normalize_coord by @njzjz in #3257
  • LAMMPS: fix_dplr.cpp delete redundant setup and set atom->image when pre_force by @shiruosong in #3344, #3345
  • Bump scikit-build-core to 0.8 by @njzjz in #3369
  • Bump LAMMPS to stable_2Aug2023_update3 by @njzjz in #3399
  • Add fparam/aparam support for fine-tune by @njzjz in #3313
  • TF: remove freeze warning for optional nodes by @njzjz in #3381

CI/CD

Bugfix

  • Fix TF 2.16 compatibility by @njzjz in #3343
  • Detect version in advance before building deepmd-kit-cu11 by @njzjz in #3172
  • C API: change the required shape of electric field to nloc * 3 by @njzjz in #3237

New Contributors

Full Changelog: https://github.com/deepmodeling/de...

Read more

v2.2.9

04 Feb 20:12
Compare
Choose a tag to compare

What's Changed

Bugfixes

  • cc: fix returning type of sel_types by @njzjz in #3181
  • fix compile gromacs with precompiled C library by @njzjz in #3217
  • gmx: fix include directive by @njzjz in #3221
  • c: fix all memory leaks; add sanitizer checks in #3223

CI/CD

  • build macos-arm64 wheel on M1 runners by @njzjz in #3206

Full Changelog: v2.2.8...v2.2.9

v2.2.8

23 Jan 03:41
b875ea8
Compare
Choose a tag to compare

What's Changed

Breaking Changes

  • breaking(lmp): do not apply scale factor to model deviation by @njzjz in #3036

New Features

  • build neighbor list with external Python program by @njzjz in #3046
  • nvnmd: init-model feature and 256 neighbors by @LiuGroupHNU in #3058
  • Add pairwise tabulation as an independent model by @njzjz in #3101

Enhancement

Documentation

  • docs: add theory from v2 paper by @njzjz in #2715
  • docs: configuring automatically generated release notes by @njzjz in #2975
  • docs: use relative links by @njzjz in #2976
  • docs: remove lammps.md by @njzjz in #2986
  • docs: document horovod on Conda-Forge by @njzjz in #3001
  • docs: document external neighbor list by @njzjz in #3056
  • docs: update documentation for pre-compiled C library by @njzjz in #3083
  • docs: update Amber interface by @njzjz in #3074
  • docs: document CP2K interface by @njzjz in #3158

Build and release

Bug fixings

  • fix SpecifierSet behavior with prereleases by @njzjz in #2959
  • fix restarting from compressed training with type embedding by @njzjz in #2996
  • Add the missing initializations for extra embedding variables by @nahso in #3005
  • Fix macro issue with multiple arguments by @njzjz in #3016
  • fix se_a_ebd_v2 when nloc != nall by @njzjz in #3037
  • fix: invalid read and write when natom grows by @Cloudac7 in #3031
  • fix GPU mapping error for Horovod + finetune by @njzjz in #3048
  • lmp: Register styles when using CMake by @njzjz in #3097
  • fix segfault in ~Region by @njzjz in #3108
  • lmp: fix evflag initialization by @njzjz in #3133
  • cmake: fix setting CMAKE_HIP_FLAGS by @njzjz in #3155
  • Fix max nbor size related issues by @denghuilu in #3157
  • Fix possible memory leak in constructors by @njzjz in #3062
  • fix memory leaks related to char* by @njzjz in #3063
  • Update the path to training and validation data dir in zinc_se_a_mask.json by @dingye18 in #3068
  • Fix catching by value by @njzjz in #3077
  • resolve "Multiplication result converted to larger type" by @njzjz in #3149
  • resolve "Multiplication result converted to larger type" by @njzjz in #3159

CI/CD

Code refactor and enhancement to prepare for upcoming v3

New Contributors

Full Changelog: v2.2.7...v2.2.8

v2.2.7

27 Oct 19:33
839f4fe
Compare
Choose a tag to compare

New features

Enhancement

  • argcheck: restrict the type of elements in a list by @njzjz in #2945
  • reformat func for further merging with pt version by @zxysbsbzxy in #2946

Build and release

  • deploy developed Python packages to GitHub Pages by @njzjz in #2932

Bug fix

New Contributors

Full Changelog: v2.2.6...v2.2.7

v2.2.6

13 Oct 05:03
2fe6927
Compare
Choose a tag to compare

We list critical bugs in previous versions in #2866.

New features

  • apply compression for se_e2_a_tebd by @nahso in #2841
  • cmake: support LAMMPS in built-in mode; remove kspace requirement by @njzjz in #2891
  • support neighbor stat on GPUs by @njzjz in #2897
  • Add dpgui entry point and dp gui CLI by @njzjz in #2904

Enhancement

Bugfixes

CI/CD

  • fix cuda installation for building wheels by @njzjz in #2879
  • fix source distribution version in build-wheel.yml by @njzjz in #2883
  • run Test CUDA in container by @njzjz in #2892
  • fix a typo in tool.cibuildwheel.linux.environment by @njzjz in #2896

Documentation

  • docs: update DPRc examples to make it compressible by @njzjz in #2874
  • docs: add easy install development version by @njzjz in #2880
  • docs: replace relative URLs in PyPI documentation by @njzjz in #2885
  • docs: mpirun --version to get MPI version by @njzjz in #2915

Full Changelog: v2.2.5...v2.2.6

v2.2.5

27 Sep 02:26
477b785
Compare
Choose a tag to compare

New features

Merge cuda and rocm code

Enhancement

  • lmp: throw error for traditional installation if dependent packages are not installed by @njzjz in #2777
  • lmp: add the header for atomic model deviation by @njzjz in #2778
  • check status of allocate_temp by @njzjz in #2782
  • do not sort atoms in dp test by @njzjz in #2794
  • lmp: fix_dplr use the same type_map from pair_deepmd by @njzjz in #2776
  • check status of allocate_temp by @njzjz in #2797
  • fix np.loadtxt DeprecationWarning by @njzjz in #2802
  • ndarray.tostring -> ndarray.tobytes by @njzjz in #2814
  • tf.accumulate_n -> tf.add_n by @njzjz in #2815
  • tf.test.TestCase.test_session -> tf.test.TestCase.cached_session by @njzjz in #2816
  • make the pairwise DPRc model 2x faster by @njzjz in #2833
  • prod_env_mat: allocate GPU memory out of frame loop by @njzjz in #2832
  • refactor model version convert by @njzjz in #2854
  • bump LAMMPS version to stable_2Aug2023_update1 by @njzjz in #2859

Documentation

Build and release

Bug fixing

  • fix dp test atomic polar; add UTs for dp test by @njzjz in #2785
  • ignore drdq when generalized force loss is not set by @njzjz in #2807
  • lmp: let fparam_do_compute not execute by default by @Yi-FanLi in #2819
  • Fix invalid escape sequence by @njzjz in #2820
  • fix missing version file with setuptools-scm v8 by @njzjz in #2850
  • fix compatibility with NumPy 1.26 by @njzjz in #2853
  • fix finetune RMSE and memory issue by @njzjz in #2860
  • fix the issue of applying modifier multiple times when batch set is load only once by @wanghan-iapcm in #2864

Full Changelog: v2.2.4...v2.2.5

v2.2.4

31 Aug 23:49
6cf7544
Compare
Choose a tag to compare

Breaking changes

  • breaking: dp test all data by default by @njzjz in #2756

New features

Enhancement

Bug fixings

  • fix documentation url in pyproject.toml by @njzjz in #2742
  • fix bug in deepmd.infer.deep_pot.DeepPot by @ChiahsinChu in #2731
  • Use module.__path__[0] instead of module.__file__ by @njzjz in #2769

New Contributors

Full Changelog: v2.2.3...v2.2.4

v2.2.3

08 Aug 05:00
53a1078
Compare
Choose a tag to compare

Breaking changes

  • breaking(lmp): fix definition of cvatom by @njzjz in #2678
  • breaking: change the default value of rcond from 1e-3 to None by @njzjz in #2688
  • breaking: add energy bias to tab potential by @njzjz in #2670

New features

Enhancement

  • refactor: uncouple Descriptor and Fitting from Trainer by @njzjz in #2549
  • ProdEnvMatAMixOp: move filter_ftype out of nsamples loop by @njzjz in #2604
  • set specific mesh shapes for mixed type by @njzjz in #2481
  • add SPDX ID to each file by @njzjz in #2639
  • insert license to C++ header files by @njzjz in #2652
  • Enhance the precision in the data format conversion tool raw_to_set.sh by @Vibsteamer in #2654
  • improve CLI performance by @njzjz in #2696
  • raise error if both v1 and v2 parameters are given by @njzjz in #2714
  • symlink model.ckpt.* to relative paths by @njzjz in #2720

Documentation

Build and release

  • remove unnecessary files from pypi source distribution by @njzjz in #2565
  • fix deepspin.pbtxt by @hztttt in #2566
  • reduce model size for dplr unittest by @Yi-FanLi in #2561
  • Add unittest for dp_ipi by @njzjz in #2574
  • Reduce dp mask pb size and fix bug in dim_fparam/dim_aparam fetching by @dingye18 in #2588
  • fix large files checking by @njzjz in #2564
  • apply the C4 rule (flake8-comprehensions) by @njzjz in #2610
  • build macOS arm64 wheels by @njzjz in #2616
  • fix uploading C++ coverage for test_python workflow by @njzjz in #2622
  • Insert braces after control statements in C++ by @njzjz in #2629
  • cmake: migrate from FindCUDA to CUDA language by @njzjz in #2634
  • set cmake_minimum_required for CUDA/ROCm by @njzjz in #2695
  • report code coverage for cli by @njzjz in #2719
  • bump lammps to stable_2Aug2023 by @njzjz in #2717

Bug fixings

  • cmake: fix a typo in nodejs cmake file by @njzjz in #2563
  • fix dplr: correct type check in get_valid_pairs by @Yi-FanLi in #2580
  • fix_dplr: make pppm_dplr optional by @Yi-FanLi in #2581
  • fix the missing modifier issue of dp compress by @Yi-FanLi in #2591
  • Reduce dp mask pb size and fix bug in dim_fparam/dim_aparam fetching by @dingye18 in #2588
  • import deepmd.op in infer.data_modifier by @Yi-FanLi in #2592
  • fix memory leaking in test_env_mat_a_mix.cc by @njzjz in #2596
  • pass ntypes to sub descriptors in the hybrid descriptor by @njzjz in #2611
  • fix se_atten variable names when suffix is given by @njzjz in #2631
  • fix hybrid compute stat when using mixed_type by @iProzd in #2614
  • fix se_atten compression when suffix is given by @njzjz in #2635
  • docs: fix the link of DOI badge by @njzjz in #2643
  • synchronize in the beginning of all CUDA functions by @njzjz in #2661
  • fix: sort aparam in the Python API by @njzjz in #2666
  • fix: sort aparam in the C++ API by @njzjz in #2667
  • fix se_atten tabulate when exclude_types is given by @njzjz in #2679
  • fix TestDeepPotAPBCExcludeTypes by @njzjz in #2680
  • make only the local GPU visible by @njzjz in #2716

New Contributors

Full Changelog: v2.2.2...v2.2.3

v2.2.2

24 May 05:58
92ca097
Compare
Choose a tag to compare

New features

C and header only C++

  • C API: support fparam and aparam for DeepPot by @njzjz in #2415
  • add read_file_to_string to C API by @njzjz in #2412
  • C: support fparam/aparam for DP model devi by @njzjz in #2486
  • C: add select_by_type and select_map by @njzjz in #2491
  • hpp: add compute_avg, compute_std, etc by @njzjz in #2493
  • migrate from C API to hpp API by @njzjz in #2506
  • allow building lmp/gmx from pre-compiled C library by @njzjz in #2514
  • c: pass errors for read_file_to_string by @njzjz in #2547

Build and release

Enhancements

  • Docs: Fix typo in parallel-training.md by @caic99 in #2438
  • docs: add links to documentation in LAMMPS input by @njzjz in #2453
  • Create DeePMD-kit_Quick_Start_Tutorial_EN.ipynb by @Q-Query in #2459
  • use error->one for get_file_content
    by @njzjz in #2473
  • improve citation information by @njzjz in #2474
  • lmp: extract deepmd version information to a seperated file by @njzjz in #2480
  • docs: fix the link to the bib file by @njzjz in #2485
  • add tests for dos training example by @mingzhong15 in #2488
  • lmp: remove codes to calculate energy deviation by @njzjz in #2492
  • Add training_data key in zinc_se_a_mask.json by @dingye18 in #2489
  • clean unused methods in C++ API by @njzjz in #2498
  • print model deviation of total energy per atom in dp model_devi by @njzjz in #2501
  • raise a clear message when no set is found in a system by @njzjz in #2503
  • catch tf.errors.CancelledError for OOM by @njzjz in #2504
  • lmp: add tests for compute deeptensor/atom by @njzjz in #2507
  • improve messages for model compatability
    by @njzjz in #2518
  • lmp/ipi: remove float precision by @njzjz in #2519
  • remove warnings of batch size for mixed systems training by @njzjz in #2470
  • remove unmaintained dp config by @njzjz in #2540
  • docs: add train-energy-spin and train-fitting-dos to toctree by @njzjz in #2546
  • Dplr unittest by @Yi-FanLi in #2545

Bug fixings

New Contributors

Full Changelog: v2.2.1...v2.2.2