Skip to content

Commit ad83d98

Browse files
author
Han Wang
committed
Merge branch 'refact-auto-setattr' into refact-fitting-net
2 parents ea61141 + de8f156 commit ad83d98

117 files changed

Lines changed: 1965 additions & 1203 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/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The following packages are installed into the Python environment `.venv`:
1313
- LAMMPS
1414
- MPICH
1515
- CMake
16-
- pre-commit (including hooks)
16+
- prek (including hooks)
1717
- Test packages including pytest
1818
- Doc packages including sphinx
1919

.devcontainer/build_py.sh

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

77
uv sync --dev --python 3.12 --extra cpu --extra torch --extra jax --extra lmp --extra test --extra docs
8-
pre-commit install
8+
prek install

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"features": {
77
"ghcr.io/devcontainers/features/github-cli:1": {}
88
},
9-
"postCreateCommand": ".devcontainer/build_py.sh && .devcontainer/download_libtorch.sh && .devcontainer/build_cxx.sh && pre-commit install-hooks",
9+
"postCreateCommand": ".devcontainer/build_py.sh && .devcontainer/download_libtorch.sh && .devcontainer/build_cxx.sh && prek install-hooks",
1010
"remoteEnv": {
1111
"PATH": "${containerEnv:PATH}:${containerWorkspaceFolder}/.venv/bin",
1212
"DP_ENABLE_PYTORCH": "1",

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ body:
3737
- docker
3838
- pip
3939
- Built from source
40+
- dp1s
4041
- Others (write below)
4142
validations:
4243
required: true

.github/workflows/build_cc.yml

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -18,69 +18,69 @@ jobs:
1818
strategy:
1919
matrix:
2020
include:
21-
- variant: cpu
22-
dp_variant: cpu
23-
- variant: cuda120
24-
dp_variant: cuda
25-
- variant: rocm
26-
dp_variant: rocm
27-
- variant: clang
28-
dp_variant: clang
21+
- variant: cpu
22+
dp_variant: cpu
23+
- variant: cuda120
24+
dp_variant: cuda
25+
- variant: rocm
26+
dp_variant: rocm
27+
- variant: clang
28+
dp_variant: clang
2929
steps:
30-
- uses: actions/checkout@v6
31-
- uses: actions/setup-python@v6
32-
with:
33-
python-version: '3.11'
34-
- uses: lukka/get-cmake@latest
35-
- run: python -m pip install uv
36-
- run: source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
37-
- run: |
38-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
39-
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
40-
&& sudo apt-get update \
41-
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
42-
if: matrix.variant == 'cuda120'
43-
env:
44-
DEBIAN_FRONTEND: noninteractive
45-
- run: |
46-
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/6.3/ jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list \
47-
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 \
48-
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - \
49-
&& sudo apt-get update \
50-
&& sudo apt-get install -y rocm-dev hipcub-dev
51-
if: matrix.variant == 'rocm'
52-
- run: |
53-
source/install/build_cc.sh
54-
env:
55-
DP_VARIANT: ${{ matrix.dp_variant }}
56-
DOWNLOAD_TENSORFLOW: "FALSE"
57-
CMAKE_GENERATOR: Ninja
58-
if: matrix.variant != 'clang'
59-
- run: |
60-
source/install/build_cc.sh
61-
env:
62-
DP_VARIANT: cpu
63-
DOWNLOAD_TENSORFLOW: "FALSE"
64-
CC: clang
65-
CXX: clang++
66-
CMAKE_GENERATOR: Ninja
67-
if: matrix.variant == 'clang'
68-
- name: Test files exist
69-
run: |
70-
test -f dp/bin/dp_ipi &&
71-
test -f dp/lib/libdeepmd_cc.so &&
72-
test -f dp/lib/libdeepmd_c.so &&
73-
test -f dp/lib/libdeepmd_op.so &&
74-
test -f dp/lib/libdeepmd_ipi.so &&
75-
test -f dp/lib/libdeepmd_lmp.so &&
76-
test -f dp/lib/libdeepmd.so
30+
- uses: actions/checkout@v6
31+
- uses: actions/setup-python@v6
32+
with:
33+
python-version: "3.11"
34+
- uses: lukka/get-cmake@latest
35+
- run: python -m pip install uv
36+
- run: source/install/uv_with_retry.sh pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
37+
- run: |
38+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
39+
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
40+
&& sudo apt-get update \
41+
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
42+
if: matrix.variant == 'cuda120'
43+
env:
44+
DEBIAN_FRONTEND: noninteractive
45+
- run: |
46+
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/6.3/ jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list \
47+
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 \
48+
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - \
49+
&& sudo apt-get update \
50+
&& sudo apt-get install -y rocm-dev hipcub-dev
51+
if: matrix.variant == 'rocm'
52+
- run: |
53+
source/install/build_cc.sh
54+
env:
55+
DP_VARIANT: ${{ matrix.dp_variant }}
56+
DOWNLOAD_TENSORFLOW: "FALSE"
57+
CMAKE_GENERATOR: Ninja
58+
if: matrix.variant != 'clang'
59+
- run: |
60+
source/install/build_cc.sh
61+
env:
62+
DP_VARIANT: cpu
63+
DOWNLOAD_TENSORFLOW: "FALSE"
64+
CC: clang
65+
CXX: clang++
66+
CMAKE_GENERATOR: Ninja
67+
if: matrix.variant == 'clang'
68+
- name: Test files exist
69+
run: |
70+
test -f dp/bin/dp_ipi &&
71+
test -f dp/lib/libdeepmd_cc.so &&
72+
test -f dp/lib/libdeepmd_c.so &&
73+
test -f dp/lib/libdeepmd_op.so &&
74+
test -f dp/lib/libdeepmd_ipi.so &&
75+
test -f dp/lib/libdeepmd_lmp.so &&
76+
test -f dp/lib/libdeepmd.so
7777
pass:
7878
name: Pass building C++
7979
needs: [buildcc]
8080
runs-on: ubuntu-latest
8181
if: always()
8282
steps:
83-
- name: Decide whether the needed jobs succeeded or failed
84-
uses: re-actors/alls-green@release/v1
85-
with:
86-
jobs: ${{ toJSON(needs) }}
83+
- name: Decide whether the needed jobs succeeded or failed
84+
uses: re-actors/alls-green@release/v1
85+
with:
86+
jobs: ${{ toJSON(needs) }}

.github/workflows/build_wheel.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
DP_VARIANT: ${{ matrix.dp_variant }}
6868
CUDA_VERSION: ${{ matrix.cuda_version }}
6969
DP_PKG_NAME: ${{ matrix.dp_pkg_name }}
70-
CIBW_BUILD_FRONTEND: 'build[uv]'
70+
CIBW_BUILD_FRONTEND: "build[uv]"
7171
- uses: actions/upload-artifact@v6
7272
with:
7373
name: cibw-cp${{ matrix.python }}-${{ matrix.platform_id }}-cu${{ matrix.cuda_version }}-${{ strategy.job-index }}
@@ -157,7 +157,7 @@ jobs:
157157
- uses: actions/setup-python@v6
158158
name: Install Python
159159
with:
160-
python-version: '3.11'
160+
python-version: "3.11"
161161
- run: pip install dumb-pypi
162162
- run: |
163163
ls dist/packages > package_list.txt
@@ -187,7 +187,7 @@ jobs:
187187
runs-on: ubuntu-latest
188188
if: always()
189189
steps:
190-
- name: Decide whether the needed jobs succeeded or failed
191-
uses: re-actors/alls-green@release/v1
192-
with:
193-
jobs: ${{ toJSON(needs) }}
190+
- name: Decide whether the needed jobs succeeded or failed
191+
uses: re-actors/alls-green@release/v1
192+
with:
193+
jobs: ${{ toJSON(needs) }}

.github/workflows/codeql.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- "pre-commit-ci-update-config"
1010
pull_request:
1111
schedule:
12-
- cron: '45 2 * * 2'
12+
- cron: "45 2 * * 2"
1313
concurrency:
1414
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
1515
cancel-in-progress: true
@@ -26,42 +26,42 @@ jobs:
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
language: [ 'c-cpp', 'javascript-typescript', 'python' ]
29+
language: ["c-cpp", "javascript-typescript", "python"]
3030

3131
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@v6
34-
- uses: actions/setup-python@v6
35-
with:
36-
python-version: '3.11'
37-
cache: 'pip'
38-
if: matrix.language == 'c-cpp'
39-
- name: "Setup dependencies"
40-
if: matrix.language == 'c-cpp'
41-
run: |
42-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
43-
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
44-
&& sudo apt-get update \
45-
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
46-
python -m pip install uv
47-
uv pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
48-
env:
49-
DEBIAN_FRONTEND: noninteractive
50-
# Initializes the CodeQL tools for scanning.
51-
- name: Initialize CodeQL
52-
uses: github/codeql-action/init@v4
53-
with:
54-
languages: ${{ matrix.language }}
55-
queries: security-extended,security-and-quality
56-
- name: "Run, Build Application using script"
57-
run: |
58-
source/install/build_cc.sh
59-
env:
60-
DP_VARIANT: cuda
61-
DOWNLOAD_TENSORFLOW: "FALSE"
62-
if: matrix.language == 'c-cpp'
32+
- name: Checkout repository
33+
uses: actions/checkout@v6
34+
- uses: actions/setup-python@v6
35+
with:
36+
python-version: "3.11"
37+
cache: "pip"
38+
if: matrix.language == 'c-cpp'
39+
- name: "Setup dependencies"
40+
if: matrix.language == 'c-cpp'
41+
run: |
42+
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
43+
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
44+
&& sudo apt-get update \
45+
&& sudo apt-get -y install cuda-cudart-dev-12-2 cuda-nvcc-12-2
46+
python -m pip install uv
47+
uv pip install --system --group pin_tensorflow_cpu --group pin_pytorch_cpu --torch-backend cpu
48+
env:
49+
DEBIAN_FRONTEND: noninteractive
50+
# Initializes the CodeQL tools for scanning.
51+
- name: Initialize CodeQL
52+
uses: github/codeql-action/init@v4
53+
with:
54+
languages: ${{ matrix.language }}
55+
queries: security-extended,security-and-quality
56+
- name: "Run, Build Application using script"
57+
run: |
58+
source/install/build_cc.sh
59+
env:
60+
DP_VARIANT: cuda
61+
DOWNLOAD_TENSORFLOW: "FALSE"
62+
if: matrix.language == 'c-cpp'
6363

64-
- name: Perform CodeQL Analysis
65-
uses: github/codeql-action/analyze@v4
66-
with:
67-
category: "/language:${{matrix.language}}"
64+
- name: Perform CodeQL Analysis
65+
uses: github/codeql-action/analyze@v4
66+
with:
67+
category: "/language:${{matrix.language}}"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ jobs:
5454
- name: Build Python package
5555
run: uv pip install -e .[cpu,test]
5656

57-
- name: Install pre-commit tools
58-
run: uv tool install pre-commit
57+
- name: Install prek tools
58+
run: uv tool install prek
5959

60-
- name: Install pre-commit hooks
61-
run: pre-commit install --install-hooks
60+
- name: Install prek hooks
61+
run: prek install --install-hooks
6262

6363
- name: Verify installation
6464
run: |

.github/workflows/labeler.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
name: "Pull Request Labeler"
2-
on:
3-
- pull_request_target
4-
5-
jobs:
6-
triage:
7-
permissions:
8-
contents: read
9-
pull-requests: write
10-
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/labeler@v6
13-
with:
14-
repo-token: "${{ secrets.GITHUB_TOKEN }}"
1+
name: "Pull Request Labeler"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
triage:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/labeler@v6
13+
with:
14+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

.github/workflows/package_c.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
runs-on: ubuntu-latest
8181
if: always()
8282
steps:
83-
- name: Decide whether the needed jobs succeeded or failed
84-
uses: re-actors/alls-green@release/v1
85-
with:
86-
jobs: ${{ toJSON(needs) }}
83+
- name: Decide whether the needed jobs succeeded or failed
84+
uses: re-actors/alls-green@release/v1
85+
with:
86+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)