Skip to content

Commit

Permalink
Merge devel into master (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
amcadmus authored May 24, 2023
2 parents 3ac8c4c + 6e4d32f commit 92ca097
Show file tree
Hide file tree
Showing 264 changed files with 163,197 additions and 2,183 deletions.
32 changes: 15 additions & 17 deletions .github/workflows/build_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ jobs:
buildcc:
name: Build C++
runs-on: ubuntu-latest
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
strategy:
matrix:
include:
Expand All @@ -21,32 +20,31 @@ jobs:
- variant: clang
dp_variant: clang
steps:
- name: work around permission issue
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
- uses: actions/checkout@v3
with:
submodules: true
- run: apt-get update && apt-get install -y nvidia-cuda-toolkit
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- run: python -m pip install tensorflow
- run: sudo apt-get update && sudo apt-get install -y nvidia-cuda-toolkit
if: matrix.variant == 'cuda'
- run: |
apt-get update \
&& apt-get -y install wget \
&& wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
&& dpkg -i cuda-keyring_1.0-1_all.deb \
&& apt-get update \
&& apt-get -y install cuda-12-0
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.0-1_all.deb \
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cuda-12-0
if: matrix.variant == 'cuda120'
env:
DEBIAN_FRONTEND: noninteractive
- 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
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/5.3/ jammy main' | sudo tee /etc/apt/sources.list.d/rocm.list \
&& printf 'Package: *\nPin: release o=repo.radeon.com\nPin-Priority: 600' | sudo tee /etc/apt/preferences.d/rocm-pin-600 \
&& curl -s https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add - \
&& sudo apt-get update \
&& sudo apt-get install -y rocm-dev hipcub-dev
if: matrix.variant == 'rocm'
- run: apt-get update && apt-get install -y clang
- run: sudo apt-get update && sudo apt-get install -y clang
if: matrix.variant == 'clang'
- run: source/install/build_cc.sh
env:
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ jobs:
include:
# linux-64
- os: ubuntu-latest
python: 310
python: 311
platform_id: manylinux_x86_64
dp_variant: cuda
# macos-x86-64
- os: macos-latest
python: 310
python: 311
platform_id: macosx_x86_64
dp_variant: cpu
# win-64
- os: windows-2019
python: 310
python: 311
platform_id: win_amd64
dp_variant: cpu
# linux-aarch64
Expand All @@ -42,7 +42,7 @@ jobs:
name: Setup QEMU
if: matrix.platform_id == 'manylinux_aarch64'
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.1
uses: pypa/cibuildwheel@v2.12.3
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: all
Expand All @@ -61,7 +61,7 @@ jobs:
- uses: actions/setup-python@v4
name: Install Python
with:
python-version: '3.10'
python-version: '3.11'
- run: python -m pip install build
- name: Build sdist
run: python -m build --sdist
Expand All @@ -73,16 +73,16 @@ jobs:
upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

build_docker:
# use the already built wheels to build docker
Expand All @@ -95,15 +95,15 @@ jobs:
name: artifact
path: source/install/docker/dist
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
uses: docker/metadata-action@c4ee3adeed93b1fa6a762f209fb01608c1a22f1e
with:
images: ghcr.io/deepmodeling/deepmd-kit

Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/package_c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,41 @@ jobs:
- uses: actions/checkout@v3
- 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@v3
with:
name: libdeepmd_c
path: ./libdeepmd_c.tar.gz
- name: Test C library
run: ./source/install/docker_test_package_c.sh
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: libdeepmd_c.tar.gz
test_c:
name: Test building from C library
needs: [build_c]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: libdeepmd_c
- run: tar -vxzf ./libdeepmd_c.tar.gz
- name: Test C library
run: ./source/install/build_from_c.sh
env:
DEEPMD_C_ROOT: ${{ github.workspace }}/libdeepmd_c
pass:
name: Pass building c library
needs: [build_c, test_c]
runs-on: ubuntu-latest
if: always()
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
17 changes: 10 additions & 7 deletions .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,26 @@ jobs:
testcc:
name: Test C++
runs-on: ubuntu-latest
container: ghcr.io/deepmodeling/deepmd-kit-test-cc:latest
steps:
- name: work around permission issue
run: git config --global --add safe.directory /__w/deepmd-kit/deepmd-kit
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: mpich
- run: python -m pip install tensorflow
- 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
LMP_CXX11_ABI_0: 1
# 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]
python -m pip install -e .[cpu,test,lmp]
env:
DP_BUILD_TESTING: 1
- run: pytest --cov=deepmd source/lmp/tests
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,10 @@ jobs:
- python: 3.7
gcc: 8
tf: 1.14
- python: 3.7
gcc: 5
tf:
- python: 3.7
- python: 3.8
gcc: 8
tf:
- python: "3.10"
gcc: 5
tf:
- python: "3.10"
- python: "3.11"
gcc: 8
tf:

Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ repos:
- id: check-toml
# Python
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.3.0
hooks:
- id: black-jupyter
- repo: https://github.com/PyCQA/isort
Expand All @@ -26,7 +26,7 @@ repos:
files: \.py$
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: v0.0.243
rev: v0.0.269
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -43,7 +43,7 @@ repos:
- id: blacken-docs
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7
rev: v16.0.4
hooks:
- id: clang-format
exclude: ^source/3rdparty|source/lib/src/cuda/cudart/.+\.inc
Expand All @@ -54,7 +54,7 @@ repos:
- id: csslint
# Shell
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-1
rev: v3.6.0-2
hooks:
- id: shfmt
# CMake
Expand Down
19 changes: 0 additions & 19 deletions CITATION.cff

This file was deleted.

Loading

0 comments on commit 92ca097

Please sign in to comment.