Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
199 commits
Select commit Hold shift + click to select a range
d224fdd
fix: fix `DPH5Path.glob` for new keys (#4152)
njzjz Sep 21, 2024
f34cbe1
feat(pt/tf): support spin lammps plugin
iProzd Sep 21, 2024
532e309
fix(pt): make `state_dict` safe for `weights_only` (#4148)
iProzd Sep 21, 2024
6010c73
chore(pt): move `deepmd.pt.infer.deep_eval.eval_model` to tests (#4153)
njzjz Sep 21, 2024
d5b544b
update typo
iProzd Sep 21, 2024
dd331fd
update pt backend
iProzd Sep 22, 2024
31bafb1
rm extend from pair-deepmd
iProzd Sep 22, 2024
f5cfeab
fix(pt): fix `compute_output_stats_global` when `atomic_output` is `N…
njzjz Sep 23, 2024
0b72dae
feat(jax): support neural networks (#4156)
njzjz Sep 23, 2024
15150f6
fix tf interface for spin
hztttt Sep 23, 2024
bdfe205
fix interface for multi model
hztttt Sep 23, 2024
508759c
fix(pt ut): make separated uts deterministic (#4162)
iProzd Sep 25, 2024
0b3f860
fix(pt): finetuning property/dipole/polar/dos fitting with multi-dime…
Chengqian-Zhang Sep 25, 2024
ab48d90
Feat: output logs on freezing models (#4165)
caic99 Sep 27, 2024
be59313
support spin_norm & virtual_len in model graph and fix bug
hztttt Sep 25, 2024
94fe957
chore: change econf embed to spin representation (#4166)
wanghan-iapcm Sep 27, 2024
ad8bebe
[pre-commit.ci] pre-commit autoupdate (#4159)
pre-commit-ci[bot] Sep 27, 2024
ec7c16b
fix pt
iProzd Sep 28, 2024
6524e5e
Update pair_deepmd.cpp
iProzd Sep 28, 2024
a9ffccb
fix: unpin h5py on aarch64 (#4176)
njzjz Oct 2, 2024
7ce5b03
chore: bump LAMMPS to stable_29Aug2024_update1 (#4179)
njzjz Oct 2, 2024
192a97a
breaking: drop Python 3.8 support (#4185)
njzjz Oct 6, 2024
c90c4e1
fix(tf): set visible_device_list for TF C++ (#4172)
njzjz Oct 6, 2024
a0747b9
fix(tf): throw errors when loc_cellnum is 0 (#4180)
njzjz Oct 6, 2024
2feb21c
[pre-commit.ci] pre-commit autoupdate (#4173)
pre-commit-ci[bot] Oct 7, 2024
d667929
docs: add documentation for installation requirements of DPA-2 (#4178)
njzjz Oct 7, 2024
dcdd804
chore: use `functools.cached_property` for cached properties (#4187)
njzjz Oct 8, 2024
b807bb4
docs: document more for multiprocessing (#4190)
njzjz Oct 8, 2024
9a15bc0
[pre-commit.ci] pre-commit autoupdate (#4192)
pre-commit-ci[bot] Oct 8, 2024
3939786
feat(jax/array-api): dpa1 (#4160)
njzjz Oct 9, 2024
61f1681
Feat (pt): Expose Linear Ener Model (#4194)
anyangml Oct 11, 2024
2ca1c06
chore: cache `deserialized_module` and `script_module` (#4196)
njzjz Oct 11, 2024
8174cf1
chore(ci): skip more tests on GPU CI (#4200)
njzjz Oct 11, 2024
c10bc3c
chore(tf): filter TF deprecation warnings (#4199)
njzjz Oct 13, 2024
8279cca
feat(jax/array-api): energy fitting (#4204)
njzjz Oct 13, 2024
a1f8672
Chore: refactor get standard model (#4205)
anyangml Oct 14, 2024
2c66443
fix tensorflow bug
iProzd Oct 14, 2024
4f3d9d4
fix mag force bug
iProzd Oct 14, 2024
6fe8dde
ci: pin ubuntu to 22.04 (#4213)
njzjz Oct 15, 2024
48f8a1e
feat(pt): support `DeepEval.eval_descriptor` (#4214)
njzjz Oct 15, 2024
5c092e6
fix: fix average training time for restart (#4212)
njzjz Oct 15, 2024
16172e6
fix(pt): keep mapping not none during lmp steps when nghost == 0 (#4209)
CaRoLZhangxy Oct 15, 2024
d24d7e7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 15, 2024
593bf81
Update c_api.h
iProzd Oct 15, 2024
3466e34
Update c_api.h
iProzd Oct 15, 2024
cfb4731
feat(jax/array-api): se_e2_a (#4217)
njzjz Oct 16, 2024
5050f61
feat(jax/array-api): DOS fitting (#4218)
njzjz Oct 16, 2024
d7d2210
fix(pt): make PT training step idx consistent with TF (#4221)
njzjz Oct 16, 2024
af86b57
Chore(pt): refactor the command function interface (#4225)
iProzd Oct 16, 2024
2871fec
Chore(pt):rm old pt implementation (#4223)
iProzd Oct 17, 2024
1e1090a
chore(lmp): add LAMMPS DPA-2 nopbc tests (#4220)
njzjz Oct 17, 2024
cc4b23d
chore: move `LearningRateExp` to `deepmd.utils.learning_rate` (#4219)
njzjz Oct 17, 2024
c3a4f3e
extend sendlist nlist and other tensors but still bugs
CaRoLZhangxy Oct 18, 2024
e2e1e55
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2024
c2944eb
fix(pt): remove deprecating torch.norm (#4233)
wanghan-iapcm Oct 20, 2024
cf85275
revert `extend sendlist nlist`
iProzd Oct 21, 2024
1d6defe
fix spin communication in lammps
iProzd Oct 21, 2024
2a38025
Merge branch 'devel' into spin_lmp
iProzd Oct 21, 2024
e5c0ecf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 21, 2024
85c934b
Update spin_model.py
iProzd Oct 22, 2024
35fd1c6
Update spin.py
iProzd Oct 22, 2024
11aeb17
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
b4701da
[pre-commit.ci] pre-commit autoupdate (#4235)
pre-commit-ci[bot] Oct 22, 2024
6c5cb1d
add ut for spin c++
iProzd Oct 22, 2024
474a2b0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 22, 2024
114898f
bump version
iProzd Oct 22, 2024
c2515ed
feat(jax): energy model (no grad support) (#4226)
njzjz Oct 23, 2024
dccb0e5
docs: fix docs for CMAKE_ARGS (#4238)
njzjz Oct 23, 2024
911f41b
fix(pt): set `weights_only=True` for `torch.load` (#4147)
njzjz Oct 23, 2024
b8e57f2
docs: fix parameter links (#4239)
njzjz Oct 23, 2024
18026eb
fix(cc): fix message passing when nghost is 0 and send list is empty …
CaRoLZhangxy Oct 23, 2024
a74d963
feat(pt): support CPU parallel training with PT (#4224)
iProzd Oct 23, 2024
8e77785
ci: limit downloaded files in build_docker (#4242)
njzjz Oct 23, 2024
b78832d
fix(pt): make int `rcut` safe after jit op (#4222)
iProzd Oct 23, 2024
0fa1b43
style: enable TorchFix in pre-commit (#4230)
njzjz Oct 23, 2024
c2d0560
Chore(pt): slim uts for dpa1 (#4244)
iProzd Oct 23, 2024
0f817e1
style: extend no-explicit-dtype check to xp and jnp (#4247)
njzjz Oct 23, 2024
c870ccf
fix(np/pt): explicit dtype and device. (#4241)
wanghan-iapcm Oct 24, 2024
4d50048
feat(jax): checkpoint I/O (#4236)
njzjz Oct 24, 2024
02580c2
ci: bump TF to 2.18, PT to 2.5 (#4228)
njzjz Oct 24, 2024
a66afd3
ci: bump tensorflow/build image to 2.18 (#4252)
njzjz Oct 25, 2024
659f90d
feat(pt): support loss plugin for external package (#4248)
ChiahsinChu Oct 26, 2024
fa61d69
feat(jax/array-api): se_e2_r (#4257)
njzjz Oct 26, 2024
fef13f5
Merge branch 'devel' into spin_lmp
iProzd Oct 26, 2024
5394854
feat(pt): support `use_aparam_as_mask` for pt backend (#4246)
ChiahsinChu Oct 26, 2024
13e247e
fix(tf): fix compress suffix in DescrptDPA1Compat (#4243)
iProzd Oct 26, 2024
aba932c
ci: skip `test_data_equal` on the GPU machine (#4260)
njzjz Oct 28, 2024
39cddd4
feat(dev): setup devcontainer for developers (#4263)
njzjz Oct 28, 2024
04e1159
fix(pt): set device for PT C++ (#4261)
njzjz Oct 28, 2024
8f546cf
docs: fix word spellings (#4264)
njzjz Oct 28, 2024
40b3ea1
docs: document the floating-point precision of the model (#4240)
njzjz Oct 28, 2024
95f0ed5
fix(lmp): apply NEIGHMASK to neighbor list (#4269)
njzjz Oct 29, 2024
abd1c9c
docs: replace sphinx-rtd-theme with sphinx-book-theme (#4266)
njzjz-bot Oct 29, 2024
b647547
[pre-commit.ci] pre-commit autoupdate (#4268)
pre-commit-ci[bot] Oct 29, 2024
82aaa0d
feat(jax): neighbor stat (#4258)
njzjz Oct 29, 2024
dd36e6c
docs: document JAX backend (#4259)
njzjz Oct 29, 2024
159361d
feat(jax): force & virial (#4251)
njzjz Oct 29, 2024
d165fee
feat(jax): freeze to StableXLO & DeepEval (#4256)
njzjz Oct 30, 2024
d4c7d1a
Spin lmp nlist (#35)
hztttt Oct 31, 2024
3afc2fd
Merge branch 'devel' into spin_lmp
iProzd Oct 31, 2024
9e82b8d
add deepspin pair style (#36)
iProzd Oct 31, 2024
5a9a0a0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
605fb9b
Update pair_deepmd.cpp
iProzd Oct 31, 2024
2cc6d8a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 31, 2024
a0b7996
Update plugin
iProzd Oct 31, 2024
0cee887
fix(lmp): update print_summary (#4271)
njzjz Oct 31, 2024
737f7c8
feat(jax/array-api): hybrid descriptor (#4275)
njzjz Oct 31, 2024
8e27d2f
feat(jax/array-api): dipole/polarizability fitting (#4278)
njzjz Oct 31, 2024
cdad312
fix(dptest): Wrong dptest results except for energy head (#4280)
Chengqian-Zhang Oct 31, 2024
0d13911
Print the reminder for the illegal memory error in the AutoBatchSize …
Yi-FanLi Oct 31, 2024
9c767ad
feat(dpmodel/jax): add entry point for dpmodel and jax backend (#4284)
njzjz Oct 31, 2024
ff04d8b
fix(dpmodel/jax): fix fparam and aparam support in DeepEval (#4285)
njzjz Oct 31, 2024
704db2f
fix(lmp): add pair_deepmd_index arg to fix dplr for multiple deepmd p…
njzjz Nov 1, 2024
3dc6fff
fix spin
iProzd Nov 1, 2024
a468819
feat(jax/array-api): property fitting (#4287)
njzjz Nov 1, 2024
5c32147
Feat: Add consistency test for ZBL between dp and pt (#4292)
anyangml Nov 1, 2024
eb2832b
feat(jax/array-api): se_e3 (#4286)
njzjz Nov 1, 2024
36aee8d
Merge branch 'devel' into spin_lmp
iProzd Nov 1, 2024
8355947
Add 4 pt descriptor compression (#4227)
cherryWangY Nov 1, 2024
c3bf841
Update pair_base.cpp
iProzd Nov 1, 2024
5451acd
Update test_deeppot_tf_spin.cc
iProzd Nov 1, 2024
319493a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 1, 2024
b1e4a03
Update build_lammps.sh
iProzd Nov 1, 2024
6a75c6b
feat(jax/array-api): se_t_tebd (#4288)
njzjz Nov 2, 2024
e1c868e
feat(jax/array-api): se_atten_v2 (#4289)
njzjz Nov 2, 2024
fb41a4f
feat(jax): atomic virial (#4290)
njzjz Nov 2, 2024
f129cff
ci: install GPU JAX in GPU CI (#4293)
njzjz Nov 2, 2024
6bc730f
Enable Hybrid Descriptor to be compressed (#4297)
cherryWangY Nov 2, 2024
25bb821
feat(jax/array-api): DPA-2 (#4294)
njzjz Nov 2, 2024
bfbe2ed
Add compression API to BaseModel and AtomicModel (#4298)
cherryWangY Nov 2, 2024
7aaf284
feat(jax): zbl (#4301)
njzjz Nov 4, 2024
de6abef
reformat C/C++ interface
iProzd Nov 4, 2024
799b4e5
rm dead code
iProzd Nov 4, 2024
643e202
fix ut
iProzd Nov 4, 2024
fb4dfe0
add virtual methods
iProzd Nov 4, 2024
38815b3
feat(jax): export call_lower to SavedModel via jax2tf (#4254)
njzjz Nov 4, 2024
4b73fbe
[pre-commit.ci] pre-commit autoupdate (#4310)
pre-commit-ci[bot] Nov 5, 2024
9ed0397
fix(cmake): Replace deprecated `FetchContent_Populate` with `FetchCon…
njzjz Nov 5, 2024
dabedd2
fix(jax): calculate virial in `call_lower` (#4304)
njzjz Nov 5, 2024
d1fd284
fix memory leak
iProzd Nov 5, 2024
99e1e05
add virtual methods
iProzd Nov 5, 2024
ae98964
Update deepmd.hpp
iProzd Nov 5, 2024
3e7501e
rename compute_spin to compute
iProzd Nov 5, 2024
2c4ca0d
update nopbc test
iProzd Nov 5, 2024
914b1f9
fix(jax): fix several serialization and jit issues for DPA-2 (#4315)
njzjz Nov 6, 2024
65aac64
fix(lmp): add `pair_deepmd_index` key to `is_key` function in dplr (#…
njzjz Nov 6, 2024
430dfa9
fix: make sure `head` can be used in `DeepPot` (#4312)
wangzyphysics Nov 6, 2024
7eab6cc
fix lmp uts and rename pair base
iProzd Nov 6, 2024
0965a70
add old c api
iProzd Nov 6, 2024
af09efd
rename base to backend
iProzd Nov 6, 2024
a532c33
rename model filename in lammps tests
njzjz Nov 6, 2024
9699349
fix dplr: support initializing from a restart file (#4084)
Yi-FanLi Nov 7, 2024
919654e
add tf nlist nopbc UT for spin
iProzd Nov 7, 2024
c30091b
add tf lmp nopbc UT for spin
iProzd Nov 7, 2024
10b163e
fix torch lmp UT bug
hztttt Nov 7, 2024
811a0b9
Merge branch 'devel' into spin_lmp
iProzd Nov 7, 2024
0039aa4
fix nopbc spin test
iProzd Nov 7, 2024
ab15e47
Merge branch 'devel' into spin_lmp
iProzd Nov 7, 2024
e572e37
Update c_api.h
iProzd Nov 7, 2024
01e7745
Update test_deeppot_a.cc
iProzd Nov 7, 2024
3d1fce6
Update test_deeppot_a.cc
iProzd Nov 7, 2024
960f71a
fix error handle
iProzd Nov 7, 2024
4d71247
rm spin from pairdeepmd
iProzd Nov 7, 2024
41ad708
make pair modification readable
iProzd Nov 7, 2024
dc0f496
add #4269
iProzd Nov 7, 2024
8fd95f8
Update pair_deepmd.cpp
iProzd Nov 7, 2024
edb1e9f
Update DeepSpinTF.cc
iProzd Nov 7, 2024
5c9fda1
rm spin args from deeppottf
iProzd Nov 7, 2024
24896f0
rm black space
iProzd Nov 7, 2024
ba46f54
rm black space and comment
iProzd Nov 7, 2024
809b471
Update DeepPot.h
iProzd Nov 7, 2024
388bb22
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 7, 2024
d20d668
resolve conversations
iProzd Nov 7, 2024
e09bf5a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 7, 2024
5f53a46
update docs
iProzd Nov 7, 2024
223502d
Update deepmd.hpp
iProzd Nov 7, 2024
1215097
add uts
iProzd Nov 8, 2024
292a68f
Update test_deepspin_a_hpp.cc
iProzd Nov 8, 2024
665f001
update uts
iProzd Nov 8, 2024
58c15ed
Update test_deepspin_a.cc
iProzd Nov 8, 2024
b481274
Update test_deepspin_a.cc
iProzd Nov 8, 2024
29ace48
Update test_deepspin_a.cc
iProzd Nov 8, 2024
e68de42
Update test_deepspin_a.cc
iProzd Nov 8, 2024
cef5817
fix space
iProzd Nov 8, 2024
2085804
Create test_deepspin_a_hpp_tf.cc
iProzd Nov 8, 2024
b367f97
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 8, 2024
b76e272
update ntypes_spin
iProzd Nov 9, 2024
68cfb94
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
ea19b35
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
43e8baf
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
82eca9a
Update test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
7c69066
add uts
iProzd Nov 9, 2024
31d69db
Delete test_deepspin_model_devi_hpp.cc
iProzd Nov 9, 2024
8fb6498
Delete test_deepspin_a_hpp_tf.cc
iProzd Nov 9, 2024
4bc0e42
Create test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
1b7c79b
Update test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
bb8d38e
Update test_deepspin_model_devi_hpp.cc
iProzd Nov 10, 2024
e6bfebe
Update deepmd.hpp
iProzd Nov 10, 2024
117f4c9
add ut for lammps atomic energy
iProzd Nov 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04

COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
35 changes: 35 additions & 0 deletions .devcontainer/READMD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# DeePMD-kit devcontainer environment

This [devcontainer](https://vscode.js.cn/docs/devcontainers/devcontainer-cli) environment setups Python and C++ environment to develop DeePMD-kit.
One can setup locally or use [GitHub Codespaces](https://docs.github.com/en/codespaces) by clicking the Code button on the DeePMD-kit repository page.
The whole setup process requires about 10 minutes, so one needs to be patient.

## Python environment

The following packages are installed into the Python environment `.venv`:

- DeePMD-kit (in edit mode)
- Backends including TensorFlow, PyTorch, JAX
- LAMMPS
- MPICH
- CMake
- pre-commit (including hooks)
- Test packages including pytest
- Doc packages including sphinx

## C++ interface

The C++ interface with TensorFlow and PyTorch support is installed into `dp` directory.

When calling and debuging LAMMPS with DeePMD-kit, use the following scripts instead of the regular `lmp`:

- `.devcontainer/lmp`
- `.devcontainer/gdb_lmp`

## Rebuild

Usually the Python package does not need to reinstall.
But when one wants to recompile the C++ code, the following scripts can be executed.

- `.devcontainer/build_cxx.sh`
- `.devcontainer/build_py.sh`
21 changes: 21 additions & 0 deletions .devcontainer/build_cxx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
set -ev

NPROC=$(nproc --all)
SCRIPT_PATH=$(dirname $(realpath -s $0))

export CMAKE_PREFIX_PATH=${SCRIPT_PATH}/../libtorch
TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')

mkdir -p ${SCRIPT_PATH}/../buildcxx/
cd ${SCRIPT_PATH}/../buildcxx/
cmake -D ENABLE_TENSORFLOW=ON \
-D ENABLE_PYTORCH=ON \
-D CMAKE_INSTALL_PREFIX=${SCRIPT_PATH}/../dp/ \
-D LAMMPS_VERSION=stable_29Aug2024_update1 \
-D CMAKE_BUILD_TYPE=Debug \
-D BUILD_TESTING:BOOL=TRUE \
-D TENSORFLOW_ROOT=${TENSORFLOW_ROOT} \
${SCRIPT_PATH}/../source
cmake --build . -j${NPROC}
cmake --install .
8 changes: 8 additions & 0 deletions .devcontainer/build_py.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ev

SCRIPT_PATH=$(dirname $(realpath -s $0))
cd ${SCRIPT_PATH}/..

uv sync --dev --python 3.12 --extra cpu --extra torch --extra jax --extra lmp --extra test --extra docs
pre-commit install
17 changes: 17 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "DeePMD-kit",
"build": {
"dockerfile": "Dockerfile"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
"postCreateCommand": ".devcontainer/build_py.sh && .devcontainer/download_libtorch.sh && .devcontainer/build_cxx.sh && pre-commit install-hooks",
"remoteEnv": {
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/.venv/bin",
"DP_ENABLE_PYTORCH": "1",
"DP_VARIANT": "cpu",
"LMP_CXX11_ABI_0": "1",
"UV_EXTRA_INDEX_URL": "https://download.pytorch.org/whl/cpu"
}
}
8 changes: 8 additions & 0 deletions .devcontainer/download_libtorch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ev

SCRIPT_PATH=$(dirname $(realpath -s $0))
cd ${SCRIPT_PATH}/..

wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.5.0%2Bcpu.zip -O ~/libtorch.zip
unzip ~/libtorch.zip
9 changes: 9 additions & 0 deletions .devcontainer/gdb_lmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SCRIPT_PATH=$(dirname $(realpath -s $0))

export CMAKE_PREFIX_PATH=${SCRIPT_PATH}/../libtorch
TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')

env LAMMPS_PLUGIN_PATH=${SCRIPT_PATH}/../dp/lib/deepmd_lmp \
LD_LIBRARY_PATH=${SCRIPT_PATH}/../dp/lib:${CMAKE_PREFIX_PATH}/lib:${TENSORFLOW_ROOT} \
gdb ${SCRIPT_PATH}/../.venv/lib/python3.12/site-packages/lammps/lmp "$@"
9 changes: 9 additions & 0 deletions .devcontainer/lmp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
SCRIPT_PATH=$(dirname $(realpath -s $0))

export CMAKE_PREFIX_PATH=${SCRIPT_PATH}/../libtorch
TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')

env LAMMPS_PLUGIN_PATH=${SCRIPT_PATH}/../dp/lib/deepmd_lmp \
LD_LIBRARY_PATH=${SCRIPT_PATH}/../dp/lib:${CMAKE_PREFIX_PATH}/lib:${TENSORFLOW_ROOT} \
${SCRIPT_PATH}/../.venv/bin/lmp "$@"
2 changes: 1 addition & 1 deletion .github/workflows/build_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Build C++
jobs:
buildcc:
name: Build C++
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
include:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: source/install/docker/dist
pattern: cibw-*-manylinux_x86_64-cu${{ matrix.cuda_version }}*
merge-multiple: true
- name: Log in to the Container registry
uses: docker/login-action@v3
Expand Down Expand Up @@ -180,6 +181,7 @@ jobs:
- uses: actions/download-artifact@v4
with:
path: dist/packages
pattern: cibw-*
merge-multiple: true
- uses: actions/setup-python@v5
name: Install Python
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
jobs:
analyze:
name: Analyze
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-22.04' }}
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/package_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
include:
- tensorflow_build_version: "2.15"
- tensorflow_build_version: "2.18"
tensorflow_version: ""
filename: libdeepmd_c.tar.gz
- tensorflow_build_version: "2.14"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ name: Test C++
jobs:
testcc:
name: Test C++
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
check_memleak: [true, false]
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ jobs:
&& sudo apt-get -y install cuda-12-3 libcudnn8=8.9.5.*-1+cuda12.3
if: false # skip as we use nvidia image
- run: python -m pip install -U uv
- run: source/install/uv_with_retry.sh pip install --system "tensorflow>=2.15.0rc0" "torch==2.3.1.*"
- run: source/install/uv_with_retry.sh pip install --system "tensorflow~=2.18.0rc2" "torch~=2.5.0" "jax[cuda12]"
- run: |
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
export TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch] mpi4py
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py
env:
DP_VARIANT: cuda
DP_ENABLE_NATIVE_OPTIMIZATION: 1
Expand All @@ -61,9 +61,11 @@ jobs:
env:
NUM_WORKERS: 0
CUDA_VISIBLE_DEVICES: 0
# See https://jax.readthedocs.io/en/latest/gpu_memory_allocation.html
XLA_PYTHON_CLIENT_PREALLOCATE: false
- name: Download libtorch
run: |
wget https://download.pytorch.org/libtorch/cu121/libtorch-cxx11-abi-shared-with-deps-2.2.1%2Bcu121.zip -O libtorch.zip
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.5.0%2Bcu124.zip -O libtorch.zip
unzip libtorch.zip
- run: |
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/libtorch
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5, 6]
python: ["3.8", "3.12"]
python: ["3.9", "3.12"]

steps:
- uses: actions/checkout@v4
Expand All @@ -25,19 +25,23 @@ jobs:
python-version: ${{ matrix.python }}
- run: python -m pip install -U uv
- run: |
source/install/uv_with_retry.sh pip install --system mpich
source/install/uv_with_retry.sh pip install --system "torch==2.3.0+cpu.cxx11.abi" -i https://download.pytorch.org/whl/
source/install/uv_with_retry.sh pip install --system openmpi tensorflow-cpu
source/install/uv_with_retry.sh pip install --system torch -i https://download.pytorch.org/whl/cpu
export TENSORFLOW_ROOT=$(python -c 'import tensorflow;print(tensorflow.__path__[0])')
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
source/install/uv_with_retry.sh pip install --system --only-binary=horovod -e .[cpu,test] horovod[tensorflow-cpu] mpi4py
source/install/uv_with_retry.sh pip install --system -e .[test,jax] mpi4py
source/install/uv_with_retry.sh pip install --system horovod --no-build-isolation
env:
# Please note that uv has some issues with finding
# existing TensorFlow package. Currently, it uses
# TensorFlow in the build dependency, but if it
# changes, setting `TENSORFLOW_ROOT`.
TENSORFLOW_VERSION: ${{ matrix.python == '3.8' && '2.13.1' || '2.16.1' }}
DP_ENABLE_PYTORCH: 1
DP_BUILD_TESTING: 1
UV_EXTRA_INDEX_URL: "https://pypi.anaconda.org/njzjz/simple https://pypi.anaconda.org/mpi4py/simple"
UV_EXTRA_INDEX_URL: "https://pypi.anaconda.org/mpi4py/simple"
HOROVOD_WITH_TENSORFLOW: 1
HOROVOD_WITHOUT_PYTORCH: 1
HOROVOD_WITH_MPI: 1
- run: dp --version
- name: Get durations from cache
uses: actions/cache@v4
Expand All @@ -53,6 +57,12 @@ jobs:
- run: pytest --cov=deepmd source/tests --durations=0 --splits 6 --group ${{ matrix.group }} --store-durations --durations-path=.test_durations --splitting-algorithm least_duration
env:
NUM_WORKERS: 0
- name: Test TF2 eager mode
run: pytest --cov=deepmd source/tests/consistent/io/test_io.py --durations=0
env:
NUM_WORKERS: 0
DP_TEST_TF2_ONLY: 1
if: matrix.group == 1
- run: mv .test_durations .test_durations_${{ matrix.group }}
- name: Upload partial durations
uses: actions/upload-artifact@v4
Expand All @@ -69,7 +79,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.12"]
python: ["3.9", "3.12"]
needs: testpython
steps:
- name: Get durations from cache
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,8 @@ build_c_tests
build_c/
libdeepmd_c/
.uv/
libtorch/
uv.lock
buildcxx/
node_modules/
*.bib.original
22 changes: 15 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: "^.+\\.pbtxt$"
Expand All @@ -29,7 +29,7 @@ repos:
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.5
rev: v0.7.2
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -38,6 +38,14 @@ repos:
- id: ruff-format
exclude: ^source/3rdparty
types_or: [python, pyi, jupyter]
- repo: https://github.com/pycqa/flake8
# flake8 cannot autofix
rev: "7.1.1"
hooks:
- id: flake8
additional_dependencies:
- torchfix==0.6.0
- flake8-pyproject==1.2.3
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
Expand All @@ -47,15 +55,15 @@ repos:
exclude: ^source/3rdparty
# Python inside docs
- repo: https://github.com/asottile/blacken-docs
rev: 1.18.0
rev: 1.19.1
hooks:
- id: blacken-docs
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.3
hooks:
- id: clang-format
exclude: ^source/3rdparty|source/lib/src/gpu/cudart/.+\.inc
exclude: ^(source/3rdparty|source/lib/src/gpu/cudart/.+\.inc|.+\.ipynb$)
# markdown, yaml, CSS, javascript
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
Expand All @@ -66,7 +74,7 @@ repos:
exclude: ^(source/3rdparty|\.github/workflows|\.clang-format)
# Shell
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.9.0-1
rev: v3.10.0-1
hooks:
- id: shfmt
# CMake
Expand Down Expand Up @@ -146,7 +154,7 @@ repos:
exclude: .pre-commit-config.yaml|source/lmp
# customized pylint rules
- repo: https://github.com/pylint-dev/pylint/
rev: v3.2.7
rev: v3.3.1
hooks:
- id: pylint
entry: env PYTHONPATH=source/checker pylint
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For more information, check the [documentation](https://deepmd.readthedocs.io/).

### Highlighted features

- **interfaced with multiple backends**, including TensorFlow and PyTorch, the most popular deep learning frameworks, making the training process highly automatic and efficient.
- **interfaced with multiple backends**, including TensorFlow, PyTorch, and JAX, the most popular deep learning frameworks, making the training process highly automatic and efficient.
- **interfaced with high-performance classical MD and quantum (path-integral) MD packages**, including LAMMPS, i-PI, AMBER, CP2K, GROMACS, OpenMM, and ABUCUS.
- **implements the Deep Potential series models**, which have been successfully applied to finite and extended systems, including organic molecules, metals, semiconductors, insulators, etc.
- **implements MPI and GPU supports**, making it highly efficient for high-performance parallel and distributed computing.
Expand Down Expand Up @@ -72,7 +72,7 @@ See [our latest paper](https://doi.org/10.1063/5.0155600) for details of all fea

#### v3

- Multiple backends supported. Add a PyTorch backend.
- Multiple backends supported. Add PyTorch and JAX backends.
- The DPA-2 model.

## Install and use DeePMD-kit
Expand Down
10 changes: 3 additions & 7 deletions backend/dp_backend.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""A PEP-517 backend to find TensorFlow."""

from typing import (
List,
)

from scikit_build_core import build as _orig

from .find_pytorch import (
Expand All @@ -26,7 +22,7 @@
]


def __dir__() -> List[str]:
def __dir__() -> list[str]:
return __all__


Expand All @@ -42,7 +38,7 @@ def __dir__() -> List[str]:

def get_requires_for_build_wheel(
config_settings: dict,
) -> List[str]:
) -> list[str]:
return (
_orig.get_requires_for_build_wheel(config_settings)
+ find_tensorflow()[1]
Expand All @@ -52,7 +48,7 @@ def get_requires_for_build_wheel(

def get_requires_for_build_editable(
config_settings: dict,
) -> List[str]:
) -> list[str]:
return (
_orig.get_requires_for_build_editable(config_settings)
+ find_tensorflow()[1]
Expand Down
Loading