-
Notifications
You must be signed in to change notification settings - Fork 523
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
refact: the DPA2 descriptor #3758
Conversation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Duo <[email protected]>
Warning Rate Limit Exceeded@iProzd has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 1 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates focus on enhancing the Changes
This summary condenses the changes across different files for a more concise overview. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Signed-off-by: Duo <[email protected]>
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 11
Out of diff range and nitpick comments (1)
deepmd/pt/model/descriptor/repformer_layer.py (1)
271-290
: Review the initialization parameters ofAtten2Map
.Consider adding default values for parameters such as
has_gate
andsmooth
in theAtten2Map
class to enhance usability and avoid potential errors if these parameters are not provided.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
Out of diff range and nitpick comments (2)
deepmd/pt/model/descriptor/repformer_layer.py (2)
32-67
: Consider adding type hints for_scale
and_mode
in theget_residual
function to improve code readability and maintainability.
494-494
: Plan to refactorgrrg
for reuse across descriptors.The method
grrg
could be reused in different descriptors. Plan a refactoring in a future PR to improve code reuse and maintainability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Out of diff range and nitpick comments (1)
deepmd/pt/model/descriptor/repformer_layer.py (1)
32-67
: Consider adding type hints for all parameters in theget_residual
function to enhance code readability and maintainability.
- Refact the DPA2 descriptor in PyTorch with clearer interface - Support residual - Remove bn - Add numpy implement <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a new descriptor class `DescrptDPA2` implementing DPA-2 functionality for computing descriptors and representations based on input coordinates and atom types. - Expanded supported backends for DPA-2 descriptor to include DP in addition to PyTorch. - **Documentation** - Updated the supported backends information in the documentation for the DPA-2 descriptor to reflect the addition of DP backend support. - Added a reference to the model implementation and a training example link in the DPA-2 descriptor documentation. - **Tests** - Introduced test cases for the `DescrptDPA2` class in different frameworks like TensorFlow, PyTorch, and DeepMD to cover various parameters and configurations. - Validated the functionality of the `DescrptDPA2` descriptor class for deep learning models in the test case class `TestDescrptDPA2`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Duo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Refact the DPA2 descriptor in PyTorch with clearer interface - Support residual - Remove bn - Add numpy implement <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added a new descriptor class `DescrptDPA2` implementing DPA-2 functionality for computing descriptors and representations based on input coordinates and atom types. - Expanded supported backends for DPA-2 descriptor to include DP in addition to PyTorch. - **Documentation** - Updated the supported backends information in the documentation for the DPA-2 descriptor to reflect the addition of DP backend support. - Added a reference to the model implementation and a training example link in the DPA-2 descriptor documentation. - **Tests** - Introduced test cases for the `DescrptDPA2` class in different frameworks like TensorFlow, PyTorch, and DeepMD to cover various parameters and configurations. - Validated the functionality of the `DescrptDPA2` descriptor class for deep learning models in the test case class `TestDescrptDPA2`. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Duo <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
DescrptDPA2
implementing DPA-2 functionality for computing descriptors and representations based on input coordinates and atom types.Documentation
Tests
DescrptDPA2
class in different frameworks like TensorFlow, PyTorch, and DeepMD to cover various parameters and configurations.DescrptDPA2
descriptor class for deep learning models in the test case classTestDescrptDPA2
.