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

fix(lmp): update print_summary #4271

Merged
merged 3 commits into from
Oct 31, 2024
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Oct 29, 2024

  1. Remove out-of-date float prec;
  2. Include PyTorch libraries and include directories.

Summary by CodeRabbit

  • New Features
    • Updated output messages for build information to enhance clarity, transitioning from TensorFlow-specific references to backend-oriented configurations.
  • Bug Fixes
    • Improved handling of backend include directories and library paths for better compatibility.
  • Documentation
    • Enhanced clarity in build information outputs related to backend configurations.

1. Remove out-of-date float prec;
2. Include PyTorch libraries and include directories.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Copy link
Contributor

coderabbitai bot commented Oct 29, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request modifies the deepmd_version.h.in file to update the definitions for TensorFlow include directories and library paths, changing them to backend-specific variables. Additionally, it alters the print_summary method in the PairDeepMD class within pair_deepmd.cpp to adjust the output messages related to TensorFlow build information. The changes also introduce conditional compilation for the TTM functionality based on the USE_TTM directive, but do not significantly alter the overall structure or logic of the class.

Changes

File Change Summary
source/lmp/deepmd_version.h.in Updated definitions: TensorFlow_INCLUDE_DIRS and TensorFlow_LIBRARY to backend-specific variables.
source/lmp/pair_deepmd.cpp Modified print_summary method output messages for TensorFlow build information; added conditional compilation for TTM functionality.

Possibly related PRs

  • fix: fix average training time for restart #4212: The changes in this PR involve updates to the training process, which may indirectly relate to the backend configurations being modified in the main PR, as both involve adjustments to how the system operates with different configurations. However, the connection is weak as it does not directly modify the same files or variables.

Suggested labels

Python

Suggested reviewers

  • wanghan-iapcm
  • iProzd

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between c49070e and 86a0f1f.

📒 Files selected for processing (2)
  • source/lmp/deepmd_version.h.in (2 hunks)
  • source/lmp/pair_deepmd.cpp (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • source/lmp/deepmd_version.h.in
  • source/lmp/pair_deepmd.cpp

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 40b3ea1 and c49070e.

📒 Files selected for processing (2)
  • source/lmp/deepmd_version.h.in (1 hunks)
  • source/lmp/pair_deepmd.cpp (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • source/lmp/pair_deepmd.cpp
🔇 Additional comments (1)
source/lmp/deepmd_version.h.in (1)

6-7: Verify impact on dependent code.

The change from TensorFlow-specific to backend-generic variables is significant. Let's verify all usages to ensure consistent updates.

✅ Verification successful

Let me check the actual usage of these macros in the identified files to ensure the changes are consistent.


The change from TensorFlow to backend-generic variables is safe and properly reflected in dependent code.

The verification shows that the macro renaming is consistent with its usage:

  • In pair_deepmd.cpp, the macros are only used for logging build information
  • In version.h.in, the variables are already using generic names (global_tf_*)
  • The remaining TensorFlow-specific includes and defines in the codebase are in the TensorFlow-specific implementation files under source/op/tf/ which are not affected by this change
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for direct usage of these macros
echo "Searching for direct macro usage..."
rg -l "TensorFlow_INCLUDE_DIRS|TensorFlow_LIBRARY" --type cpp

# Search for string versions of these macros
echo "Searching for string macro usage..."
rg -l "STR_TensorFlow_INCLUDE_DIRS|STR_TensorFlow_LIBRARY" --type cpp

# Look for any remaining TensorFlow-specific path references
echo "Checking for any remaining TensorFlow-specific paths..."
rg -l "tensorflow" --type cmake

Length of output: 742


Script:

#!/bin/bash
# Check the usage in pair_deepmd.cpp
echo "=== Content of pair_deepmd.cpp where macros are used ==="
rg -C 5 "TensorFlow_(INCLUDE_DIRS|LIBRARY)" source/lmp/pair_deepmd.cpp

echo -e "\n=== Content of version.h.in where macros are used ==="
cat source/api_cc/include/version.h.in

# Check if there are any other tensorflow-related defines or includes
echo -e "\n=== Any other tensorflow-related defines or includes ==="
rg "#\s*(include|define).*tensorflow" --type cpp

Length of output: 3626

source/lmp/deepmd_version.h.in Outdated Show resolved Hide resolved
Copy link

codecov bot commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.37%. Comparing base (40b3ea1) to head (86a0f1f).
Report is 8 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4271      +/-   ##
==========================================
+ Coverage   84.34%   84.37%   +0.03%     
==========================================
  Files         549      551       +2     
  Lines       51463    51583     +120     
  Branches     3053     3052       -1     
==========================================
+ Hits        43406    43523     +117     
- Misses       7097     7100       +3     
  Partials      960      960              

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

@njzjz njzjz requested a review from wanghan-iapcm October 29, 2024 22:03
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Oct 31, 2024
Merged via the queue into deepmodeling:devel with commit 0cee887 Oct 31, 2024
61 checks passed
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.

2 participants