Skip to content

Commit aeb3340

Browse files
authored
Merge branch 'master' into copilot/fix-4939
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
2 parents dca9a9e + 501adb8 commit aeb3340

507 files changed

Lines changed: 34008 additions & 4479 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,7 @@ updates:
44
directory: "/"
55
schedule:
66
interval: "weekly"
7-
target-branch: "devel"
7+
- package-ecosystem: "pip"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/build_cc.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,29 +20,20 @@ jobs:
2020
include:
2121
- variant: cpu
2222
dp_variant: cpu
23-
- variant: cuda
24-
dp_variant: cuda
2523
- variant: cuda120
2624
dp_variant: cuda
2725
- variant: rocm
2826
dp_variant: rocm
2927
- variant: clang
3028
dp_variant: clang
3129
steps:
32-
- uses: actions/checkout@v5
30+
- uses: actions/checkout@v6
3331
- uses: actions/setup-python@v6
3432
with:
3533
python-version: '3.11'
3634
- uses: lukka/get-cmake@latest
3735
- 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
40-
- run: |
41-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
42-
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
43-
&& sudo apt-get update \
44-
&& sudo apt-get -y install cuda-cudart-dev-11-8 cuda-nvcc-11-8
45-
if: matrix.variant == 'cuda'
36+
- run: source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
4637
- run: |
4738
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
4839
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \

