Skip to content

Commit 70bc6d8

Browse files
authored
[r3.0] release v3.0.2 (#4589)
This patch version only contains bug fixes, enhancements, and documentation improvements. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added Sphinx-powered documentation support. - Introduced a new test suite for dipole model evaluation. - **Bug Fixes** - Enhanced error handling for GPU support in custom operations. - **Refactor** - Upgraded key dependencies to version 2.6.0 and refined tensor operations for improved clarity and performance. - Streamlined continuous integration settings, including simplified runner selection for ARM builds and enhanced error handling. - **Documentation** - Updated default environment settings and reference links to reflect current publications. - Added a new section on using the PyTorch Profiler with TensorBoard. - **Tests & Chores** - Refined test comparisons and adjusted build configurations for enhanced stability. - Added new import for `torch._dynamo` in test files. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2 parents e5eac4a + b59bc33 commit 70bc6d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+460
-99
lines changed

.devcontainer/download_libtorch.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ set -ev
44
SCRIPT_PATH=$(dirname $(realpath -s $0))
55
cd ${SCRIPT_PATH}/..
66

7-
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.5.0%2Bcpu.zip -O ~/libtorch.zip
7+
wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.6.0%2Bcpu.zip -O ~/libtorch.zip
88
unzip ~/libtorch.zip

.github/workflows/build_wheel.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,8 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
jobs:
17-
determine-arm64-runner:
18-
runs-on: ubuntu-latest
19-
permissions: read-all
20-
outputs:
21-
runner: ${{ steps.set-runner.outputs.runner }}
22-
steps:
23-
- name: Determine which runner to use for ARM64 build
24-
id: set-runner
25-
run: |
26-
if [ "${{ github.repository_owner }}" == "deepmodeling" ]; then
27-
echo "runner=[\"Linux\",\"ARM64\"]" >> $GITHUB_OUTPUT
28-
else
29-
echo "runner=\"ubuntu-latest\"" >> $GITHUB_OUTPUT
30-
fi
31-
3217
build_wheels:
3318
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
34-
needs: determine-arm64-runner
3519
runs-on: ${{ matrix.os }}
3620
strategy:
3721
fail-fast: false
@@ -65,7 +49,7 @@ jobs:
6549
platform_id: win_amd64
6650
dp_variant: cpu
6751
# linux-aarch64
68-
- os: ${{ fromJson(needs.determine-arm64-runner.outputs.runner) }}
52+
- os: ubuntu-24.04-arm
6953
python: 310
7054
platform_id: manylinux_aarch64
7155
dp_variant: cpu

.github/workflows/test_cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- run: python -m pip install uv
3030
- name: Install Python dependencies
3131
run: |
32-
source/install/uv_with_retry.sh pip install --system tensorflow-cpu
32+
source/install/uv_with_retry.sh pip install --system tensorflow-cpu~=2.18.0 jax==0.5.0
3333
export TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
3434
source/install/uv_with_retry.sh pip install --system -e .[cpu,test,lmp,jax] mpi4py
3535
- name: Convert models

.github/workflows/test_cuda.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ jobs:
4747
&& sudo apt-get -y install cuda-12-3 libcudnn8=8.9.5.*-1+cuda12.3
4848
if: false # skip as we use nvidia image
4949
- run: python -m pip install -U uv
50-
- run: source/install/uv_with_retry.sh pip install --system "tensorflow~=2.18.0rc2" "torch~=2.5.0" "jax[cuda12]"
50+
- run: source/install/uv_with_retry.sh pip install --system "tensorflow~=2.18.0rc2" "torch~=2.6.0" "jax[cuda12]==0.5.0"
5151
- run: |
5252
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
5353
export TENSORFLOW_ROOT=$(python -c 'import importlib,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
54-
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py
54+
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit
5555
env:
5656
DP_VARIANT: cuda
5757
DP_ENABLE_NATIVE_OPTIMIZATION: 1
@@ -67,7 +67,7 @@ jobs:
6767
run: source/tests/infer/convert-models.sh
6868
- name: Download libtorch
6969
run: |
70-
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.5.0%2Bcu124.zip -O libtorch.zip
70+
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.6.0%2Bcu124.zip -O libtorch.zip
7171
unzip libtorch.zip
7272
- run: |
7373
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/libtorch

.github/workflows/test_python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ jobs:
2525
python-version: ${{ matrix.python }}
2626
- run: python -m pip install -U uv
2727
- run: |
28-
source/install/uv_with_retry.sh pip install --system openmpi tensorflow-cpu
28+
source/install/uv_with_retry.sh pip install --system openmpi tensorflow-cpu~=2.18.0
2929
source/install/uv_with_retry.sh pip install --system torch -i https://download.pytorch.org/whl/cpu
3030
export TENSORFLOW_ROOT=$(python -c 'import tensorflow;print(tensorflow.__path__[0])')
3131
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
32-
source/install/uv_with_retry.sh pip install --system -e .[test,jax] mpi4py
32+
source/install/uv_with_retry.sh pip install --system -e .[test,jax] mpi4py "jax==0.5.0;python_version>='3.10'"
3333
source/install/uv_with_retry.sh pip install --system horovod --no-build-isolation
3434
env:
3535
# Please note that uv has some issues with finding

.readthedocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ build:
1010
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r doc/requirements.txt
1111
apt_packages:
1212
- inkscape
13+
sphinx:
14+
configuration: doc/conf.py
1315
formats:
1416
- pdf

CITATIONS.bib

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ @article{Zeng_JChemPhys_2023_v159_p054801
4040
doi = {10.1063/5.0155600},
4141
}
4242

43+
@article{Zeng_arXiv_2025_p2502.19161,
44+
annote = {general purpose},
45+
author = {
46+
Jinzhe Zeng and Duo Zhang and Anyang Peng and Xiangyu Zhang and Sensen He
47+
and Yan Wang and Xinzijian Liu and Hangrui Bi and Yifan Li and Chun Cai and
48+
Chengqian Zhang and Yiming Du and Jia-Xin Zhu and Pinghui Mo and Zhengtao
49+
Huang and Qiyu Zeng and Shaochen Shi and Xuejian Qin and Zhaoxi Yu and
50+
Chenxing Luo and Ye Ding and Yun-Pei Liu and Ruosong Shi and Zhenyu Wang
51+
and Sigbj{\o}rn L{\o}land Bore and Junhan Chang and Zhe Deng and Zhaohan
52+
Ding and Siyuan Han and Wanrun Jiang and Guolin Ke and Zhaoqing Liu and
53+
Denghui Lu and Koki Muraoka and Hananeh Oliaei and Anurag Kumar Singh and
54+
Haohui Que and Weihong Xu and Zhangmancang Xu and Yong-Bin Zhuang and Jiayu
55+
Dai and Timothy J. Giese and Weile Jia and Ben Xu and Darrin M. York and
56+
Linfeng Zhang and Han Wang
57+
},
58+
title = {
59+
{DeePMD-kit v3: A Multiple-Backend Framework for Machine Learning
60+
Potentials}
61+
},
62+
journal = {arXiv},
63+
year = 2025,
64+
pages = {2502.19161},
65+
doi = {10.48550/arXiv.2502.19161},
66+
}
67+
4368
@article{Lu_CompPhysCommun_2021_v259_p107624,
4469
annote = {GPU support},
4570
title = {

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ If you use this code in any future publications, please cite the following publi
3636
- Jinzhe Zeng, Duo Zhang, Denghui Lu, Pinghui Mo, Zeyu Li, Yixiao Chen, Marián Rynik, Li'ang Huang, Ziyao Li, Shaochen Shi, Yingze Wang, Haotian Ye, Ping Tuo, Jiabin Yang, Ye Ding, Yifan Li, Davide Tisi, Qiyu Zeng, Han Bao, Yu Xia, Jiameng Huang, Koki Muraoka, Yibo Wang, Junhan Chang, Fengbo Yuan, Sigbjørn Løland Bore, Chun Cai, Yinnian Lin, Bo Wang, Jiayan Xu, Jia-Xin Zhu, Chenxing Luo, Yuzhi Zhang, Rhys E. A. Goodall, Wenshuo Liang, Anurag Kumar Singh, Sikai Yao, Jingchao Zhang, Renata Wentzcovitch, Jiequn Han, Jie Liu, Weile Jia, Darrin M. York, Weinan E, Roberto Car, Linfeng Zhang, Han Wang. "DeePMD-kit v2: A software package for deep potential models." J. Chem. Phys. 159 (2023): 054801.
3737
[![doi:10.1063/5.0155600](https://img.shields.io/badge/DOI-10.1063%2F5.0155600-blue)](https://doi.org/10.1063/5.0155600)
3838
[![Citations](https://citations.njzjz.win/10.1063/5.0155600)](https://badge.dimensions.ai/details/doi/10.1063/5.0155600)
39+
- Jinzhe Zeng, Duo Zhang, Anyang Peng, Xiangyu Zhang, Sensen He, Yan Wang, Xinzijian Liu, Hangrui Bi, Yifan Li, Chun Cai, Chengqian Zhang, Yiming Du, Jia-Xin Zhu, Pinghui Mo, Zhengtao Huang, Qiyu Zeng, Shaochen Shi, Xuejian Qin, Zhaoxi Yu, Chenxing Luo, Ye Ding, Yun-Pei Liu, Ruosong Shi, Zhenyu Wang, Sigbjørn Løland Bore, Junhan Chang, Zhe Deng, Zhaohan Ding, Siyuan Han, Wanrun Jiang, Guolin Ke, Zhaoqing Liu, Denghui Lu, Koki Muraoka, Hananeh Oliaei, Anurag Kumar Singh, Haohui Que, Weihong Xu, Zhangmancang Xu, Yong-Bin Zhuang, Jiayu Dai, Timothy J. Giese, Weile Jia, Ben Xu, Darrin M. York, Linfeng Zhang, Han Wang. "DeePMD-kit v3: A Multiple-Backend Framework for Machine Learning Potentials." [arXiv:2502.19161](https://arxiv.org/abs/2502.19161).
3940

4041
In addition, please follow [the bib file](CITATIONS.bib) to cite the methods you used.
4142

@@ -68,14 +69,16 @@ In addition to building up potential energy models, DeePMD-kit can also be used
6869
- Non-von-Neumann.
6970
- C API to interface with the third-party packages.
7071

71-
See [our latest paper](https://doi.org/10.1063/5.0155600) for details of all features until v2.2.3.
72+
See [our v2 paper](https://doi.org/10.1063/5.0155600) for details of all features until v2.2.3.
7273

7374
#### v3
7475

7576
- Multiple backends supported. Add PyTorch and JAX backends.
7677
- The DPA-2 model.
7778
- Plugin mechanisms for external models.
7879

80+
See [our v3 paper](https://doi.org/10.48550/arXiv.2502.19161) for details of all features until v3.0.
81+
7982
## Install and use DeePMD-kit
8083

8184
Please read the [online documentation](https://deepmd.readthedocs.io/) for how to install and use DeePMD-kit.

backend/find_pytorch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def get_pt_requirement(pt_version: str = "") -> dict:
116116
cuda_version = os.environ.get("CUDA_VERSION", "12.2")
117117
if cuda_version == "" or cuda_version in SpecifierSet(">=12,<13"):
118118
# CUDA 12.2, cudnn 9
119-
pt_version = "2.5.0"
119+
pt_version = "2.6.0"
120120
elif cuda_version in SpecifierSet(">=11,<12"):
121121
# CUDA 11.8, cudnn 8
122122
pt_version = "2.3.1"

deepmd/dpmodel/descriptor/dpa1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -899,6 +899,7 @@ def call(
899899
exclude_mask = self.emask.build_type_exclude_mask(nlist, atype_ext)
900900
# nfnl x nnei
901901
exclude_mask = xp.reshape(exclude_mask, (nf * nloc, nnei))
902+
exclude_mask = xp.astype(exclude_mask, xp.bool)
902903
# nfnl x nnei
903904
nlist = xp.reshape(nlist, (nf * nloc, nnei))
904905
nlist = xp.where(exclude_mask, nlist, xp.full_like(nlist, -1))

0 commit comments

Comments
 (0)