Skip to content

Commit

Permalink
Merge devel into master (#2187)
Browse files Browse the repository at this point in the history
  • Loading branch information
amcadmus committed Dec 19, 2022
2 parents 6e3d4a6 + f40c694 commit 89d0d23
Show file tree
Hide file tree
Showing 299 changed files with 39,770 additions and 5,001 deletions.
3 changes: 2 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ CUDA: source/lib/src/cuda/**/*
ROCM: source/lib/src/rocm/**/*
OP: source/op/**/*
C++: source/api_cc/**/*
C: source/api_c/**/*
LAMMPS: source/lmp/**/*
Gromacs: source/gmx/**/*
i-Pi: source/ipi/**/*
i-Pi: source/ipi/**/*
38 changes: 31 additions & 7 deletions .github/workflows/build_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,50 @@ on:
pull_request:
name: Build C++
jobs:
testpython:
buildcc:
name: Build C++
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
strategy:
matrix:
include:
- variant: cpu
- variant: cuda
- variant: rocm
- variant: clang
steps:
- name: work around permission issue
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
- uses: actions/checkout@master
with:
submodules: true
- run: sudo apt update && sudo apt install g++-7
- run: sudo apt install nvidia-cuda-toolkit
- run: apt-get update && apt-get install -y nvidia-cuda-toolkit
if: matrix.variant == 'cuda'
- run: |
apt-get update && apt-get install -y gnupg2 \
&& echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | tee /etc/apt/sources.list.d/rocm.list \
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | tee /etc/apt/preferences.d/rocm-pin-600 \
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | apt-key add - \
&& apt-get update \
&& apt-get install -y rocm-dev hipcub-dev
if: matrix.variant == 'rocm'
- run: apt-get update && apt-get install -y clang
if: matrix.variant == 'clang'
- run: source/install/build_cc.sh
env:
DP_VARIANT: ${{ matrix.variant }}
CC: gcc-7
CXX: g++-7
CONDA_OVERRIDE_CUDA: 11.3
DOWNLOAD_TENSORFLOW: "FALSE"
if: matrix.variant != 'clang'
- run: source/install/build_cc.sh
env:
DP_VARIANT: cpu
DOWNLOAD_TENSORFLOW: "FALSE"
CC: clang
CXX: clang++
if: matrix.variant == 'clang'
pass:
name: Pass building C++
needs: [buildcc]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"
69 changes: 44 additions & 25 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,64 +6,83 @@ on:

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
name: Build wheels for cp${{ matrix.python }}-${{ matrix.platform_id }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04] #, windows-latest, macos-latest]

include:
# linux-64
- os: ubuntu-latest
python: 310
platform_id: manylinux_x86_64
dp_variant: cuda
# macos-x86-64
- os: macos-latest
python: 310
platform_id: macosx_x86_64
dp_variant: cpu
# win-64
- os: windows-2019
python: 310
platform_id: win_amd64
dp_variant: cpu
# linux-aarch64
- os: ubuntu-latest
python: 310
platform_id: manylinux_aarch64
dp_variant: cpu
steps:
- name: work around permission issue
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
- uses: actions/checkout@v2
with:
submodules: true
- uses: docker/setup-qemu-action@v2
name: Setup QEMU
if: matrix.platform_id == 'manylinux_aarch64'
- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.8'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel
- run: python -m pip install cibuildwheel==2.11.3
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: "cp36-* cp37-* cp38-* cp39-* cp310-*"
CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/deepmodeling/manylinux_2_28_x86_64_tensorflow
CIBW_BEFORE_BUILD: pip install tensorflow
CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux*"
run: |
python -m cibuildwheel --output-dir wheelhouse
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: all
CIBW_BUILD: cp${{ matrix.python }}-${{ matrix.platform_id }}
DP_VARIANT: ${{ matrix.dp_variant }}
- uses: actions/upload-artifact@v2
with:
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.8'
- run: pip install -U scikit-build tensorflow setuptools_scm
python-version: '3.10'
- run: python -m pip install build
- name: Build sdist
run: python setup.py sdist
run: python -m build --sdist

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: startsWith(github.event.ref, 'refs/tags/v')
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Install requirements
run: pip install -r requirements.txt
run: pip install .
- uses: marian-code/python-lint-annotate@v2.5.0
with:
python-root-list: "./deepmd/*.py ./deepmd/*/*.py ./deepmd/*/*/*.py ./source/train/*.py ./source/tests/*.py ./source/op/*.py"
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/package_c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Build C library

on:
push:
pull_request:

jobs:
build_c:
name: Build C library
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Package C library
run: ./source/install/docker_package_c.sh
- name: Test C library
run: ./source/install/docker_test_package_c.sh
# for download and debug
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
path: ./libdeepmd_c.tar.gz
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: libdeepmd_c.tar.gz
30 changes: 28 additions & 2 deletions .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
name: Test C++
jobs:
testpython:
testcc:
name: Test C++
runs-on: ubuntu-latest
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
Expand All @@ -13,5 +13,31 @@ jobs:
- uses: actions/checkout@master
- run: source/install/test_cc_local.sh
env:
OMP_NUM_THREADS: 1
TF_INTRA_OP_PARALLELISM_THREADS: 1
TF_INTER_OP_PARALLELISM_THREADS: 1
tensorflow_root: /usr/local
- run: source/install/codecov.sh
# test lammps
- run: apt-get update && apt-get install -y python3-pip python3-venv
- run: source/install/build_lammps.sh
- run: |
python -m pip install -U pip
python -m pip install -e .[cpu,test]
env:
DP_BUILD_TESTING: 1
- run: pytest --cov=deepmd source/lmp/tests
env:
OMP_NUM_THREADS: 1
TF_INTRA_OP_PARALLELISM_THREADS: 1
TF_INTER_OP_PARALLELISM_THREADS: 1
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
- uses: codecov/codecov-action@v3
with:
gcov: true
pass:
name: Pass testing C++
needs: [testcc]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"
40 changes: 13 additions & 27 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,10 @@ name: Test Python
jobs:
testpython:
name: Test Python
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
strategy:
matrix:
include:
- python: 3.6
gcc: 4.8
tf: 1.8
- python: 3.6
gcc: 4.8
tf: 1.12
- python: 3.6
gcc: 4.8
tf: 1.14
- python: 3.6
gcc: 5
tf: 1.14
- python: 3.6
gcc: 8
tf: 1.14
- python: 3.7
gcc: 5
tf: 1.14
Expand Down Expand Up @@ -54,20 +39,21 @@ jobs:
- name: work around permission issue
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
- uses: actions/checkout@master
- name: pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key:
${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- run: python -m pip install -U pip>=21.3.1
- run: pip install -e .[cpu,test] codecov
- run: pip install -e .[cpu,test]
env:
CC: gcc-${{ matrix.gcc }}
CXX: g++-${{ matrix.gcc }}
TENSORFLOW_VERSION: ${{ matrix.tf }}
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"
DP_BUILD_TESTING: 1
- run: dp --version
- run: pytest --cov=deepmd source/tests && codecov
- run: pytest --cov=deepmd source/tests --durations=0
- uses: codecov/codecov-action@v3
with:
gcov: true
pass:
name: Pass testing Python
needs: [testpython]
runs-on: ubuntu-latest
steps:
- run: echo "All jobs passed"
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ _templates
API_CC
doc/api_py/
doc/api_core/
doc/api_c/
dp/
dp_test/
dp_test_cc/
dp_test_c/
dp_c/
build_lammps/
.idea/
build_tests/
build_cc_tests
build_c_tests
build_c/
libdeepmd_c/

0 comments on commit 89d0d23

Please sign in to comment.