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

support TF se_e2_a serialization; add a common test fixture to compare TF, PT, and DP models #3263

Merged
merged 17 commits into from
Feb 14, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Feb 12, 2024

Some codes are split from #2987.

…T, and DP models

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
@njzjz njzjz changed the title support TF se_e2_a serialization; add a test fixture to compare TF, PT, and DP models support TF se_e2_a serialization; add a common test fixture to compare TF, PT, and DP models Feb 12, 2024
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

Attention: 15 lines in your changes are missing coverage. Please review.

Comparison is base (6018e3c) 75.27% compared to head (e88f8fe) 75.32%.

Files Patch % Lines
deepmd/tf/descriptor/se_a.py 79.31% 6 Missing ⚠️
deepmd/tf/descriptor/descriptor.py 42.85% 4 Missing ⚠️
deepmd/tf/descriptor/se.py 94.11% 4 Missing ⚠️
deepmd/dpmodel/descriptor/se_e2_a.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3263      +/-   ##
==========================================
+ Coverage   75.27%   75.32%   +0.04%     
==========================================
  Files         373      373              
  Lines       33252    33362     +110     
  Branches     1604     1604              
==========================================
+ Hits        25031    25130      +99     
- Misses       7350     7361      +11     
  Partials      871      871              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@iProzd iProzd left a comment

Choose a reason for hiding this comment

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

Should the status of pt, tf, and dp in testing be considered equivalent? Should we set self.skip_tf, self.skip_pt, and self.skip_dp all? In future model implementations, there might be parts that are not available in tf as well.

source/tests/consistent/common.py Outdated Show resolved Hide resolved
source/tests/consistent/test_se_e2_a.py Outdated Show resolved Hide resolved
source/tests/consistent/test_se_e2_a.py Outdated 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.

I am not sure if the current design is a good idea, because to test the implementation of pt, one have to install the tf. suppose we have 5 backends, the env would be very heavy for the developers.

Ideally, the dp backend can be tested without any deep learning platforms, while any implementation, e.g. pt, can be tested without any other backend.

source/tests/consistent/test_se_e2_a.py Outdated Show resolved Hide resolved
source/tests/consistent/common.py Outdated Show resolved Hide resolved
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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.

would it be possible to loop over a list of possible model parameters like

for idt, prec in itertools.product(
[False, True],
["float64", "float32"],

source/tests/consistent/common.py Outdated Show resolved Hide resolved
source/tests/consistent/common.py Outdated Show resolved Hide resolved
njzjz and others added 9 commits February 13, 2024 04:35
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
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.

I like the design of decorator parameterized very much.

@wanghan-iapcm wanghan-iapcm merged commit 930bc1a into deepmodeling:devel Feb 14, 2024
46 checks passed
@njzjz njzjz mentioned this pull request Apr 2, 2024
njzjz added a commit to njzjz/deepmd-kit that referenced this pull request Jul 5, 2024
Fix deepmodeling#3950. Backport a part of deepmodeling#3263 to r2 (the whole of deepmodeling#3263 is not likely to be backported).

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
wanghan-iapcm pushed a commit that referenced this pull request Jul 6, 2024
Fix #3950. Backport a part of #3263 to r2 (the whole of #3263 is not
likely to be backported).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Introduced new checks to ensure only weight and bias matrices are
supported during tabulation operations.

- **Refactor**
- Removed redundant loop enforcing constraints on node keys related to
weight and bias matrices to streamline operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants