Skip to content

Commit d798b33

Browse files
authored
merge devel to master (v3.1.2) (#5088)
2 parents bfa6245 + d774ede commit d798b33

169 files changed

Lines changed: 8696 additions & 447 deletions

File tree

Some content is hidden

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

.devcontainer/build_cxx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ cmake -D ENABLE_TENSORFLOW=ON \
1313
-D ENABLE_PYTORCH=ON \
1414
-D ENABLE_PADDLE=ON \
1515
-D CMAKE_INSTALL_PREFIX=${SCRIPT_PATH}/../dp/ \
16-
-D LAMMPS_VERSION=stable_22Jul2025_update1 \
16+
-D LAMMPS_VERSION=stable_22Jul2025_update2 \
1717
-D CMAKE_BUILD_TYPE=Debug \
1818
-D BUILD_TESTING:BOOL=TRUE \
1919
-D TENSORFLOW_ROOT=${TENSORFLOW_ROOT} \

.github/dependabot.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ updates:
55
schedule:
66
interval: "weekly"
77
target-branch: "devel"
8+
- package-ecosystem: "pip"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
target-branch: "devel"

.github/workflows/build_cc.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,13 @@ jobs:
2929
- variant: clang
3030
dp_variant: clang
3131
steps:
32-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
3333
- uses: actions/setup-python@v6
3434
with:
3535
python-version: '3.11'
3636
- uses: lukka/get-cmake@latest
3737
- run: python -m pip install uv
38-
- run: source/install/uv_with_retry.sh pip install --system tensorflow
39-
- run: source/install/uv_with_retry.sh pip install --system 'torch==2.8.*' --index-url https://download.pytorch.org/whl/cpu
38+
- run: source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
4039
- run: |
4140
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
4241
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \

.github/workflows/build_wheel.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
cuda_version: 11.8
3838
dp_pkg_name: deepmd-kit-cu11
3939
# macos-x86-64
40-
- os: macos-13
40+
- os: macos-15-intel
4141
python: 311
4242
platform_id: macosx_x86_64
4343
dp_variant: cpu
@@ -57,7 +57,7 @@ jobs:
5757
platform_id: manylinux_aarch64
5858
dp_variant: cpu
5959
steps:
60-
- uses: actions/checkout@v5
60+
- uses: actions/checkout@v6
6161
with:
6262
# https://github.com/pypa/setuptools_scm/issues/480
6363
fetch-depth: 0
@@ -73,7 +73,7 @@ jobs:
7373
rm -rf .git
7474
if: matrix.dp_pkg_name == 'deepmd-kit-cu11'
7575
- name: Build wheels
76-
uses: pypa/cibuildwheel@v3.1
76+
uses: pypa/cibuildwheel@v3.3
7777
env:
7878
CIBW_BUILD_VERBOSITY: 1
7979
CIBW_ARCHS: all
@@ -82,21 +82,21 @@ jobs:
8282
CUDA_VERSION: ${{ matrix.cuda_version }}
8383
DP_PKG_NAME: ${{ matrix.dp_pkg_name }}
8484
CIBW_BUILD_FRONTEND: 'build[uv]'
85-
- uses: actions/upload-artifact@v4
85+
- uses: actions/upload-artifact@v5
8686
with:
8787
name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }}
8888
path: ./wheelhouse/*.whl
8989
build_sdist:
9090
name: Build source distribution
9191
runs-on: ubuntu-latest
9292
steps:
93-
- uses: actions/checkout@v5
93+
- uses: actions/checkout@v6
9494
with:
9595
fetch-depth: 0
9696
- name: Build sdist
9797
run: pipx run uv tool run --with build[uv] --from build python -m build --installer uv --sdist
9898

99-
- uses: actions/upload-artifact@v4
99+
- uses: actions/upload-artifact@v5
100100
with:
101101
name: cibw-sdist
102102
path: dist/*.tar.gz
@@ -109,7 +109,7 @@ jobs:
109109
id-token: write
110110
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
111111
steps:
112-
- uses: actions/download-artifact@v5
112+
- uses: actions/download-artifact@v6
113113
with:
114114
pattern: cibw-*
115115
path: dist
@@ -131,8 +131,8 @@ jobs:
131131
steps:
132132
- name: Delete huge unnecessary tools folder
133133
run: rm -rf /opt/hostedtoolcache
134-
- uses: actions/checkout@v5
135-
- uses: actions/download-artifact@v5
134+
- uses: actions/checkout@v6
135+
- uses: actions/download-artifact@v6
136136
with:
137137
path: source/install/docker/dist
138138
pattern: cibw-*-manylinux_x86_64-cu${{ matrix.cuda_version }}*
@@ -165,7 +165,7 @@ jobs:
165165
needs: [build_wheels, build_sdist]
166166
runs-on: ubuntu-latest
167167
steps:
168-
- uses: actions/download-artifact@v5
168+
- uses: actions/download-artifact@v6
169169
with:
170170
path: dist/packages
171171
pattern: cibw-*

.github/workflows/codeql.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030

3131
steps:
3232
- name: Checkout repository
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434
- uses: actions/setup-python@v6
3535
with:
3636
python-version: '3.11'
@@ -43,13 +43,13 @@ jobs:
4343
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
4444
&& sudo apt-get update \
4545
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
46-
python -m pip install tensorflow
47-
python -m pip install 'torch==2.8.*' --index-url https://download.pytorch.org/whl/cpu
46+
python -m pip install uv
47+
uv pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
4848
env:
4949
DEBIAN_FRONTEND: noninteractive
5050
# Initializes the CodeQL tools for scanning.
5151
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v3
52+
uses: github/codeql-action/init@v4
5353
with:
5454
languages: ${{ matrix.language }}
5555
queries: security-extended,security-and-quality
@@ -62,6 +62,6 @@ jobs:
6262
if: matrix.language == 'c-cpp'
6363

6464
- name: Perform CodeQL Analysis
65-
uses: github/codeql-action/analyze@v3
65+
uses: github/codeql-action/analyze@v4
6666
with:
6767
category: "/language:${{matrix.language}}"

.github/workflows/copilot-setup-steps.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ jobs:
3030
# If you do not check out your code, Copilot will do this for you.
3131
steps:
3232
- name: Checkout code
33-
uses: actions/checkout@v5
33+
uses: actions/checkout@v6
3434

3535
- name: Set up Python
3636
uses: actions/setup-python@v6
3737
with:
3838
python-version: "3.10"
3939

4040
- name: Install uv
41-
uses: astral-sh/setup-uv@v6
41+
uses: astral-sh/setup-uv@v7
4242
with:
4343
enable-cache: true
4444

@@ -49,10 +49,7 @@ jobs:
4949
run: echo "VIRTUAL_ENV=$PWD/venv" >> $GITHUB_ENV && echo "$PWD/venv/bin" >> $GITHUB_PATH
5050

5151
- name: Install base dependencies
52-
run: uv pip install tensorflow-cpu
53-
54-
- name: Install PyTorch
55-
run: uv pip install torch --index-url https://download.pytorch.org/whl/cpu
52+
run: uv pip install --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
5653

5754
- name: Build Python package
5855
run: uv pip install -e .[cpu,test]

.github/workflows/package_c.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,17 @@ jobs:
2828
tensorflow_version: ">=2.5.0,<2.15"
2929
filename: libdeepmd_c_cu11.tar.gz
3030
steps:
31-
- uses: actions/checkout@v5
31+
- name: Free Disk Space (Ubuntu)
32+
uses: insightsengineering/disk-space-reclaimer@v1
33+
with:
34+
tools-cache: true
35+
android: true
36+
dotnet: true
37+
haskell: true
38+
large-packages: true
39+
swap-storage: true
40+
docker-images: true
41+
- uses: actions/checkout@v6
3242
with:
3343
fetch-depth: 0
3444
- name: Package C library
@@ -40,7 +50,7 @@ jobs:
4050
if: matrix.filename != 'libdeepmd_c.tar.gz'
4151
# for download and debug
4252
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@v5
4454
with:
4555
name: libdeepmd_c-${{ strategy.job-index }}-${{ matrix.filename }}
4656
path: ${{ matrix.filename }}
@@ -56,9 +66,9 @@ jobs:
5666
needs: [build_c]
5767
runs-on: ubuntu-22.04
5868
steps:
59-
- uses: actions/checkout@v5
69+
- uses: actions/checkout@v6
6070
- name: Download artifact
61-
uses: actions/download-artifact@v5
71+
uses: actions/download-artifact@v6
6272
with:
6373
pattern: libdeepmd_c-*
6474
merge-multiple: true

.github/workflows/suppr.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
leak:libpaddle_inference
2+
# TensorFlow 2.20
3+
leak:xla::
4+
leak:mlir::
5+
leak:llvm::

.github/workflows/test_cc.yml

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,25 @@ jobs:
1717
runs-on: ubuntu-22.04
1818
strategy:
1919
matrix:
20-
check_memleak: [true, false]
20+
include:
21+
- check_memleak: true
22+
enable_tensorflow: true
23+
enable_pytorch: true
24+
enable_paddle: false
25+
- check_memleak: true
26+
enable_tensorflow: false
27+
enable_pytorch: false
28+
enable_paddle: true
29+
- check_memleak: false
30+
enable_tensorflow: true
31+
enable_pytorch: true
32+
enable_paddle: false
33+
- check_memleak: false
34+
enable_tensorflow: false
35+
enable_pytorch: false
36+
enable_paddle: true
2137
steps:
22-
- uses: actions/checkout@v5
38+
- uses: actions/checkout@v6
2339
- uses: actions/setup-python@v6
2440
with:
2541
python-version: '3.11'
@@ -28,10 +44,9 @@ jobs:
2844
- run: python -m pip install uv
2945
- name: Install Python dependencies
3046
run: |
31-
source/install/uv_with_retry.sh pip install --system tensorflow-cpu~=2.18.0 jax==0.5.0
47+
source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --group pin_jax --torch-backend cpu
3248
export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
3349
source/install/uv_with_retry.sh pip install --system -e .[cpu,test,lmp,jax] mpi4py mpich
34-
source/install/uv_with_retry.sh pip install --system 'torch==2.8.*' --index-url https://download.pytorch.org/whl/cpu
3550
- name: Convert models
3651
run: source/tests/infer/convert-models.sh
3752
# https://github.com/actions/runner-images/issues/9491
@@ -47,31 +62,41 @@ jobs:
4762
CMAKE_GENERATOR: Ninja
4863
CXXFLAGS: ${{ matrix.check_memleak && '-fsanitize=leak' || '' }}
4964
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/workflows/suppr.txt
65+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && 'TRUE' || 'FALSE' }}
66+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && 'TRUE' || 'FALSE' }}
67+
ENABLE_PADDLE: ${{ matrix.enable_paddle && 'TRUE' || 'FALSE' }}
5068
# test lammps
5169
- run: |
5270
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
5371
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
5472
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
73+
if: matrix.enable_paddle
74+
- run: |
5575
export LD_LIBRARY_PATH=${{ github.workspace }}/dp_test/lib:$LD_LIBRARY_PATH
5676
pytest --cov=deepmd source/lmp/tests
5777
env:
5878
OMP_NUM_THREADS: 1
5979
TF_INTRA_OP_PARALLELISM_THREADS: 1
6080
TF_INTER_OP_PARALLELISM_THREADS: 1
6181
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
82+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && '1' || '0' }}
83+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && '1' || '0' }}
84+
ENABLE_JAX: ${{ matrix.enable_tensorflow && '1' || '0' }}
85+
ENABLE_PADDLE: ${{ matrix.enable_paddle && '1' || '0' }}
6286
if: ${{ !matrix.check_memleak }}
6387
# test ipi
6488
- run: |
6589
export PATH=${{ github.workspace }}/dp_test/bin:$PATH
66-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
67-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
68-
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
6990
pytest --cov=deepmd source/ipi/tests
7091
env:
7192
OMP_NUM_THREADS: 1
7293
TF_INTRA_OP_PARALLELISM_THREADS: 1
7394
TF_INTER_OP_PARALLELISM_THREADS: 1
7495
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
96+
ENABLE_TENSORFLOW: ${{ matrix.enable_tensorflow && '1' || '0' }}
97+
ENABLE_PYTORCH: ${{ matrix.enable_pytorch && '1' || '0' }}
98+
ENABLE_JAX: ${{ matrix.enable_tensorflow && '1' || '0' }}
99+
ENABLE_PADDLE: ${{ matrix.enable_paddle && '1' || '0' }}
75100
if: ${{ !matrix.check_memleak }}
76101
- uses: codecov/codecov-action@v5
77102
env:

.github/workflows/test_cuda.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- name: Make sudo and git work
2727
run: apt-get update && apt-get install -y sudo git
28-
- uses: actions/checkout@v5
28+
- uses: actions/checkout@v6
2929
- uses: actions/setup-python@v6
3030
with:
3131
python-version: '3.11'
@@ -43,11 +43,11 @@ jobs:
4343
&& sudo apt-get -y install cuda-12-3 libcudnn8=8.9.5.*-1+cuda12.3
4444
if: false # skip as we use nvidia image
4545
- run: python -m pip install -U uv
46-
- run: source/install/uv_with_retry.sh pip install --system "tensorflow~=2.18.0rc2" "torch~=2.7.0" "jax[cuda12]==0.5.0"
46+
- run: source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_gpu --group pin_pytorch_gpu --group pin_jax "jax[cuda12]"
4747
- run: |
4848
export PYTORCH_ROOT=$(python -c 'import torch;print(torch.__path__[0])')
4949
export TENSORFLOW_ROOT=$(python -c 'import importlib.util,pathlib;print(pathlib.Path(importlib.util.find_spec("tensorflow").origin).parent)')
50-
pip install "paddlepaddle-gpu==3.0.0" -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
50+
pip install --find-links "https://www.paddlepaddle.org.cn/packages/nightly/cu126/paddlepaddle-gpu/" --index-url https://pypi.org/simple "paddlepaddle-gpu==3.3.0.dev20251204"
5151
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit
5252
env:
5353
DP_VARIANT: cuda
@@ -61,6 +61,7 @@ jobs:
6161
# See https://jax.readthedocs.io/en/latest/gpu_memory_allocation.html
6262
XLA_PYTHON_CLIENT_PREALLOCATE: false
6363
XLA_PYTHON_CLIENT_ALLOCATOR: platform
64+
FLAGS_use_stride_compute_kernel: 0
6465
- name: Convert models
6566
run: source/tests/infer/convert-models.sh
6667
- run: |

0 commit comments

Comments
 (0)