Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
8d30333
Merge master into devel (#2872)
wanghan-iapcm Sep 27, 2023
498bfa0
nvnmd: update doc and fix bug in map_flt_nvnmd.cc (#2831)
LiuGroupHNU Sep 27, 2023
e937345
apply compression for se_e2_a_tebd (#2841)
nahso Sep 27, 2023
a184e3b
docs: update DPRc examples to make it compressible (#2874)
njzjz Sep 30, 2023
9af26fb
cmake: skip executing python when cross compiling (#2876)
njzjz Sep 30, 2023
9050973
fix cuda installation for building wheels (#2879)
njzjz Sep 30, 2023
c4d8318
docs: add easy install development version (#2880)
njzjz Sep 30, 2023
cf61140
forward GPU error message (#2878)
njzjz Sep 30, 2023
8acb460
fix source distribution version in build-wheel.yml (#2883)
njzjz Oct 3, 2023
454af37
set GPU binding in DeepTensor and DataModifier (#2886)
Yi-FanLi Oct 3, 2023
714ff8a
fix LAMMPS wheel with CUDA wheels (#2887)
njzjz Oct 3, 2023
ba86a7b
docs: replace relative URLs in PyPI documentation (#2885)
njzjz Oct 3, 2023
f7b87c3
cmake: support LAMMPS in built-in mode; remove kspace requirement (#2…
njzjz Oct 3, 2023
f256dff
Generate CUDA stubs dynamically (#2884)
njzjz Oct 3, 2023
1ef7b7c
run Test CUDA in container (#2892)
njzjz Oct 5, 2023
931c9ba
fix a typo in tool.cibuildwheel.linux.environment (#2896)
njzjz Oct 5, 2023
6f4fc02
update vendored Implib.so to fix ld warnings (#2900)
njzjz Oct 5, 2023
7bf1619
refactor update_sel (#2901)
njzjz Oct 5, 2023
ba3376b
[pre-commit.ci] pre-commit autoupdate (#2893)
pre-commit-ci[bot] Oct 5, 2023
14c9964
Se atten grad grad (#2898)
nahso Oct 7, 2023
47d985d
fix TypeError when type_map is not given (#2890)
njzjz Oct 7, 2023
d0edb3a
support combining frozen models into a pairwise DPRc model (#2902)
njzjz Oct 7, 2023
da100dc
support neighbor stat on GPUs (#2897)
njzjz Oct 7, 2023
d5b1423
Add `dpgui` entry point and `dp gui` CLI (#2904)
njzjz Oct 9, 2023
d8ee74b
add explanations for se_a_grad_grad (#2903)
nahso Oct 9, 2023
fbaf96b
[pre-commit.ci] pre-commit autoupdate (#2907)
pre-commit-ci[bot] Oct 10, 2023
66ea4fc
fix "expression result unused" warnings (#2910)
njzjz Oct 11, 2023
b426d14
fix: make the se attn v2 descriptor energy conservative. (#2905)
wanghan-iapcm Oct 11, 2023
8bc4e3f
docs: `mpirun --version` to get MPI version (#2915)
njzjz Oct 13, 2023
fc09e77
unittest for the compression of smooth se_atten descriptor (#2916)
wanghan-iapcm Oct 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# do not show up detailed difference on GitHub
source/3rdparty/* linguist-generated=true
2 changes: 2 additions & 0 deletions .github/workflows/build_wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
name: Install Python
with:
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/test_cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,19 @@ jobs:
test_cuda:
name: Test Python and C++ on CUDA
runs-on: nvidia
# https://github.com/deepmodeling/deepmd-kit/pull/2884#issuecomment-1744216845
container:
image: nvidia/cuda:11.8.0-cudnn8-devel-ubuntu22.04
options: --gpus all
if: github.repository_owner == 'deepmodeling' && github.event.label.name == 'Test CUDA' || github.event_name == 'workflow_dispatch'
steps:
- name: Make sudo and git work
run: apt-get update && apt-get install -y sudo git
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
# cache: 'pip'
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
Expand All @@ -26,14 +32,17 @@ jobs:
&& sudo dpkg -i cuda-keyring_1.0-1_all.deb \
&& sudo apt-get update \
&& sudo apt-get -y install cuda-11-8 libcudnn8=8.9.5.*-1+cuda11.8
if: false # skip as we use nvidia image
- name: Set PyPI mirror for Aliyun cloud machine
run: python -m pip config --user set global.index-url https://mirrors.aliyun.com/pypi/simple/
- run: python -m pip install -U "pip>=21.3.1,!=23.0.0"
- run: pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
- run: python -m pip install -v -e .[gpu,test,lmp,cu11] "ase @ https://github.com/rosswhitfield/ase/archive/edd03571aff6944b77b4a4b055239f3c3e4eeb66.zip"
env:
DP_BUILD_TESTING: 1
DP_VARIANT: cuda
CUDA_PATH: /usr/local/cuda-11.8
- run: dp --version
- run: pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0
- run: python -m pytest -s --cov=deepmd --cov=deepmd_cli source/tests --durations=0
- run: source/install/test_cc_local.sh
env:
OMP_NUM_THREADS: 1
Expand All @@ -45,10 +54,10 @@ jobs:
DP_USE_MPICH2: 1
CUDA_PATH: /usr/local/cuda-11.8
- run: |
export LD_LIBRARY_PATH=${{ github.workspace }}/dp_test/lib:$CUDA_PATH/lib64:$LD_LIBRARY_PATH
export PATH=${{ github.workspace }}/dp_test/bin:$PATH
pytest -s --cov=deepmd source/lmp/tests
pytest -s --cov=deepmd source/ipi/tests
export LD_LIBRARY_PATH=$GITHUB_WORKSPACE/dp_test/lib:$CUDA_PATH/lib64:$LD_LIBRARY_PATH
export PATH=$GITHUB_WORKSPACE/dp_test/bin:$PATH
python -m pytest -s --cov=deepmd source/lmp/tests
python -m pytest -s --cov=deepmd source/ipi/tests
env:
OMP_NUM_THREADS: 1
TF_INTRA_OP_PARALLELISM_THREADS: 1
Expand Down
9 changes: 7 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: "^.+\\.pbtxt$"
Expand All @@ -27,22 +27,26 @@ repos:
hooks:
- id: isort
files: \.py$
exclude: ^source/3rdparty
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.291
rev: v0.0.292
hooks:
- id: ruff
args: ["--fix"]
exclude: ^source/3rdparty
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black-jupyter
exclude: ^source/3rdparty
# numpydoc
- repo: https://github.com/Carreau/velin
rev: 0.0.12
hooks:
- id: velin
args: ["--write"]
exclude: ^source/3rdparty
# Python inside docs
- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
Expand Down Expand Up @@ -102,6 +106,7 @@ repos:
- --comment-style
- "#"
- --no-extra-eol
exclude: ^source/3rdparty
# HTML
- id: insert-license
files: \.(html|vue|xml)$
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ A full [document](doc/train/train-input-auto.rst) on options in the training inp
- [Install GROMACS](doc/install/install-gromacs.md)
- [Building conda packages](doc/install/build-conda.md)
- [Install Node.js interface](doc/install/install-nodejs.md)
- [Easy install the latest development version](doc/install/easy-install-dev.md)
- [Data](doc/data/index.md)
- [System](doc/data/system.md)
- [Formats of a system](doc/data/data-conv.md)
Expand Down
4 changes: 4 additions & 0 deletions backend/dynamic_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def dynamic_metadata(
"pytest",
"pytest-cov",
"pytest-sugar",
"dpgui",
],
"docs": [
"sphinx>=3.1.1",
Expand All @@ -62,6 +63,9 @@ def dynamic_metadata(
"i-PI",
*find_libpython_requires,
],
"gui": [
"dpgui",
],
**get_tf_requirement(tf_version),
"cu11": [
"nvidia-cuda-runtime-cu11",
Expand Down
4 changes: 4 additions & 0 deletions deepmd/descriptor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from .se_a_ebd import (
DescrptSeAEbd,
)
from .se_a_ebd_v2 import (
DescrptSeAEbdV2,
)
from .se_a_ef import (
DescrptSeAEf,
DescrptSeAEfLower,
Expand All @@ -39,6 +42,7 @@
"DescrptHybrid",
"DescrptLocFrame",
"DescrptSeA",
"DescrptSeAEbdV2",
"DescrptSeAEbd",
"DescrptSeAEf",
"DescrptSeAEfLower",
Expand Down
36 changes: 28 additions & 8 deletions deepmd/descriptor/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,20 @@ class SomeDescript(Descriptor):
"""
return Descriptor.__plugins.register(key)

@classmethod
def get_class_by_input(cls, input: dict):
try:
descrpt_type = input["type"]
except KeyError:
raise KeyError("the type of descriptor should be set by `type`")
if descrpt_type in Descriptor.__plugins.plugins:
return Descriptor.__plugins.plugins[descrpt_type]
else:
raise RuntimeError("Unknown descriptor type: " + descrpt_type)

def __new__(cls, *args, **kwargs):
if cls is Descriptor:
try:
descrpt_type = kwargs["type"]
except KeyError:
raise KeyError("the type of descriptor should be set by `type`")
if descrpt_type in Descriptor.__plugins.plugins:
cls = Descriptor.__plugins.plugins[descrpt_type]
else:
raise RuntimeError("Unknown descriptor type: " + descrpt_type)
cls = cls.get_class_by_input(kwargs)
return super().__new__(cls)

@abstractmethod
Expand Down Expand Up @@ -489,3 +493,19 @@ def build_type_exclude_mask(
def explicit_ntypes(self) -> bool:
"""Explicit ntypes with type embedding."""
return False

@classmethod
@abstractmethod
def update_sel(cls, global_jdata: dict, local_jdata: dict):
"""Update the selection and perform neighbor statistics.

Parameters
----------
global_jdata : dict
The global data, containing the training section
local_jdata : dict
The local data refer to the current class
"""
# call subprocess
cls = cls.get_class_by_input(local_jdata)
return cls.update_sel(global_jdata, local_jdata)
18 changes: 18 additions & 0 deletions deepmd/descriptor/hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,21 @@ def pass_tensors_from_frz_model(
def explicit_ntypes(self) -> bool:
"""Explicit ntypes with type embedding."""
return any(ii.explicit_ntypes for ii in self.descrpt_list)

@classmethod
def update_sel(cls, global_jdata: dict, local_jdata: dict):
"""Update the selection and perform neighbor statistics.

Parameters
----------
global_jdata : dict
The global data, containing the training section
local_jdata : dict
The local data refer to the current class
"""
local_jdata_cpy = local_jdata.copy()
local_jdata_cpy["list"] = [
Descriptor.update_sel(global_jdata, sub_jdata)
for sub_jdata in local_jdata["list"]
]
return local_jdata_cpy
13 changes: 13 additions & 0 deletions deepmd/descriptor/loc_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,3 +430,16 @@ def init_variables(
self.dstd = get_tensor_by_name_from_graph(
graph, "descrpt_attr%s/t_std" % suffix
)

@classmethod
def update_sel(cls, global_jdata: dict, local_jdata: dict):
"""Update the selection and perform neighbor statistics.

Parameters
----------
global_jdata : dict
The global data, containing the training section
local_jdata : dict
The local data refer to the current class
"""
return local_jdata
19 changes: 19 additions & 0 deletions deepmd/descriptor/se.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,22 @@ def init_variables(
def precision(self) -> tf.DType:
"""Precision of filter network."""
return self.filter_precision

@classmethod
def update_sel(cls, global_jdata: dict, local_jdata: dict):
"""Update the selection and perform neighbor statistics.

Parameters
----------
global_jdata : dict
The global data, containing the training section
local_jdata : dict
The local data refer to the current class
"""
from deepmd.entrypoints.train import (
update_one_sel,
)

# default behavior is to update sel which is a list
local_jdata_cpy = local_jdata.copy()
return update_one_sel(global_jdata, local_jdata_cpy, False)
Loading