Skip to content
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

Implementation of se_a_mask op #2313

Merged
merged 15 commits into from
Feb 14, 2023
Merged

Conversation

dingye18
Copy link
Contributor

  • Implement se_a_mask op. Training and inference (c++ interface) are tested. Unit test files are required.

  • Fix bug in atom pref setting for forces.

  • Add the unit test for descrpt se_a_mask

  • Remove the unit test for dp mask model

  • Update dp mask system path for unit test

* Implement se_a_mask op. Training and inference (c++ interface) are tested. Unit test files are required.

* Fix bug in atom pref setting for forces.

* Add the unit test for descrpt se_a_mask

* Remove the unit test for dp mask model

* Update dp mask system path for unit test
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Base: 74.89% // Head: 74.80% // Decreases project coverage by -0.10% ⚠️

Coverage data is based on head (1be2702) compared to base (96d3a1d).
Patch coverage: 75.56% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #2313      +/-   ##
==========================================
- Coverage   74.89%   74.80%   -0.10%     
==========================================
  Files         217      222       +5     
  Lines       21613    22168     +555     
  Branches     1586     1627      +41     
==========================================
+ Hits        16187    16582     +395     
- Misses       4401     4532     +131     
- Partials     1025     1054      +29     
Impacted Files Coverage Δ
source/op/prod_force_se_a_mask_grad.cc 13.09% <13.09%> (ø)
source/op/_prod_force_se_a_mask_grad.py 71.42% <71.42%> (ø)
deepmd/loss/ener.py 63.21% <76.66%> (-2.24%) ⬇️
deepmd/descriptor/se_a_mask.py 86.20% <86.20%> (ø)
source/op/descrpt_se_a_mask.cc 87.50% <87.50%> (ø)
source/op/prod_force_se_a_mask.cc 89.77% <89.77%> (ø)
deepmd/descriptor/__init__.py 100.00% <100.00%> (ø)
deepmd/fit/ener.py 89.36% <100.00%> (+0.06%) ⬆️
deepmd/utils/argcheck.py 90.66% <100.00%> (+0.29%) ⬆️
deepmd/utils/weight_avg.py 19.04% <0.00%> (-0.96%) ⬇️
... and 9 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@njzjz njzjz changed the title Implementation of se_a_mask op. (#3) Implementation of se_a_mask op Feb 11, 2023
deepmd/utils/argcheck.py Outdated Show resolved Hide resolved
deepmd/descriptor/se_a_mask.py Outdated Show resolved Hide resolved
source/op/descrpt_se_a_mask.cc Outdated Show resolved Hide resolved
deepmd/fit/ener.py Outdated Show resolved Hide resolved
dingye18 and others added 5 commits February 12, 2023 16:19
…ptSeAMask Inherit from DescrptSeA (#4)

* Implement se_a_mask op. Training and inference (c++ interface) are tested. Unit test files are required.

* Fix bug in atom pref setting for forces.

* Add the unit test for descrpt se_a_mask

* Remove the unit test for dp mask model

* Update dp mask system path for unit test

* Remove total_atom_num dependency in se_a_mask. Fetch total atom num through natoms vector.

* Merge devel to dp_mask
* Implement se_a_mask op. Training and inference (c++ interface) are tested. Unit test files are required.

* Fix bug in atom pref setting for forces.

* Add the unit test for descrpt se_a_mask

* Remove the unit test for dp mask model

* Update dp mask system path for unit test

* Remove total_atom_num dependency in se_a_mask. Fetch total atom num through natoms vector.

* Merge devel to dp_mask

* Fix issue in argcheck.
deepmd/utils/argcheck.py Outdated Show resolved Hide resolved
deepmd/descriptor/se_a_mask.py Show resolved Hide resolved
Copy link
Collaborator

@wanghan-iapcm wanghan-iapcm left a comment

Choose a reason for hiding this comment

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

  • please add to the doc how to use the se_a_mask and provide an example
  • I do not see the necessity of the changes in the deepmd/loss/ener.py.

@dingye18
Copy link
Contributor Author

  • please add to the doc how to use the se_a_mask and provide an example
  • I do not see the necessity of the changes in the deepmd/loss/ener.py.
  • The doc for se_a_mask is added. Example input and data system are put into examples/zinc_protein directory.
  • The changes in deepmd/loss/ener.py is necessary. Since the return virial tensor is set to be None in se_a_mask and energy.npy is not provided by default. The previous version will throw an error when doing tf.reshape(virial, [-1]) and trying to find energy.npy for l2_ener_loss calculation.

@wanghan-iapcm wanghan-iapcm merged commit 4eb753e into deepmodeling:devel Feb 14, 2023
dingye18 added a commit to dingye18/deepmd-kit that referenced this pull request Feb 17, 2023
* print MAE for `dp test` (deepmodeling#2310)

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Fix bug deepmodeling#2311 when using FP32 in se_atten (deepmodeling#2312)

Fix bug deepmodeling#2311 when using FP32 in se_atten

* support multiple frames DeepPot in C/hpp API (deepmodeling#2309)

* Add DeepPot C API v2 to support multiple frames. Also, preserve the
arguments for fparam and aparam for future use (planned in deepmodeling#2236). V1 is
kept for API and ABI compatibility.
* Support multiple frames for DeepPot hpp API. The API compatibility is
kept. Add tests for new situation.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>

* Implementation of se_a_mask op (deepmodeling#2313)

* Implement se_a_mask op. Training and inference (c++ interface) are
tested. Unit test files are required.

* Fix bug in atom pref setting for forces.

* Add the unit test for descrpt se_a_mask

* Remove the unit test for dp mask model

* Update dp mask system path for unit test

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* support exclude_types for se_atten (deepmodeling#2315)

Fix deepmodeling#2232.

Also, clean old useless codes for `exclude_types`.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>

* fix restarting from the original model (deepmodeling#2317)

deepmodeling#2253 supports restarting from the compressed model but breaks the
original model. This PR fixes the error by detecting the model type
first.

```
FAILED_PRECONDITION: Attempting to use uninitialized value
```

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>

* package dp_ipi in the PyPI wheels (deepmodeling#2320)

Fix deepmodeling#2282.

In addition, change the return code of `dp_ipi` (without any arguments)
from 1 to 0.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* build Docker images for each push (deepmodeling#2324)

and push the image to the GitHub container.

Also, provide the pypi CUDA support for pypi LAMMPS.

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>

* Fix typo in install docs (deepmodeling#2325)

Signed-off-by: Chun Cai <amoycaic@gmail.com>

* Add a script to detect model version (deepmodeling#2318)

This PR adds a script in deepmd/utils to detect the version of a Deep
Potential model.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Chun Cai <amoycaic@gmail.com>
Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Duo <50307526+iProzd@users.noreply.github.com>
Co-authored-by: Chun Cai <amoycaic@gmail.com>
Co-authored-by: Yifan Li李一帆 <yifanl0716@gmail.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.

4 participants