-
Notifications
You must be signed in to change notification settings - Fork 526
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make deep tensor deriv again #805
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## devel #805 +/- ##
==========================================
+ Coverage 73.68% 73.99% +0.31%
==========================================
Files 85 84 -1
Lines 6646 6733 +87
==========================================
+ Hits 4897 4982 +85
- Misses 1749 1751 +2
Continue to review full report at Codecov.
|
njzjz
reviewed
Jun 27, 2021
amcadmus
reviewed
Jun 30, 2021
amcadmus
reviewed
Jun 30, 2021
amcadmus
approved these changes
Jul 1, 2021
gzq942560379
pushed a commit
to HPC-AI-Team/deepmd-kit
that referenced
this pull request
Sep 2, 2021
* fix build bug with cuda 11 * git ignore files generated during build * global, force, virial for tensor model in python * speed up reverse_map in deep_eval * add atom_virial in tensor model; handle suffix * support tensor force and virial in python infer * update gitignore to exclude c++ test builds * add a new dipole unit test to reveal the cpp bug * fix the c++ deeptensor sorting bug (I assume) * change graph output tensor to rank 2 * fix the missing semicolon * implement c++ tensor force and virial bug have a bug with nlist * fix some other bugs, but the nlist on remains * add finite difference for tensor py infer test * fix the nlist bug! * add unittests for c++ deeppolar force * skip new tests if tf version is too low * update .gitignore * add print summary for deep tensor * fix tab alignment for new functions * reorganize overloads, refine finite difference
njzjz
added a commit
to njzjz/deepmd-kit
that referenced
this pull request
Sep 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main purpose of this PR is to implement the (component-wise) force and virial calculation for the global tensor predicted by deep tensor models. Since the outputs are tensors, the force and tensor are calculated on each separate component and later stacked together. Similar tasks has been implemented for dplr calculation in
DataModifier
class. The current one has the following difference:The design is chosen to fit the potential usage in plumed. If per-atom derivative is needed instead, consider using DataModifier or modify it.
In detail, the PR mainly do the following things:
eval_full
inDeepTensor
python class, which resembles theeval
function inDeepPot
class, that will output global tensor, force and virial (and atomic tensor and atomic virial ifatoimc=True
)compute
function inDeepTensor
c++ class, which again resemble thecompute
function inDeepPot
class, and correspond to the python counter partas well as several minor changes:
eval
in the python class ofDeepTensor
to handle the pbc correctlyand some technical details:
.gitignore
to exclude some files generated during tests (but may not be all)std=c++11
even in cuda 11 (temporarily) to avoid compiling error ([Feature Request] support-std=c++17
#755)The implementation of this PR paid special attention to backward compatibility, so the old models should still be able to run on the new code without changing anything. However, to use the new force and virial feature, one needs to retrain (since I directly changed the procedure of building the graph) and refreeze a new model.