Skip to content

nvnmd#1707

Merged
wanghan-iapcm merged 23 commits into
deepmodeling:develfrom
LiuGroupHNU:devel
Jun 28, 2022
Merged

nvnmd#1707
wanghan-iapcm merged 23 commits into
deepmodeling:develfrom
LiuGroupHNU:devel

Conversation

@LiuGroupHNU

Copy link
Copy Markdown
Collaborator

Our training procedure consists of not only the continuous neural network (CNN) training, but also the quantized neural network (QNN) training which uses the results of CNN as inputs, to help users train machine-learning models that are compatible with the unique non von Neumann computer.

LiuGroupHNU added 3 commits May 13, 2022 19:40
@codecov-commenter

codecov-commenter commented May 13, 2022

Copy link
Copy Markdown

Codecov Report

Merging #1707 (019c325) into devel (40ef0e0) will increase coverage by 1.01%.
The diff coverage is 82.59%.

@@            Coverage Diff             @@
##            devel    #1707      +/-   ##
==========================================
+ Coverage   76.08%   77.10%   +1.01%     
==========================================
  Files          96      118      +22     
  Lines        7927     9411    +1484     
==========================================
+ Hits         6031     7256    +1225     
- Misses       1896     2155     +259     
Impacted Files Coverage Δ
source/op/_tanh4_nvnmd_grad.py 21.73% <21.73%> (ø)
source/op/_map_nvnmd_grad.py 23.80% <23.80%> (ø)
source/op/_tanh2_nvnmd_grad.py 23.80% <23.80%> (ø)
source/op/_matmul_nvnmd_grad.py 35.71% <35.71%> (ø)
source/op/_quantize_nvnmd_grad.py 45.45% <45.45%> (ø)
deepmd/nvnmd/entrypoints/train.py 53.33% <53.33%> (ø)
deepmd/utils/argcheck.py 89.52% <60.00%> (-0.51%) ⬇️
deepmd/entrypoints/freeze.py 72.83% <66.66%> (-0.24%) ⬇️
deepmd/nvnmd/utils/fio.py 71.11% <71.11%> (ø)
deepmd/entrypoints/main.py 86.95% <71.42%> (-1.01%) ⬇️
... and 19 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 40ef0e0...019c325. Read the comment docs.

@njzjz njzjz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before further review, I have the following general comments:
(1) Translate all Chinese comments into English;
(2) Format codes under deepmd/nvnmd with pep8;
(3) Add doc to each new class and methods to explain the role of them;
(4) Reduce data in the examples diretory. As an example, one data set is enough.
(5) Add unit tests for new codes;
(6) Use os.path.join to combine paths instead of /.

Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread deepmd/__init__.py Outdated
Comment thread examples/nvnmd/data/GeTe/data.037/energy.raw Outdated
Comment thread deepmd/entrypoints/freeze.py Outdated
Comment thread deepmd/nvnmd/utils/format_string.py Outdated
Comment thread examples/nvnmd/data/GeTe/data-train-gete/raw_to_set.sh Outdated
Comment thread source/op/env_mat_nvnmd.cc Outdated
Comment thread deepmd/nvnmd/utils/atoms.py Outdated
Comment thread source/op/tanh2_nvnmd.cc Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread deepmd/train/trainer.py Outdated
Comment thread source/op/env_mat_nvnmd.cc Outdated
LiuGroupHNU added 2 commits May 14, 2022 22:22
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread source/op/prod_env_mat_multi_device_nvnmd.cc Outdated
Comment thread deepmd/nvnmd/entrypoints/map.py Outdated
Comment thread deepmd/nvnmd/entrypoints/map.py Outdated
Comment thread deepmd/nvnmd/entrypoints/freeze.py Outdated
Comment thread deepmd/nvnmd/utils/fio.py Outdated
Comment thread deepmd/nvnmd/utils/fio.py Outdated
Comment thread deepmd/nvnmd/entrypoints/train.py Outdated
Comment thread deepmd/nvnmd/entrypoints/train.py Outdated
Comment thread deepmd/nvnmd/utils/network.py Outdated

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that all examples are removed. What is the reason?
Please follow @njzjz 's comment :
(4) Reduce data in the examples diretory. As an example, one data set is enough.

