Skip to content

Commit 6496194

Browse files
authored
Merge branch 'devel' into spin_virial_test
2 parents 8fd9565 + b526f25 commit 6496194

235 files changed

Lines changed: 11840 additions & 793 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 & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mkdir -p ${SCRIPT_PATH}/../buildcxx/
1111
cd ${SCRIPT_PATH}/../buildcxx/
1212
cmake -D ENABLE_TENSORFLOW=ON \
1313
-D ENABLE_PYTORCH=ON \
14+
-D ENABLE_PADDLE=ON \
1415
-D CMAKE_INSTALL_PREFIX=${SCRIPT_PATH}/../dp/ \
1516
-D LAMMPS_VERSION=stable_29Aug2024_update1 \
1617
-D CMAKE_BUILD_TYPE=Debug \

.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_cc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
env:
5353
DEBIAN_FRONTEND: noninteractive
5454
- run: |
55-
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list \
55+
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/6.3/ jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list \
5656
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 \
5757
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - \
5858
&& sudo apt-get update \

.github/workflows/build_wheel.yml

Lines changed: 2 additions & 18 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
@@ -86,7 +70,7 @@ jobs:
8670
rm -rf .git
8771
if: matrix.dp_pkg_name == 'deepmd-kit-cu11'
8872
- name: Build wheels
89-
uses: pypa/cibuildwheel@v2.22
73+
uses: pypa/cibuildwheel@v2.23
9074
env:
9175
CIBW_BUILD_VERBOSITY: 1
9276
CIBW_ARCHS: all

.github/workflows/suppr.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
leak:libpaddle_inference

.github/workflows/test_cc.yml