.github/workflows/build_wheel.yml

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,9 @@ jobs:
2929
python: 311
3030
platform_id: manylinux_x86_64
3131
dp_variant: cuda
32-
cuda_version: 12.2
33-
- os: ubuntu-latest
34-
python: 311
35-
platform_id: manylinux_x86_64
36-
dp_variant: cuda
37-
cuda_version: 11.8
38-
dp_pkg_name: deepmd-kit-cu11
32+
cuda_version: 12.8
3933
# macos-x86-64
40-
- os: macos-13
34+
- os: macos-15-intel
4135
python: 311
4236
platform_id: macosx_x86_64
4337
dp_variant: cpu
@@ -57,23 +51,15 @@ jobs:
5751
platform_id: manylinux_aarch64
5852
dp_variant: cpu
5953
steps:
60-
- uses: actions/checkout@v5
54+
- uses: actions/checkout@v6
6155
with:
6256
# https://github.com/pypa/setuptools_scm/issues/480
6357
fetch-depth: 0
6458
- name: Install uv
6559
run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/astral-sh/uv/releases/download/0.2.24/uv-installer.sh | sh
6660
if: runner.os != 'Linux'
67-
- uses: docker/setup-qemu-action@v3
68-
name: Setup QEMU
69-
if: matrix.platform_id == 'manylinux_aarch64' && matrix.os == 'ubuntu-latest'
70-
# detect version in advance. See #3168
71-
- run: |
72-
echo "SETUPTOOLS_SCM_PRETEND_VERSION=$(pipx run uv tool run --from setuptools_scm python -m setuptools_scm)" >> $GITHUB_ENV
73-
rm -rf .git
74-
if: matrix.dp_pkg_name == 'deepmd-kit-cu11'
7561
- name: Build wheels
76-
uses: pypa/cibuildwheel@v3.1
62+
uses: pypa/cibuildwheel@v3.3
7763
env:
7864
CIBW_BUILD_VERBOSITY: 1
7965
CIBW_ARCHS: all
@@ -82,21 +68,21 @@ jobs:
8268
CUDA_VERSION: ${{ matrix.cuda_version }}
8369
DP_PKG_NAME: ${{ matrix.dp_pkg_name }}
8470
CIBW_BUILD_FRONTEND: 'build[uv]'
85-
- uses: actions/upload-artifact@v4
71+
- uses: actions/upload-artifact@v6
8672
with:
8773
name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }}
8874
path: ./wheelhouse/*.whl
8975
build_sdist:
9076
name: Build source distribution
9177
runs-on: ubuntu-latest
9278
steps:
93-
- uses: actions/checkout@v5
79+
- uses: actions/checkout@v6
9480
with:
9581
fetch-depth: 0
9682
- name: Build sdist
9783
run: pipx run uv tool run --with build[uv] --from build python -m build --installer uv --sdist
9884

99-
- uses: actions/upload-artifact@v4
85+
- uses: actions/upload-artifact@v6
10086
with:
10187
name: cibw-sdist
10288
path: dist/*.tar.gz
@@ -109,7 +95,7 @@ jobs:
10995
id-token: write
11096
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
11197
steps:
112-
- uses: actions/download-artifact@v5
98+
- uses: actions/download-artifact@v7
11399
with:
114100
pattern: cibw-*
115101
path: dist
@@ -126,13 +112,11 @@ jobs:
126112
include:
127113
- variant: ""
128114
cuda_version: "12"
129-
- variant: "_cu11"
130-
cuda_version: "11"
131115
steps:
132116
- name: Delete huge unnecessary tools folder
133117
run: rm -rf /opt/hostedtoolcache
134-
- uses: actions/checkout@v5
135-
- uses: actions/download-artifact@v5
118+
- uses: actions/checkout@v6
119+
- uses: actions/download-artifact@v7
136120
with:
137121
path: source/install/docker/dist
138122
pattern: cibw-*-manylinux_x86_64-cu${{ matrix.cuda_version }}*
@@ -165,7 +149,7 @@ jobs:
165149
needs: [build_wheels, build_sdist]
166150
runs-on: ubuntu-latest
167151
steps:
168-
- uses: actions/download-artifact@v5
152+
- uses: actions/download-artifact@v7
169153
with:
170154
path: dist/packages
171155
pattern: cibw-*
@@ -191,7 +175,7 @@ jobs:
191175
name: github-pages
192176
url: ${{ steps.deployment.outputs.page_url }}
193177
runs-on: ubuntu-latest
194-
if: github.event_name == 'push' && github.ref == 'refs/heads/devel' && github.repository_owner == 'deepmodeling'
178+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'deepmodeling'
195179
steps:
196180
- name: Deploy to GitHub Pages
197181
id: deployment

.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 & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,18 @@ jobs:
2424
- tensorflow_build_version: "2.18"
2525
tensorflow_version: ""
2626
filename: libdeepmd_c.tar.gz
27-
- tensorflow_build_version: "2.14"
28-
tensorflow_version: ">=2.5.0,<2.15"
29-
filename: libdeepmd_c_cu11.tar.gz
3027
steps:
31-
- uses: actions/checkout@v5
28+
- name: Free Disk Space (Ubuntu)
29+
uses: insightsengineering/disk-space-reclaimer@v1
30+
with:
31+
tools-cache: true
32+
android: true
33+
dotnet: true
34+
haskell: true
35+
large-packages: true
36+
swap-storage: true
37+
docker-images: true
38+
- uses: actions/checkout@v6
3239
with:
3340
fetch-depth: 0
3441
- name: Package C library
@@ -40,7 +47,7 @@ jobs:
4047
if: matrix.filename != 'libdeepmd_c.tar.gz'
4148
# for download and debug
4249
- name: Upload artifact
43-
uses: actions/upload-artifact@v4
50+
uses: actions/upload-artifact@v6
4451
with:
4552
name: libdeepmd_c-${{ strategy.job-index }}-${{ matrix.filename }}
4653
path: ${{ matrix.filename }}
@@ -56,9 +63,9 @@ jobs:
5663
needs: [build_c]
5764
runs-on: ubuntu-22.04
5865
steps:
59-
- uses: actions/checkout@v5
66+
- uses: actions/checkout@v6
6067
- name: Download artifact
61-
uses: actions/download-artifact@v5
68+
uses: actions/download-artifact@v7
6269
with:
6370
pattern: libdeepmd_c-*
6471
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:

0 commit comments

Comments
 (0)