-
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
test(pt): add common test case for model/atomic model #3767
Conversation
Fix deepmodeling#3501. Fix deepmodeling#3517. Fix deepmodeling#3518. Signed-off-by: Jinzhe Zeng <[email protected]>
Warning Rate Limit Exceeded@njzjz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 47 minutes and 48 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 changes involve improvements across various components related to atomic models, model testing, and utility functions. These updates include additions like new methods for model classes, expanded functionalities for building neighbor lists, and the introduction of SPDX license identifiers in test modules. Changes
Assessment against linked issues
The recent code changes align well with the objectives outlined in the linked issues, particularly in enhancing serialization/deserialization tests and ensuring JIT interface testing for all models. However, the specific testing for 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 (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #3767 +/- ##
==========================================
- Coverage 82.58% 74.42% -8.17%
==========================================
Files 515 515
Lines 48796 48795 -1
Branches 2982 2982
==========================================
- Hits 40300 36317 -3983
- Misses 7585 11775 +4190
+ Partials 911 703 -208 ☔ View full report in Codecov by Sentry. |
#3763 has fixed the tests, so I'll not resolve it in this PR. |
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.
- Do we need a similar test for DP models? or we use a consistent test.
- The forward and forward_lower test is different for spin_models, see source/tests/pt/model/test_forward_lower.py
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.
I agree with @iProzd , a multi-backend test support is necessary.
Signed-off-by: Jinzhe Zeng <[email protected]>
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 (2)
deepmd/dpmodel/model/make_model.py (1)
Line range hint
46-91
: Consider adding comments to explain each step in thecall
method for better readability and maintainability.deepmd/pt/model/atomic_model/base_atomic_model.py (1)
Line range hint
115-157
: Consider adding comments to explain each step in theforward_common_atomic
method for better readability and maintainability.
Signed-off-by: Jinzhe Zeng <[email protected]>
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: 2
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Jinzhe Zeng <[email protected]>
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.
Comments updated below.
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.
- As @wanghan-iapcm said, if we want to add a test, such as permutation invariance, the standard way is to add a common test method in
AtomicModelTestCase
right? - If one model has different behavior to test a common test method, such as
forward_lower
test for SpinModel, it's expected to overwrite the method in SpinModel's test case. Is it right?
You are correct. |
) Fix deepmodeling#3501. Fix deepmodeling#3517. Fix deepmodeling#3518. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Expanded testing capabilities for atomic and energy models to improve accuracy and reliability in energy calculations. - Implemented new test cases for atomic and energy models, along with common model test cases, to validate diverse functionalities and calculations. - Introduced test case classes for atomic and energy models with methods to assess parameters, types, outputs, and forward computations. - Added utility functions for testing PyTorch-based deep learning models with a custom backend. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Fix #3501. Fix #3517. Fix #3518.
Summary by CodeRabbit