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

[Feature Request] manage testing models in a standard way #2103

Open
Tracked by #3122
njzjz opened this issue Nov 17, 2022 · 0 comments · Fixed by #4028
Open
Tracked by #3122

[Feature Request] manage testing models in a standard way #2103

njzjz opened this issue Nov 17, 2022 · 0 comments · Fixed by #4028
Assignees
Milestone

Comments

@njzjz
Copy link
Member

njzjz commented Nov 17, 2022

Summary

Currently, we have many APIs to infer models, such as Python, C++, C, LAMMPS, etc. These APIs use minified models to test. Currently, all testing models are in the Python test directory source/tests/infer/deepdipole_fake.pbtxt. We hope we can move them out of that directory and manage them in a standard way.

Detailed Description

For each model, we may create a metafile:

model: deeppot
filename: some.pbtxt # relative to this file
sha256: ... # if sha256 matches, we do not need to generate models again
type: pbtxt
results:
  - coords: [1., 2., 3., 4., 5., 6.]
    box: null
    atype: [0, 0]
    forces: [...]

I write YAML for convenience, but it could also be a JSON file. Each test program could read these files, and test results are not necessarily defined in the program.

Further Information, Files, and Links

No response

@njzjz njzjz self-assigned this Nov 5, 2023
@njzjz njzjz added this to the v3.0.0 milestone Jan 9, 2024
@njzjz njzjz removed their assignment Jan 31, 2024
njzjz added a commit to njzjz/deepmd-kit that referenced this issue Jul 25, 2024
Propose a plain text model format based on YAML, which can be easily read by humans and might be good to be stored in the git repository (which is good for deepmodeling#2103).

Signed-off-by: Jinzhe Zeng <[email protected]>
github-merge-queue bot pushed a commit that referenced this issue Jul 26, 2024
Propose a plain text model format based on YAML, which humans can easily
read and might be easier to track changes in the git repository (which
is good for #2103).

Example:
[deeppot_dpa_sel.yaml](https://github.com/user-attachments/files/16384230/deeppot_dpa_sel.yaml.txt)


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

## Summary by CodeRabbit

- **New Features**
- Added support for additional file formats (.yaml and .yml) for model
saving and loading.
- Enhanced the ability to serialize and deserialize model data in
multiple formats.

- **Bug Fixes**
- Improved error handling for unsupported file formats during model
loading.

- **Documentation**
- Updated documentation to reflect new supported file formats and
clarify backend capabilities.

- **Tests**
- Introduced new test cases to ensure functionality for saving and
loading models in YAML format.

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

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz self-assigned this Jul 26, 2024
@njzjz njzjz linked a pull request Jul 27, 2024 that will close this issue
github-merge-queue bot pushed a commit that referenced this issue Aug 5, 2024
Fix #2103. Migrate three models (se_e2_a, se_e2_r, and fparam_aparam)
for the Python unit tests. Fix several bugs. Old files are kept until
the C++ tests are also migrated.

Note that several models (for example, the dipole model due to #3672)
cannot be serialized yet.

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


## Summary by CodeRabbit

- **New Features**
- Introduced a structured framework for managing and testing models with
YAML files.
- Added comprehensive configurations for energy calculations and
molecular simulations in YAML format.
- Implemented new test cases for the `DeepPot` and `DeepPotNeighborList`
classes.

- **Bug Fixes**
- Improved robustness in tensor reshaping, resolving potential dimension
mismatches.

- **Tests**
- Enhanced unit tests with a case-based approach for better adaptability
and maintainability.
- Consolidated tests by relocating obsolete classes to streamline the
test suite.

- **Chores**
- Updated deserialization functions for better type safety and input
handling.

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

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this issue Sep 18, 2024
Propose a plain text model format based on YAML, which humans can easily
read and might be easier to track changes in the git repository (which
is good for deepmodeling#2103).

Example:
[deeppot_dpa_sel.yaml](https://github.com/user-attachments/files/16384230/deeppot_dpa_sel.yaml.txt)


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

## Summary by CodeRabbit

- **New Features**
- Added support for additional file formats (.yaml and .yml) for model
saving and loading.
- Enhanced the ability to serialize and deserialize model data in
multiple formats.

- **Bug Fixes**
- Improved error handling for unsupported file formats during model
loading.

- **Documentation**
- Updated documentation to reflect new supported file formats and
clarify backend capabilities.

- **Tests**
- Introduced new test cases to ensure functionality for saving and
loading models in YAML format.

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

Signed-off-by: Jinzhe Zeng <[email protected]>
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this issue Sep 18, 2024
Fix deepmodeling#2103. Migrate three models (se_e2_a, se_e2_r, and fparam_aparam)
for the Python unit tests. Fix several bugs. Old files are kept until
the C++ tests are also migrated.

Note that several models (for example, the dipole model due to deepmodeling#3672)
cannot be serialized yet.

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


## Summary by CodeRabbit

- **New Features**
- Introduced a structured framework for managing and testing models with
YAML files.
- Added comprehensive configurations for energy calculations and
molecular simulations in YAML format.
- Implemented new test cases for the `DeepPot` and `DeepPotNeighborList`
classes.

- **Bug Fixes**
- Improved robustness in tensor reshaping, resolving potential dimension
mismatches.

- **Tests**
- Enhanced unit tests with a case-based approach for better adaptability
and maintainability.
- Consolidated tests by relocating obsolete classes to streamline the
test suite.

- **Chores**
- Updated deserialization functions for better type safety and input
handling.

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

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
@njzjz njzjz modified the milestones: v3.0.0, v3.1.0 Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

1 participant