-
Notifications
You must be signed in to change notification settings - Fork 584
fix(tf): fix serialization of dipole fitting with sel_type #4934
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
Conversation
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
|
@copilot continue your work. |
- Fixed NetworkCollection serialization to handle None networks properly - Added missing @variables and sel_type to DipoleFittingSeA serialization - All tests pass and backend conversion works successfully - Fixes #3672 Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Work completed! Successfully fixed the dipole model backend conversion issue. The changes handle |
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
|
@copilot please add tests for |
- Add TestDipoleSelType class for cross-backend consistency testing with sel_type=[0,1] - Add TestDipoleSelTypeBehavior class with specific sel_type functionality tests: * test_tf_sel_type_all_types: verify TF dipole fitting with all types selected * test_tf_sel_type_partial: verify TF dipole fitting with partial type selection * test_dp_exclude_types_behavior: verify DP dipole fitting exclude_types behavior * test_serialization_with_excluded_types: verify sel_type is properly stored * test_network_collection_none_handling: verify NetworkCollection handles None networks - Fix TF fitting.py to handle None networks in deserialization (skip instead of assert) - All tests pass and verify the sel_type bug fix works correctly Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
Added comprehensive tests for
All tests pass and verify the |
… sel_type Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
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.
Pull Request Overview
This PR fixes backend conversion issues for dipole models when using the sel_type parameter, addressing issue #3672. The dp convert-backend command was failing due to incomplete serialization support for dipole fitting configurations.
- Enhances NetworkCollection to handle
Nonenetworks in serialization and deserialization - Adds missing serialization components to DipoleFittingSeA for PyTorch compatibility
- Implements proper handling of selective type fitting during backend conversion
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
deepmd/dpmodel/utils/network.py |
Enhanced NetworkCollection to serialize None networks and skip completeness checks when networks contain None values |
deepmd/tf/fit/dipole.py |
Added missing @variables dictionary and sel_type serialization for proper backend conversion |
deepmd/tf/fit/fitting.py |
Modified deserialization to skip None networks instead of asserting failure |
source/tests/consistent/fitting/test_dipole.py |
Added parameterized testing for sel_type parameter and custom test method for TF consistency |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #4934 +/- ##
=======================================
Coverage 84.28% 84.28%
=======================================
Files 705 705
Lines 69058 69064 +6
Branches 3573 3573
=======================================
+ Hits 58204 58211 +7
+ Misses 9714 9713 -1
Partials 1140 1140 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com>
|
@copilot resolve conflicts. |
Conflicts resolved! Successfully rebased the branch against the latest devel branch. The merge conflict in .gitignore has been fixed by properly combining both the test output file patterns and training/model output file patterns. The branch is now up-to-date and ready for merging. (Commit 4963430) |
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
…ing#4934) Fix deepmodeling#3672. Fixes backend conversion issues for dipole models when using the `sel_type` parameter. The `dp convert-backend` command was failing due to missing serialization support for `None` networks and incomplete dipole fitting serialization. - [x] Fix NetworkCollection serialization to handle `None` networks - [x] Add missing `@variables` dictionary for DipoleFittingSeA PyTorch compatibility - [x] Include `sel_type` in serialized data for proper backend conversion - [x] Fix TF fitting deserialization to skip `None` networks - [x] Add comprehensive tests for `sel_type` parameter - [x] Remove duplicate test classes and merge parameterized tests - [x] Clean up accidentally committed test output files - [x] Refactor additional_data property to return dictionary directly - [x] Resolve merge conflicts in .gitignore after rebase All tests pass and the `dp convert-backend` command now works for dipole models with `sel_type` parameter. The branch has been successfully rebased against the latest devel branch with all conflicts resolved. <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/deepmodeling/deepmd-kit/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo. --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: njzjz <9496702+njzjz@users.noreply.github.com> Co-authored-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Fix #3672.
Fixes backend conversion issues for dipole models when using the
sel_typeparameter. Thedp convert-backendcommand was failing due to missing serialization support forNonenetworks and incomplete dipole fitting serialization.Nonenetworks@variablesdictionary for DipoleFittingSeA PyTorch compatibilitysel_typein serialized data for proper backend conversionNonenetworkssel_typeparameterAll tests pass and the
dp convert-backendcommand now works for dipole models withsel_typeparameter. The branch has been successfully rebased against the latest devel branch with all conflicts resolved.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.