Skip to content

Commit 89d0d23

Browse files
authored
Merge devel into master (deepmodeling#2187)
2 parents 6e3d4a6 + f40c694 commit 89d0d23

299 files changed

Lines changed: 39770 additions & 5001 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.

.github/labeler.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ CUDA: source/lib/src/cuda/**/*
88
ROCM: source/lib/src/rocm/**/*
99
OP: source/op/**/*
1010
C++: source/api_cc/**/*
11+
C: source/api_c/**/*
1112
LAMMPS: source/lmp/**/*
1213
Gromacs: source/gmx/**/*
13-
i-Pi: source/ipi/**/*
14+
i-Pi: source/ipi/**/*

.github/workflows/build_cc.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,50 @@ on:
33
pull_request:
44
name: Build C++
55
jobs:
6-
testpython:
6+
buildcc:
77
name: Build C++
8-
runs-on: ubuntu-20.04
8+
runs-on: ubuntu-latest
9+
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
910
strategy:
1011
matrix:
1112
include:
1213
- variant: cpu
1314
- variant: cuda
15+
- variant: rocm
16+
- variant: clang
1417
steps:
1518
- name: work around permission issue
1619
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1720
- uses: actions/checkout@master
1821
with:
1922
submodules: true
20-
- run: sudo apt update && sudo apt install g++-7
21-
- run: sudo apt install nvidia-cuda-toolkit
23+
- run: apt-get update && apt-get install -y nvidia-cuda-toolkit
2224
if: matrix.variant == 'cuda'
25+
- run: |
26+
apt-get update && apt-get install -y gnupg2 \
27+
&& echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \
28+
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \
29+
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \
30+
&& apt-get update \
31+
&& apt-get install -y rocm-dev hipcub-dev
32+
if: matrix.variant == 'rocm'
33+
- run: apt-get update && apt-get install -y clang
34+
if: matrix.variant == 'clang'
2335
- run: source/install/build_cc.sh
2436
env:
2537
DP_VARIANT: ${{ matrix.variant }}
26-
CC: gcc-7
27-
CXX: g++-7
28-
CONDA_OVERRIDE_CUDA: 11.3
38+
DOWNLOAD_TENSORFLOW: "FALSE"
39+
if: matrix.variant != 'clang'
40+
- run: source/install/build_cc.sh
41+
env:
42+
DP_VARIANT: cpu
43+
DOWNLOAD_TENSORFLOW: "FALSE"
44+
CC: clang
45+
CXX: clang++
46+
if: matrix.variant == 'clang'
47+
pass:
48+
name: Pass building C++
49+
needs: [buildcc]
50+
runs-on: ubuntu-latest
51+
steps:
52+
- run: echo "All jobs passed"

.github/workflows/build_wheel.yml

Lines changed: 44 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,64 +6,83 @@ on:
66

77
jobs:
88
build_wheels:
9-
name: Build wheels on ${{ matrix.os }}
9+
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
1010
runs-on: ${{ matrix.os }}
1111
strategy:
12+
fail-fast: false
1213
matrix:
13-
os: [ubuntu-18.04] #, windows-latest, macos-latest]
14-
14+
include:
15+
# linux-64
16+
- os: ubuntu-latest
17+
python: 310
18+
platform_id: manylinux_x86_64
19+
dp_variant: cuda
20+
# macos-x86-64
21+
- os: macos-latest
22+
python: 310
23+
platform_id: macosx_x86_64
24+
dp_variant: cpu
25+
# win-64
26+
- os: windows-2019
27+
python: 310
28+
platform_id: win_amd64
29+
dp_variant: cpu
30+
# linux-aarch64
31+
- os: ubuntu-latest
32+
python: 310
33+
platform_id: manylinux_aarch64
34+
dp_variant: cpu
1535
steps:
16-
- name: work around permission issue
17-
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
1836
- uses: actions/checkout@v2
37+
with:
38+
submodules: true
39+
- uses: docker/setup-qemu-action@v2
40+
name: Setup QEMU
41+
if: matrix.platform_id == 'manylinux_aarch64'
1942
- uses: actions/setup-python@v2
2043
name: Install Python
2144
with:
2245
python-version: '3.8'
2346

24-
- name: Install cibuildwheel
25-
run: |
26-
python -m pip install cibuildwheel
27-
47+
- run: python -m pip install cibuildwheel==2.11.3
2848
- name: Build wheels
49+
run: python -m cibuildwheel --output-dir wheelhouse
2950
env:
30-
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*"
31-
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/deepmodeling/manylinux_2_28_x86_64_tensorflow
32-
CIBW_BEFORE_BUILD: pip install tensorflow
33-
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
34-
run: |
35-
python -m cibuildwheel --output-dir wheelhouse
51+
CIBW_BUILD_VERBOSITY: 1
52+
CIBW_ARCHS: all
53+
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
54+
DP_VARIANT: ${{ matrix.dp_variant }}
3655
- uses: actions/upload-artifact@v2
3756
with:
3857
path: ./wheelhouse/*.whl
39-
4058
build_sdist:
4159
name: Build source distribution
4260
runs-on: ubuntu-latest
4361
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-python@v2
62+
- uses: actions/checkout@v3
63+
with:
64+
submodules: true
65+
- uses: actions/setup-python@v4
4666
name: Install Python
4767
with:
48-
python-version: '3.8'
49-
- run: pip install -U scikit-build tensorflow setuptools_scm
68+
python-version: '3.10'
69+
- run: python -m pip install build
5070
- name: Build sdist
51-
run: python setup.py sdist
71+
run: python -m build --sdist
5272

53-
- uses: actions/upload-artifact@v2
73+
- uses: actions/upload-artifact@v3
5474
with:
5575
path: dist/*.tar.gz
5676

5777
upload_pypi:
5878
needs: [build_wheels, build_sdist]
5979
runs-on: ubuntu-latest
60-
if: startsWith(github.event.ref, 'refs/tags/v')
80+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
6181
steps:
62-
- uses: actions/download-artifact@v2
82+
- uses: actions/download-artifact@v3
6383
with:
6484
name: artifact
6585
path: dist
66-
6786
- uses: pypa/gh-action-pypi-publish@master
6887
with:
6988
user: __token__

.github/workflows/lint_python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
python-version: ${{ matrix.python }}
2020
- name: Install requirements
21-
run: pip install -r requirements.txt
21+
run: pip install .
2222
- uses: marian-code/python-lint-annotate@v2.5.0
2323
with:
2424
python-root-list: "./deepmd/*.py ./deepmd/*/*.py ./deepmd/*/*/*.py ./source/train/*.py ./source/tests/*.py ./source/op/*.py"

.github/workflows/package_c.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build C library
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
build_c:
9+
name: Build C library
10+
runs-on: ubuntu-22.04
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Package C library
14+
run: ./source/install/docker_package_c.sh
15+
- name: Test C library
16+
run: ./source/install/docker_test_package_c.sh
17+
# for download and debug
18+
- name: Upload artifact
19+
uses: actions/upload-artifact@v2
20+
with:
21+
path: ./libdeepmd_c.tar.gz
22+
- name: Release
23+
uses: softprops/action-gh-release@v1
24+
if: startsWith(github.ref, 'refs/tags/')
25+
with:
26+
files: libdeepmd_c.tar.gz

.github/workflows/test_cc.yml

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
pull_request:
44
name: Test C++
55
jobs:
6-
testpython:
6+
testcc:
77
name: Test C++
88
runs-on: ubuntu-latest
99
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
@@ -13,5 +13,31 @@ jobs:
1313
- uses: actions/checkout@master
1414
- run: source/install/test_cc_local.sh
1515
env:
16+
OMP_NUM_THREADS: 1
17+
TF_INTRA_OP_PARALLELISM_THREADS: 1
18+
TF_INTER_OP_PARALLELISM_THREADS: 1
1619
tensorflow_root: /usr/local
17-
- run: source/install/codecov.sh
20+
# test lammps
21+
- run: apt-get update && apt-get install -y python3-pip python3-venv
22+
- run: source/install/build_lammps.sh
23+
- run: |
24+
python -m pip install -U pip
25+
python -m pip install -e .[cpu,test]
26+
env:
27+
DP_BUILD_TESTING: 1
28+
- run: pytest --cov=deepmd source/lmp/tests
29+
env:
30+
OMP_NUM_THREADS: 1
31+
TF_INTRA_OP_PARALLELISM_THREADS: 1
32+
TF_INTER_OP_PARALLELISM_THREADS: 1
33+
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
34+
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
35+
- uses: codecov/codecov-action@v3
36+
with:
37+
gcov: true
38+
pass:
39+
name: Pass testing C++
40+
needs: [testcc]
41+
runs-on: ubuntu-latest
42+
steps:
43+
- run: echo "All jobs passed"

.github/workflows/test_python.yml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,10 @@ name: Test Python
55
jobs:
66
testpython:
77
name: Test Python
8-
runs-on: ubuntu-18.04
8+
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
1111
include:
12-
- python: 3.6
13-
gcc: 4.8
14-
tf: 1.8
15-
- python: 3.6
16-
gcc: 4.8
17-
tf: 1.12
18-
- python: 3.6
19-
gcc: 4.8
20-
tf: 1.14
21-
- python: 3.6
22-
gcc: 5
23-
tf: 1.14
24-
- python: 3.6
25-
gcc: 8
26-
tf: 1.14
2712
- python: 3.7
2813
gcc: 5
2914
tf: 1.14
@@ -54,20 +39,21 @@ jobs:
5439
- name: work around permission issue
5540
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
5641
- uses: actions/checkout@master
57-
- name: pip cache
58-
uses: actions/cache@v2
59-
with:
60-
path: ~/.cache/pip
61-
key:
62-
${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}
63-
restore-keys: |
64-
${{ runner.os }}-pip-
6542
- run: python -m pip install -U pip>=21.3.1
66-
- run: pip install -e .[cpu,test] codecov
43+
- run: pip install -e .[cpu,test]
6744
env:
6845
CC: gcc-${{ matrix.gcc }}
6946
CXX: g++-${{ matrix.gcc }}
7047
TENSORFLOW_VERSION: ${{ matrix.tf }}
71-
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
48+
DP_BUILD_TESTING: 1
7249
- run: dp --version
73-
- run: pytest --cov=deepmd source/tests && codecov
50+
- run: pytest --cov=deepmd source/tests --durations=0
51+
- uses: codecov/codecov-action@v3
52+
with:
53+
gcov: true
54+
pass:
55+
name: Pass testing Python
56+
needs: [testpython]
57+
runs-on: ubuntu-latest
58+
steps:
59+
- run: echo "All jobs passed"

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,16 @@ _templates
2929
API_CC
3030
doc/api_py/
3131
doc/api_core/
32+
doc/api_c/
3233
dp/
3334
dp_test/
3435
dp_test_cc/
36+
dp_test_c/
37+
dp_c/
3538
build_lammps/
3639
.idea/
3740
build_tests/
3841
build_cc_tests
42+
build_c_tests
43+
build_c/
44+
libdeepmd_c/

0 commit comments

Comments
 (0)