-
Notifications
You must be signed in to change notification settings - Fork 584
fix(tf): fix dplr Python inference #4753
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
Fix deepmodeling#4625. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
📝 Walkthrough""" WalkthroughThe updates refine the handling of model type checking, output key naming, and modifier type decoding in the TensorFlow inference module. Additionally, the test suite is updated to accommodate new expected values and an extra model file conversion, aligning with the internal changes in evaluation logic. Changes
Assessment against linked issues
Possibly related PRs
Suggested reviewers
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
deepmd/tf/infer/deep_eval.py(3 hunks)source/tests/tf/test_dplr.py(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
source/tests/tf/test_dplr.py (1)
deepmd/tf/infer/deep_eval.py (1)
eval(695-777)
⏰ Context from checks skipped due to timeout of 90000ms (30)
- GitHub Check: Test Python (6, 3.12)
- GitHub Check: Test Python (6, 3.9)
- GitHub Check: Test Python (5, 3.12)
- GitHub Check: Test Python (5, 3.9)
- GitHub Check: Test Python (4, 3.12)
- GitHub Check: Build wheels for cp310-manylinux_aarch64
- GitHub Check: Build wheels for cp311-win_amd64
- GitHub Check: Test Python (4, 3.9)
- GitHub Check: Build wheels for cp311-macosx_arm64
- GitHub Check: Test Python (3, 3.12)
- GitHub Check: Build C++ (clang, clang)
- GitHub Check: Test Python (3, 3.9)
- GitHub Check: Build wheels for cp311-macosx_x86_64
- GitHub Check: Build wheels for cp311-manylinux_x86_64
- GitHub Check: Test Python (2, 3.12)
- GitHub Check: Build C++ (rocm, rocm)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Test Python (2, 3.9)
- GitHub Check: Build C++ (cuda120, cuda)
- GitHub Check: Build wheels for cp311-manylinux_x86_64
- GitHub Check: Build C++ (cuda, cuda)
- GitHub Check: Analyze (c-cpp)
- GitHub Check: Test C++ (false)
- GitHub Check: Test Python (1, 3.12)
- GitHub Check: Test Python (1, 3.9)
- GitHub Check: Test C++ (true)
- GitHub Check: Build C library (2.14, >=2.5.0rc0,<2.15, libdeepmd_c_cu11.tar.gz)
- GitHub Check: Build C++ (cpu, cpu)
- GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
🔇 Additional comments (3)
source/tests/tf/test_dplr.py (3)
24-27: Added conversion for lrdipole modelThe test now converts an additional protobuf text file "lrdipole.pbtxt" to "lrdipole.pb", suggesting that the test requires this model file for some test cases, though it's not used in the current test method.
Would this model be used in future test methods or is there a missing test case that should use this model?
29-38: Updated expected energy and force valuesThe expected values for energy and forces have been updated to reflect changes in the computation logic in the main code. This ensures tests pass with the updated implementation.
58-58: Changed evaluation to use atomic=FalseThe call to
dp.evalnow explicitly setsatomic=Falsewhich aligns with the changes in the main implementation. This ensures we're not trying to extract atomic energies and virials when the modifier is active.
|
@ChiahsinChu Could you test whether you get the same result from this PR and v2? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #4753 +/- ##
==========================================
+ Coverage 84.70% 84.73% +0.02%
==========================================
Files 697 697
Lines 67424 67425 +1
Branches 3541 3540 -1
==========================================
+ Hits 57112 57132 +20
+ Misses 9182 9161 -21
- Partials 1130 1132 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This PR should have fixed the bug. I got the same results from this one and v2. |
Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
Pull request was closed
Fix deepmodeling#4625. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of modifier type decoding for more accurate output. - Corrected model type checking and output dictionary keys during evaluation. - Enhanced input sorting logic for atom types with multiple dimensions. - **Tests** - Updated test data and expected values to reflect recent changes. - Adjusted test logic to align with updated evaluation behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> (cherry picked from commit 2fa4064)
Fix deepmodeling#4625. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved handling of modifier type decoding for more accurate output. - Corrected model type checking and output dictionary keys during evaluation. - Enhanced input sorting logic for atom types with multiple dimensions. - **Tests** - Updated test data and expected values to reflect recent changes. - Adjusted test logic to align with updated evaluation behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> (cherry picked from commit 2fa4064)
Fix #4625.
Summary by CodeRabbit