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

Merge TF and PT CLI #3187

Merged
merged 8 commits into from
Jan 27, 2024
Merged

Merge TF and PT CLI #3187

merged 8 commits into from
Jan 27, 2024

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Jan 27, 2024

Just merge in form. Several options or subcommands are only supported by TensorFlow or PyTorch.

Also, avoid import from deepmd.tf in deepmd.utils.argcheck.

Use --tf or --pt to choose the backend:
    dp --tf train input.json
    dp --pt train input.json

njzjz added 2 commits January 27, 2024 02:20
Also, avoid import from deepmd.tf in deepmd.utils.argcheck.

Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
@@ -56,7 +56,7 @@

return super().__new__(DeepPotTF)
elif backend == DPBackend.PyTorch:
from deepmd_pt.infer.deep_eval import DeepPot as DeepPotPT
from deepmd.pt.infer.deep_eval import DeepPot as DeepPotPT

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.pt.infer.deep_eval
begins an import cycle.
Comment on lines +33 to +35
from deepmd.main import (
parse_args,
)

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.main
begins an import cycle.
elif args.pt:
args.backend = "pytorch"
if args.backend == "tensorflow":
from deepmd.tf.entrypoints.main import main as deepmd_main

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.tf.entrypoints.main
begins an import cycle.
if args.backend == "tensorflow":
from deepmd.tf.entrypoints.main import main as deepmd_main
elif args.backend == "pytorch":
from deepmd.pt.entrypoints.main import main as deepmd_main

Check notice

Code scanning / CodeQL

Cyclic import Note

Import of module
deepmd.pt.entrypoints.main
begins an import cycle.
Copy link

codecov bot commented Jan 27, 2024

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (f4d7c7e) 74.29% compared to head (a575312) 74.25%.
Report is 3 commits behind head on devel.

Files Patch % Lines
deepmd/pt/entrypoints/main.py 41.66% 14 Missing ⚠️
deepmd/main.py 77.27% 5 Missing ⚠️
deepmd/tf/entrypoints/main.py 33.33% 2 Missing ⚠️
deepmd/infer/deep_pot.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #3187      +/-   ##
==========================================
- Coverage   74.29%   74.25%   -0.05%     
==========================================
  Files         343      343              
  Lines       31638    31653      +15     
  Branches     1592     1592              
==========================================
- Hits        23506    23504       -2     
- Misses       7207     7224      +17     
  Partials      925      925              

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

deepmd/main.py Outdated Show resolved Hide resolved
deepmd/main.py Outdated Show resolved Hide resolved
@njzjz njzjz requested a review from wanghan-iapcm January 27, 2024 11:18
@wanghan-iapcm wanghan-iapcm merged commit 484bdc3 into deepmodeling:devel Jan 27, 2024
45 checks passed
@njzjz njzjz mentioned this pull request Apr 2, 2024
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