Lines changed: 13 additions & 4 deletions
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
@@ -52,8 +52,13 @@ jobs:
5252
LMP_CXX11_ABI_0: 1
5353
CMAKE_GENERATOR: Ninja
5454
CXXFLAGS: ${{ matrix.check_memleak && '-fsanitize=leak' || '' }}
55+
LSAN_OPTIONS: suppressions=${{ github.workspace }}/.github/workflows/suppr.txt
5556
# test lammps
56-
- run: pytest --cov=deepmd source/lmp/tests
57+
- run: |
58+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
59+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
60+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
61+
pytest --cov=deepmd source/lmp/tests
5762
env:
5863
OMP_NUM_THREADS: 1
5964
TF_INTRA_OP_PARALLELISM_THREADS: 1
@@ -62,12 +67,16 @@ jobs:
6267
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib:${{ github.workspace }}/libtorch/lib
6368
if: ${{ !matrix.check_memleak }}
6469
# test ipi
65-
- run: pytest --cov=deepmd source/ipi/tests
70+
- run: |
71+
export PATH=${{ github.workspace }}/dp_test/bin:$PATH
72+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/paddle/lib/*.so ${{ github.workspace }}/dp_test/lib/
73+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* ${{ github.workspace }}/dp_test/lib/
74+
cp ${{ github.workspace }}/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* ${{ github.workspace }}/dp_test/lib/
75+
pytest --cov=deepmd source/ipi/tests
6676
env:
6777
OMP_NUM_THREADS: 1
6878
TF_INTRA_OP_PARALLELISM_THREADS: 1
6979
TF_INTER_OP_PARALLELISM_THREADS: 1
70-
PATH: ${{ github.workspace }}/dp_test/bin:$PATH
7180
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib:${{ github.workspace }}/libtorch/lib
7281
if: ${{ !matrix.check_memleak }}
7382
- uses: codecov/codecov-action@v5

.github/workflows/test_cuda.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,29 @@ 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 --pre https://paddle-whl.bj.bcebos.com/nightly/cu123/paddlepaddle-gpu/paddlepaddle_gpu-3.0.0.dev20241126-cp311-cp311-linux_x86_64.whl
55-
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py
54+
pip install "paddlepaddle-gpu==3.0.0" -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
55+
source/install/uv_with_retry.sh pip install --system -v -e .[gpu,test,lmp,cu12,torch,jax] mpi4py --reinstall-package deepmd-kit
5656
env:
5757
DP_VARIANT: cuda
5858
DP_ENABLE_NATIVE_OPTIMIZATION: 1
5959
DP_ENABLE_PYTORCH: 1
6060
- run: dp --version
61-
- run: python -m pytest source/tests --durations=0
61+
- run: python -m pytest source/tests
6262
env:
6363
NUM_WORKERS: 0
6464
CUDA_VISIBLE_DEVICES: 0
6565
# See https://jax.readthedocs.io/en/latest/gpu_memory_allocation.html
6666
XLA_PYTHON_CLIENT_PREALLOCATE: false
67+
XLA_PYTHON_CLIENT_ALLOCATOR: platform
6768
- name: Convert models
6869
run: source/tests/infer/convert-models.sh
6970
- name: Download libtorch
7071
run: |
71-
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.5.0%2Bcu124.zip -O libtorch.zip
72+
wget https://download.pytorch.org/libtorch/cu124/libtorch-cxx11-abi-shared-with-deps-2.6.0%2Bcu124.zip -O libtorch.zip
7273
unzip libtorch.zip
7374
- run: |
7475
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/libtorch
@@ -85,6 +86,9 @@ jobs:
8586
- run: |
8687
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu/:$GITHUB_WORKSPACE/dp_test/lib:$GITHUB_WORKSPACE/libtorch/lib:$LD_LIBRARY_PATH
8788
export PATH=$GITHUB_WORKSPACE/dp_test/bin:$PATH
89+
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/paddle/lib/* $GITHUB_WORKSPACE/dp_test/lib/
90+
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/onednn/lib/* $GITHUB_WORKSPACE/dp_test/lib/
91+
cp $GITHUB_WORKSPACE/source/build_tests/paddle_inference_install_dir/third_party/install/mklml/lib/* $GITHUB_WORKSPACE/dp_test/lib/
8892
python -m pytest -s source/lmp/tests || (cat log.lammps && exit 1)
8993
python -m pytest source/ipi/tests
9094
env:

.github/workflows/test_python.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,14 @@ 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'"
33+
source/install/uv_with_retry.sh pip install --system -U setuptools
3334
source/install/uv_with_retry.sh pip install --system horovod --no-build-isolation
34-
source/install/uv_with_retry.sh pip install --system --pre "paddlepaddle" -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
35+
source/install/uv_with_retry.sh pip install --system --pre "paddlepaddle==3.0.0" -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
3536
env:
3637
# Please note that uv has some issues with finding
3738
# existing TensorFlow package. Currently, it uses
@@ -43,6 +44,8 @@ jobs:
4344
HOROVOD_WITH_TENSORFLOW: 1
4445
HOROVOD_WITHOUT_PYTORCH: 1
4546
HOROVOD_WITH_MPI: 1
47+
# https://cmake.org/cmake/help/latest/variable/CMAKE_POLICY_VERSION_MINIMUM.html
48+
CMAKE_POLICY_VERSION_MINIMUM: 3.5
4649
- run: dp --version
4750
- name: Get durations from cache
4851
uses: actions/cache@v4
@@ -55,11 +58,11 @@ jobs:
5558
restore-keys: |
5659
test2-durations-combined-${{ matrix.python }}-${{ github.sha }}
5760
test2-durations-combined-${{ matrix.python }}
58-
- run: pytest --cov=deepmd source/tests --durations=0 --splits 6 --group ${{ matrix.group }} --store-durations --clean-durations --durations-path=.test_durations --splitting-algorithm least_duration
61+
- run: pytest --cov=deepmd source/tests --splits 6 --group ${{ matrix.group }} --store-durations --clean-durations --durations-path=.test_durations --splitting-algorithm least_duration
5962
env:
6063
NUM_WORKERS: 0
6164
- name: Test TF2 eager mode
62-
run: pytest --cov=deepmd --cov-append source/tests/consistent/io/test_io.py source/jax2tf_tests --durations=0
65+
run: pytest --cov=deepmd --cov-append source/tests/consistent/io/test_io.py source/jax2tf_tests
6366
env:
6467
NUM_WORKERS: 0
6568
DP_TEST_TF2_ONLY: 1

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: trailing-whitespace
88
exclude: "^.+\\.pbtxt$"
99
- id: end-of-file-fixer
10-
exclude: "^.+\\.pbtxt$"
10+
exclude: "^.+\\.pbtxt$|deeppot_sea.*\\.json$"
1111
- id: check-yaml
1212
- id: check-json
1313
- id: check-added-large-files
@@ -22,14 +22,14 @@ repos:
2222
- id: check-toml
2323
# Python
2424
- repo: https://github.com/PyCQA/isort
25-
rev: 5.13.2
25+
rev: 6.0.1
2626
hooks:
2727
- id: isort
2828
files: \.py$
2929
exclude: ^source/3rdparty
3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version.
32-
rev: v0.8.6
32+
rev: v0.11.2
3333
hooks:
3434
- id: ruff
3535
args: ["--fix"]
@@ -40,7 +40,7 @@ repos:
4040
types_or: [python, pyi, jupyter]
4141
- repo: https://github.com/pycqa/flake8
4242
# flake8 cannot autofix
43-
rev: "7.1.1"
43+
rev: "7.2.0"
4444
hooks:
4545
- id: flake8
4646
additional_dependencies:
@@ -60,10 +60,10 @@ repos:
6060
- id: blacken-docs
6161
# C++
6262
- repo: https://github.com/pre-commit/mirrors-clang-format
63-
rev: v19.1.6
63+
rev: v20.1.0
6464
hooks:
6565
- id: clang-format
66-
exclude: ^(source/3rdparty|source/lib/src/gpu/cudart/.+\.inc|.+\.ipynb$)
66+
exclude: ^(source/3rdparty|source/lib/src/gpu/cudart/.+\.inc|.+\.ipynb$|.+\.json$)
6767
# markdown, yaml, CSS, javascript
6868
- repo: https://github.com/pre-commit/mirrors-prettier
6969
rev: v4.0.0-alpha.8
@@ -74,7 +74,7 @@ repos:
7474
exclude: ^(source/3rdparty|\.github/workflows|\.clang-format)
7575
# Shell
7676
- repo: https://github.com/scop/pre-commit-shfmt
77-
rev: v3.10.0-2
77+
rev: v3.11.0-1
7878
hooks:
7979
- id: shfmt
8080
# CMake
@@ -154,7 +154,7 @@ repos:
154154
exclude: .pre-commit-config.yaml|source/lmp
155155
# customized pylint rules
156156
- repo: https://github.com/pylint-dev/pylint/
157-
rev: v3.3.3
157+
rev: v3.3.6
158158
hooks:
159159
- id: pylint
160160
entry: env PYTHONPATH=source/checker pylint

.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

0 commit comments

Comments
 (0)