-
Notifications
You must be signed in to change notification settings - Fork 176
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
add option to select backends TF/PT #1545
Conversation
fetch branch devel
Devel update
fetch devel_stream
add Option to choose backend TF/PT
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Signed-off-by: C. Thang Nguyen <[email protected]>
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
WalkthroughWalkthroughThe changes entail introducing a new function Changes
Possibly related issues
Recent Review DetailsConfiguration used: CodeRabbit UI Files selected for processing (1)
Additional Context UsedGitHub Check Runs (1)
Additional comments not posted (1)
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #1545 +/- ##
==========================================
+ Coverage 49.48% 49.51% +0.02%
==========================================
Files 83 83
Lines 14818 14844 +26
==========================================
+ Hits 7333 7350 +17
- Misses 7485 7494 +9 ☔ View full report in Codecov by Sentry. |
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.
It looks good to me. Two minor changes should be made.
Signed-off-by: Jinzhe Zeng <[email protected]>
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.
It looks good to me. I expect someone to test it (I don't have time to do so)
Signed-off-by: Jinzhe Zeng <[email protected]>
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: 2
Out of diff range and nitpick comments (2)
dpgen/generator/run.py (2)
[!TIP]
Codebase VerificationSeveral issues were identified in the
copy_model
function regarding error handling and path management:
- The function changes the current working directory within a loop, which can lead to unexpected behavior if not managed correctly.
- There is no explicit error handling for operations like
os.symlink()
, which can fail due to reasons such as lack of permissions or existing links.Analysis chain
Line range hint
188-201
: Check the logic incopy_model
for potential file path issues and ensure robust error handling.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify file operations in `copy_model` function. # Test: Search for file operations in the function. Expect: Proper error handling and path management. rg --type python $'copy_model'Length of output: 60
Script:
#!/bin/bash # Description: Re-verify file operations in `copy_model` function. # Test: Search for the `copy_model` function in the codebase to verify file operations. Expect: Proper error handling and path management. rg 'def copy_model' -C 10Length of output: 1416
Line range hint
719-755
: Ensure thatrun_train
securely constructs and executes system commands to prevent potential command injection vulnerabilities.- train_command += " --pt" + # Ensure that train_command is safely appended + train_command = shlex.join([train_command, "--pt"])
I have just tested it on my system. This PR works fine itself, but the PyTorch model cannot be correctly trained due to the inconsistency with the TensorFlow backend. See deepmodeling/deepmd-kit#3770 and deepmodeling/deepmd-kit#3771. |
reopen PR #1541 due to branch is deleted
add a new key in
param.json
filerelate to this issue #1462
Summary by CodeRabbit
New Features
Enhancements