Comment thread deepmd/fit/ener.py Outdated
Comment thread deepmd/nvnmd/entrypoints/freeze.py Outdated

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All C++ code implementing an OP (can be tested without TF C++ interface), should be moved from source/op to source/lib/src.
UTs of the OP implementation should be added.

Comment thread deepmd/nvnmd/utils/fio.py Outdated
@njzjz

This comment was marked as resolved.

Comment thread deepmd/entrypoints/freeze.py
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread source/op/map_nvnmd.cc Outdated
Comment thread deepmd/entrypoints/main.py Outdated
Comment thread doc/nvnmd/nvnmd.md Outdated
@wanghan-iapcm wanghan-iapcm requested a review from njzjz May 18, 2022 01:53
@njzjz

This comment was marked as resolved.

Comment thread doc/nvnmd/nvnmd.md Outdated
Comment thread source/op/map_nvnmd.cc
.Input("dv: T")
.Input("grad_v: T")
.Input("grad_dv: T")
.Attr("prec: float")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here prec is float but x may be either double or float. I think this cannot improve accuracy to double when you multiply x by prec.

Comment thread source/op/matmul_nvnmd.cc Outdated
Comment thread deepmd/nvnmd/utils/fio.py Outdated
Comment thread deepmd/nvnmd/utils/fio.py Outdated
Comment thread deepmd/utils/argcheck.py
Comment thread deepmd/nvnmd/utils/config.py Outdated
self.quantize_descriptor = True
self.quantize_fitting_net = True
else:
pass

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

raise RuntimeError if it's not expected behavior

Comment thread source/tests/test_nvnmd_op.py
@njzjz

This comment was marked as resolved.

@github-actions github-actions Bot added the Core label Jun 13, 2022
Comment thread .github/workflows/lint_python.yml Outdated
Comment thread deepmd/nvnmd/data/data.py
Comment thread doc/nvnmd/nvnmd.md Outdated
Comment thread deepmd/nvnmd/utils/argcheck.py
Comment thread deepmd/nvnmd/entrypoints/mapt.py Outdated
log = logging.getLogger(__name__)


class Encode():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A lot of codes don't have the unit test, for example this class. See details of converge:

https://app.codecov.io/gh/deepmodeling/deepmd-kit/compare/1707/tree/deepmd/nvnmd

@njzjz njzjz requested a review from wanghan-iapcm June 14, 2022 20:14
@LiuGroupHNU LiuGroupHNU requested a review from njzjz June 15, 2022 01:25
Comment thread deepmd/nvnmd/entrypoints/mapt.py Outdated
Comment thread deepmd/nvnmd/descriptor/__init_.py
@njzjz

njzjz commented Jun 20, 2022

Copy link
Copy Markdown
Member

Code quality is acceptable. ping @wanghan-iapcm for more comments

@LiuGroupHNU LiuGroupHNU requested review from njzjz June 20, 2022 11:02

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of the data files coord.npy and force.npy are 1M. Could you please reduce the number of frames to make the files as small as possible? I would say 0.1M would be ideal. They present only for the purpose of showing the code is working.

Comment thread deepmd/nvnmd/descriptor/se_a.py Outdated


def descrpt2r4(inputs, natoms):
""" replace :math:`r_{ji} \rightarrow r'_{ji}`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
""" replace :math:`r_{ji} \rightarrow r'_{ji}`
r""" replace :math:`r_{ji} \rightarrow r'_{ji}`

otherwise \r will be recognized as the line separator.

@wanghan-iapcm wanghan-iapcm left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wanghan-iapcm wanghan-iapcm merged commit 32967cf into deepmodeling:devel Jun 28, 2022
mingzhong15 pushed a commit to mingzhong15/deepmd-kit that referenced this pull request Jan 15, 2023
Co-authored-by: LiuGroupHNU <liujie123@HNU>
Co-authored-by: MoPinghui <mopinghui1020@gmail.com>
Co-authored-by: Han Wang <92130845+wanghan-iapcm@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants