fix(tf): always use float64 for the global tensor#4735
fix(tf): always use float64 for the global tensor#4735wanghan-iapcm merged 1 commit intodeepmodeling:develfrom
Conversation
Fix deepmodeling#4734. Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn>
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that the global tensor is consistently computed using float64 precision by converting the atom outputs before summing.
- Imported a new conversion function "global_cvt_2_ener_float".
- Updated the reduction operation to apply the conversion before summing.
Comments suppressed due to low confidence (1)
deepmd/tf/model/tensor.py:177
- Consider adding or updating tests to ensure that global_cvt_2_ener_float correctly converts atom_out to float64 and that the reduction operation produces the expected numerical precision.
global_out = tf.reduce_sum(global_cvt_2_ener_float(atom_out), axis=1)
📝 WalkthroughWalkthroughThe code in Changes
Assessment against linked issues
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧬 Code Graph Analysis (1)deepmd/tf/model/tensor.py (1)
⏰ Context from checks skipped due to timeout of 90000ms (29)
🔇 Additional comments (2)
✨ 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 (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #4735 +/- ##
==========================================
- Coverage 84.81% 84.69% -0.12%
==========================================
Files 696 697 +1
Lines 67269 67473 +204
Branches 3541 3540 -1
==========================================
+ Hits 57051 57145 +94
- Misses 9087 9196 +109
- Partials 1131 1132 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fix deepmodeling#4734. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved the calculation of global output by applying an additional transformation to per-atom outputs before aggregation, resulting in more accurate global predictions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> (cherry picked from commit 8c6e2ea)
Fix deepmodeling#4734. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Improved the calculation of global output by applying an additional transformation to per-atom outputs before aggregation, resulting in more accurate global predictions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@ustc.edu.cn> (cherry picked from commit 8c6e2ea)
Fix #4734.
Summary by CodeRabbit