Skip to content

Commit

Permalink
merge devel into master (deepmodeling#2725)
Browse files Browse the repository at this point in the history
  • Loading branch information
amcadmus authored Aug 8, 2023
2 parents 6170356 + 16988e4 commit 53a1078
Show file tree
Hide file tree
Showing 650 changed files with 50,663 additions and 175,686 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
---
BasedOnStyle: Google
BinPackParameters: false
InsertBraces: true
...
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Python:
- deepmd/**/*
- deepmd_cli/**/*
- source/tests/**/*
Docs: doc/**/*
Examples: examples/**/*
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ jobs:
python: 311
platform_id: macosx_x86_64
dp_variant: cpu
# macos-arm64
- os: macos-latest
python: 311
platform_id: macosx_arm64
dp_variant: cpu
# win-64
- os: windows-2019
python: 311
Expand All @@ -42,7 +47,7 @@ jobs:
name: Setup QEMU
if: matrix.platform_id == 'manylinux_aarch64'
- name: Build wheels
uses: pypa/cibuildwheel@v2.12.3
uses: pypa/cibuildwheel@v2.14
env:
CIBW_BUILD_VERBOSITY: 1
CIBW_ARCHS: all
Expand Down Expand Up @@ -95,20 +100,20 @@ jobs:
name: artifact
path: source/install/docker/dist
- name: Log in to the Container registry
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

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

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: source/install/docker
push: ${{ github.repository_owner == 'deepmodeling' && github.event_name == 'push' }}
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/test_cc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ jobs:
TF_INTER_OP_PARALLELISM_THREADS: 1
LMP_CXX11_ABI_0: 1
# test lammps
# ASE issue: https://gitlab.com/ase/ase/-/merge_requests/2843
# TODO: remove ase version when ase has new release
- run: |
python -m pip install -U pip
python -m pip install -e .[cpu,test,lmp]
python -m pip install -e .[cpu,test,lmp] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
env:
DP_BUILD_TESTING: 1
- run: pytest --cov=deepmd source/lmp/tests
Expand All @@ -35,6 +37,14 @@ jobs:
TF_INTER_OP_PARALLELISM_THREADS: 1
LAMMPS_PLUGIN_PATH: ${{ github.workspace }}/dp_test/lib/deepmd_lmp
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
# test ipi
- run: pytest --cov=deepmd source/ipi/tests
env:
OMP_NUM_THREADS: 1
TF_INTRA_OP_PARALLELISM_THREADS: 1
TF_INTER_OP_PARALLELISM_THREADS: 1
PATH: ${{ github.workspace }}/dp_test/bin:$PATH
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib
- uses: codecov/codecov-action@v3
with:
gcov: true
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
TENSORFLOW_VERSION: ${{ matrix.tf }}
DP_BUILD_TESTING: 1
- run: dp --version
- run: pytest --cov=deepmd source/tests --durations=0
- run: pytest --cov=deepmd --cov=deepmd_cli source/tests --durations=0
- uses: codecov/codecov-action@v3
with:
gcov: true
gcov_executable: gcov-${{ matrix.gcc }}
pass:
name: Pass testing Python
needs: [testpython]
Expand Down
1 change: 1 addition & 0 deletions .license-header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPDX-License-Identifier: LGPL-3.0-or-later
60 changes: 54 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,29 @@ repos:
- id: check-yaml
#- id: check-json
- id: check-added-large-files
args: ['--maxkb=1024', '--enforce-all']
# TODO: remove the following after resolved
exclude: |
(?x)^(
source/tests/infer/dipolecharge_e.pbtxt|
source/tests/infer/deeppolar_new.pbtxt
)$
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
# Python
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 23.7.0
hooks:
- id: black-jupyter
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
files: \.py$
- repo: https://github.com/charliermarsh/ruff-pre-commit
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.269
rev: v0.0.280
hooks:
- id: ruff
args: ["--fix"]
Expand All @@ -38,12 +45,12 @@ repos:
args: ["--write"]
# Python inside docs
- repo: https://github.com/asottile/blacken-docs
rev: 1.13.0
rev: 1.15.0
hooks:
- id: blacken-docs
# C++
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v16.0.4
rev: v16.0.6
hooks:
- id: clang-format
exclude: ^source/3rdparty|source/lib/src/cuda/cudart/.+\.inc
Expand All @@ -54,7 +61,7 @@ repos:
- id: csslint
# Shell
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-2
rev: v3.7.0-1
hooks:
- id: shfmt
# CMake
Expand All @@ -63,5 +70,46 @@ repos:
hooks:
- id: cmake-format
#- id: cmake-lint
# license header
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
hooks:
# C++, js
- id: insert-license
files: \.(c|cc|cpp|js|ts|h|hpp)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- //
- --no-extra-eol
exclude: ^source/3rdparty|source/lib/src/cuda/cudart/.+\.inc
# CSS
- id: insert-license
files: \.(css|scss)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- /*| *| */
- --no-extra-eol
# Python
- id: insert-license
files: \.(py|pyx)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- "#"
- --no-extra-eol
# HTML
- id: insert-license
files: \.(html|vue|xml)$
args:
- --license-filepath
- .license-header.txt
- --comment-style
- <!--| ~| -->
- --no-extra-eol
ci:
autoupdate_branch: devel
38 changes: 20 additions & 18 deletions CITATIONS.bib
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@ @article{Wang_ComputPhysCommun_2018_v228_p178
pages = {178--184},
}
@misc{Zeng_arXiv_2023,
@Article{Zeng_JChemPhys_2023_v159_p054801,
annote = {general purpose},
title = {{DeePMD-kit v2: A software package for Deep Potential models}},
author = {Jinzhe Zeng and Duo Zhang and Denghui Lu and Pinghui Mo and
Zeyu Li and Yixiao Chen and Marián Rynik and Li'ang Huang and
Ziyao Li and Shaochen Shi and Yingze Wang and Haotian Ye and
Ping Tuo and Jiabin Yang and Ye Ding and Yifan Li and Davide
Tisi and Qiyu Zeng and Han Bao and Yu Xia and Jiameng Huang
and Koki Muraoka and Yibo Wang and Junhan Chang and Fengbo
Yuan and Sigbjørn Løland Bore and Chun Cai and Yinnian Lin
and Bo Wang and Jiayan Xu and Jia-Xin Zhu and Chenxing Luo and
Yuzhi Zhang and Rhys E. A. Goodall and Wenshuo Liang and Anurag
Kumar Singh and Sikai Yao and Jingchao Zhang and Renata
Wentzcovitch and Jiequn Han and Jie Liu and Weile Jia and
Darrin M. York and Weinan E and Roberto Car and Linfeng Zhang
and Han Wang},
year = {2023},
archivePrefix = {arXiv},
doi = {10.48550/arXiv.2304.09409}
title = {{DeePMD-kit v2: A software package for deep potential models}},
author = {Jinzhe Zeng and Duo Zhang and Denghui Lu and Pinghui Mo and Zeyu Li
and Yixiao Chen and Mari{\'a}n Rynik and Li'ang Huang and Ziyao Li and
Shaochen Shi and Yingze Wang and Haotian Ye and Ping Tuo and Jiabin
Yang and Ye Ding and Yifan Li and Davide Tisi and Qiyu Zeng and Han
Bao and Yu Xia and Jiameng Huang and Koki Muraoka and Yibo Wang and
Junhan Chang and Fengbo Yuan and Sigbj{\o}rn L{\o}land Bore and Chun
Cai and Yinnian Lin and Bo Wang and Jiayan Xu and Jia-Xin Zhu and
Chenxing Luo and Yuzhi Zhang and Rhys E A Goodall and Wenshuo Liang
and Anurag Kumar Singh and Sikai Yao and Jingchao Zhang and Renata
Wentzcovitch and Jiequn Han and Jie Liu and Weile Jia and Darrin M
York and Weinan E and Roberto Car and Linfeng Zhang and Han Wang},
journal = {J. Chem. Phys.},
volume = 159,
issue = 5,
year = 2023,
pages = 054801,
doi = {10.1063/5.0155600},
}
@article{Lu_CompPhysCommun_2021_v259_p107624,
annote = {GPU support},
title={{86 PFLOPS Deep Potential Molecular Dynamics simulation of 100 million
Expand Down
9 changes: 9 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prune source/tests
prune source/api_c/tests
prune source/api_cc/tests
prune source/lib/tests
prune source/lmp/tests
prune doc
prune examples
prune data
prune .github
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<span style="font-size:larger;">DeePMD-kit Manual</span>
========
[![GitHub release](https://img.shields.io/github/release/deepmodeling/deepmd-kit.svg?maxAge=86400)](https://github.com/deepmodeling/deepmd-kit/releases)
[![doi:10.1016/j.cpc.2018.03.016](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2018.03.016-blue)](https://doi.org/10.1016/j.cpc.2020.107206)
[![Citations](https://citations.njzjz.win/10.1016/j.cpc.2018.03.016)](https://badge.dimensions.ai/details/doi/10.1016/j.cpc.2018.03.016)
[![offline packages](https://img.shields.io/github/downloads/deepmodeling/deepmd-kit/total?label=offline%20packages)](https://github.com/deepmodeling/deepmd-kit/releases)
[![conda-forge](https://img.shields.io/conda/dn/conda-forge/deepmd-kit?color=red&label=conda-forge&logo=conda-forge)](https://anaconda.org/conda-forge/deepmd-kit)
[![pip install](https://img.shields.io/pypi/dm/deepmd-kit?label=pip%20install)](https://pypi.org/project/deepmd-kit)
Expand Down Expand Up @@ -49,7 +47,11 @@ For more information, check the [documentation](https://deepmd.readthedocs.io/).
The project DeePMD-kit is licensed under [GNU LGPLv3.0](./LICENSE).
If you use this code in any future publications, please cite the following publications for general purpose:
- Han Wang, Linfeng Zhang, Jiequn Han, and Weinan E. "DeePMD-kit: A deep learning package for many-body potential energy representation and molecular dynamics." Computer Physics Communications 228 (2018): 178-184.
- Jinzhe Zeng, Duo Zhang, Denghui Lu, Pinghui Mo, Zeyu Li, Yixiao Chen, Marián Rynik, Li'ang Huang, Ziyao Li, Shaochen Shi, Yingze Wang, Haotian Ye, Ping Tuo, Jiabin Yang, Ye Ding, Yifan Li, Davide Tisi, Qiyu Zeng, Han Bao, Yu Xia, Jiameng Huang, Koki Muraoka, Yibo Wang, Junhan Chang, Fengbo Yuan, Sigbjørn Løland Bore, Chun Cai, Yinnian Lin, Bo Wang, Jiayan Xu, Jia-Xin Zhu, Chenxing Luo, Yuzhi Zhang, Rhys E. A. Goodall, Wenshuo Liang, Anurag Kumar Singh, Sikai Yao, Jingchao Zhang, Renata Wentzcovitch, Jiequn Han, Jie Liu, Weile Jia, Darrin M. York, Weinan E, Roberto Car, Linfeng Zhang, Han Wang. "DeePMD-kit v2: A software package for Deep Potential models." [arXiv:2304.09409](https://doi.org/10.48550/arXiv.2304.09409).
[![doi:10.1016/j.cpc.2018.03.016](https://img.shields.io/badge/DOI-10.1016%2Fj.cpc.2018.03.016-blue)](https://doi.org/10.1016/j.cpc.2018.03.016)
[![Citations](https://citations.njzjz.win/10.1016/j.cpc.2018.03.016)](https://badge.dimensions.ai/details/doi/10.1016/j.cpc.2018.03.016)
- Jinzhe Zeng, Duo Zhang, Denghui Lu, Pinghui Mo, Zeyu Li, Yixiao Chen, Marián Rynik, Li'ang Huang, Ziyao Li, Shaochen Shi, Yingze Wang, Haotian Ye, Ping Tuo, Jiabin Yang, Ye Ding, Yifan Li, Davide Tisi, Qiyu Zeng, Han Bao, Yu Xia, Jiameng Huang, Koki Muraoka, Yibo Wang, Junhan Chang, Fengbo Yuan, Sigbjørn Løland Bore, Chun Cai, Yinnian Lin, Bo Wang, Jiayan Xu, Jia-Xin Zhu, Chenxing Luo, Yuzhi Zhang, Rhys E. A. Goodall, Wenshuo Liang, Anurag Kumar Singh, Sikai Yao, Jingchao Zhang, Renata Wentzcovitch, Jiequn Han, Jie Liu, Weile Jia, Darrin M. York, Weinan E, Roberto Car, Linfeng Zhang, Han Wang. "DeePMD-kit v2: A software package for deep potential models." J. Chem. Phys. 159 (2023): 054801.
[![doi:10.1063/5.0155600](https://img.shields.io/badge/DOI-10.1063%2F5.0155600-blue)](https://doi.org/10.1063/5.0155600)
[![Citations](https://citations.njzjz.win/10.1063/5.0155600)](https://badge.dimensions.ai/details/doi/10.1063/5.0155600)

In addition, please follow [the bib file](CITATIONS.bib) to cite the methods you used.

Expand Down Expand Up @@ -105,7 +107,7 @@ A full [document](doc/train/train-input-auto.rst) on options in the training inp
- [Fit energy](doc/model/train-energy.md)
- [Fit spin energy](doc/model/train-energy-spin.md)
- [Fit `tensor` like `Dipole` and `Polarizability`](doc/model/train-fitting-tensor.md)
- [Fit electronic density of states (DOS)](doc/model/train-fitting-dos.md)
- [Fit electronic density of states (DOS)](doc/model/train-fitting-dos.md)
- [Train a Deep Potential model using `type embedding` approach](doc/model/train-se-e2-a-tebd.md)
- [Deep potential long-range](doc/model/dplr.md)
- [Deep Potential - Range Correction (DPRc)](doc/model/dprc.md)
Expand Down
1 change: 1 addition & 0 deletions backend/dp_backend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
"""A PEP-517 backend to find TensorFlow."""
from typing import (
List,
Expand Down
31 changes: 20 additions & 11 deletions backend/find_tensorflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
import os
import site
from importlib.machinery import (
Expand Down Expand Up @@ -45,7 +46,16 @@ def find_tensorflow() -> Tuple[Optional[str], List[str]]:
requires = []

tf_spec = None
if os.environ.get("TENSORFLOW_ROOT") is not None:
if os.environ.get("CIBUILDWHEEL", "0") == "1" and os.environ.get(
"CIBW_BUILD", ""
).endswith("macosx_arm64"):
# cibuildwheel cross build
site_packages = Path(os.environ.get("RUNNER_TEMP")) / "tensorflow"
tf_spec = FileFinder(str(site_packages)).find_spec("tensorflow")

if (tf_spec is None or not tf_spec) and os.environ.get(
"TENSORFLOW_ROOT"
) is not None:
site_packages = Path(os.environ.get("TENSORFLOW_ROOT")).parent.absolute()
tf_spec = FileFinder(str(site_packages)).find_spec("tensorflow")

Expand Down Expand Up @@ -100,21 +110,20 @@ def get_tf_requirement(tf_version: str = "") -> dict:
if tf_version == "":
return {
"cpu": [
"tensorflow-cpu; platform_machine!='aarch64'",
"tensorflow; platform_machine=='aarch64'",
"tensorflow-cpu; platform_machine!='aarch64' and (platform_machine!='arm64' or platform_system != 'Darwin')",
"tensorflow; platform_machine=='aarch64' or (platform_machine=='arm64' and platform_system == 'Darwin')",
],
"gpu": [
"tensorflow; platform_machine!='aarch64'",
"tensorflow; platform_machine=='aarch64'",
"tensorflow",
"tensorflow-metal; platform_machine=='arm64' and platform_system == 'Darwin'",
],
}
elif tf_version in SpecifierSet("<1.15") or tf_version in SpecifierSet(
">=2.0,<2.1"
):
return {
"cpu": [
f"tensorflow=={tf_version}; platform_machine!='aarch64'",
f"tensorflow=={tf_version}; platform_machine=='aarch64'",
f"tensorflow=={tf_version}",
],
"gpu": [
f"tensorflow-gpu=={tf_version}; platform_machine!='aarch64'",
Expand All @@ -124,12 +133,12 @@ def get_tf_requirement(tf_version: str = "") -> dict:
else:
return {
"cpu": [
f"tensorflow-cpu=={tf_version}; platform_machine!='aarch64'",
f"tensorflow=={tf_version}; platform_machine=='aarch64'",
f"tensorflow-cpu=={tf_version}; platform_machine!='aarch64' and (platform_machine!='arm64' or platform_system != 'Darwin')",
f"tensorflow=={tf_version}; platform_machine=='aarch64' or (platform_machine=='arm64' and platform_system == 'Darwin')",
],
"gpu": [
f"tensorflow=={tf_version}; platform_machine!='aarch64'",
f"tensorflow=={tf_version}; platform_machine=='aarch64'",
f"tensorflow=={tf_version}",
"tensorflow-metal; platform_machine=='arm64' and platform_system == 'Darwin'",
],
}

Expand Down
6 changes: 6 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ignore:
- "source/**/tests"
- "source/3rdparty"
coverage:
status:
project:
Expand All @@ -19,6 +20,7 @@ component_management:
name: Python
paths:
- deepmd/**
- deepmd_cli/**
- component_id: module_op
name: OP
paths:
Expand All @@ -39,3 +41,7 @@ component_management:
name: LAMMPS
paths:
- source/lmp/**
- component_id: module_ipi
name: i-Pi
paths:
- source/ipi/**
Loading

0 comments on commit 53a1078

Please sign in to comment.