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

docs: improve multi-backend documentation #3875

Merged
merged 4 commits into from
Jun 13, 2024
Merged

Conversation

njzjz
Copy link
Member

@njzjz njzjz commented Jun 13, 2024

Summary by CodeRabbit

  • Documentation
    • Clarified the process of freezing a model by removing references to specific code sources.
    • Updated command syntax for calculating neighbor statistics to include TensorFlow and PyTorch flags.
    • Modified descriptions to specify model files instead of graph files.
    • Added and adjusted commands to support both TensorFlow and PyTorch for training, freezing, and testing models.
    • Introduced a tabular format for configuring parallelism settings for TensorFlow and PyTorch.

Copy link
Contributor

coderabbitai bot commented Jun 13, 2024

Walkthrough

Walkthrough

The changes primarily update documentation to enhance clarity and improve compatibility across TensorFlow and PyTorch implementations in the DeePMD-kit project. Key modifications include revising "graph files" to "model files," introducing new command-line flags (--tf for TensorFlow and --pt for PyTorch), and adjusting command syntax in various training and testing documentation sections. Additionally, some descriptions are refined to avoid referencing specific code sources.

Changes

File Path Change Summary
doc/freeze/freeze.md Updated terminology to replace protobuf(.pb) with model file, removed reference to "Morgan," and adjusted freezing process description.
doc/model/sel.md Added --tf and --pt flags to dp neighbor-stat command for framework-specific neighbor statistics calculations.
doc/test/model-deviation.md, doc/third-party/gromacs.md Changed graph files to model files in descriptions and command outputs.
doc/third-party/lammps-command.md Updated pair_style deepmd command by adding graph_1.pth and modifying out_freq value to 100.
doc/train/training-advanced.md Added a TensorFlow icon to the sel adjustment section of a frozen model.
doc/train/training.md Introduced command-line options --tf for TensorFlow and --pt for PyTorch in DeePMD-kit training commands.
doc/troubleshooting/howtoset_num_nodes.md Reformatted content to include separate configurations for TensorFlow and PyTorch parallelism settings.
doc/model/train-fitting-dos.md Updated supported backends information, added PyTorch training and testing commands, and adjusted freezing and testing commands for both TensorFlow and PyTorch backends.

Sequence Diagram(s)

(Sequence diagrams are not provided because the changes primarily involve documentation updates and enhancements, rather than new features or control flow modifications.)


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between e935163 and 6ca1ce2.

Files selected for processing (1)
  • doc/model/train-fitting-dos.md (3 hunks)
Additional context used
Learnings (1)
doc/model/train-fitting-dos.md (1)
User: njzjz
PR: deepmodeling/deepmd-kit#3875
File: doc/model/train-fitting-dos.md:107-107
Timestamp: 2024-06-13T16:32:13.786Z
Learning: For code blocks in `doc/model/train-fitting-dos.md` that display commands, use 'txt' as the language specification as per user njzjz's preference.
LanguageTool
doc/model/train-fitting-dos.md

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


[uncategorized] ~17-~17: Possible missing preposition found. (AI_HYDRA_LEO_MISSING_IN)
Context: ...g and validation data are also provided our examples. But note that **the data prov...


[uncategorized] ~40-~40: Possible missing article found. (AI_HYDRA_LEO_MISSING_THE)
Context: ...te that the length of dos provided in training set should be the same. - The rest argu...


[uncategorized] ~70-~70: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...ermode. -pref_dosandpref_ados`, respectively specify the weight of global and atomic...


[grammar] ~71-~71: The pronoun ‘We’ must be used with a non-third-person form of a verb. (NON3PRS_VERB)
Context: ...uded in the training process. - We also provides a combination training of vector and it...

Markdownlint
doc/model/train-fitting-dos.md

28-28: Column: 1 (MD010, no-hard-tabs)
Hard tabs


29-29: Column: 1 (MD010, no-hard-tabs)
Hard tabs


30-30: Column: 1 (MD010, no-hard-tabs)
Hard tabs


31-31: Column: 1 (MD010, no-hard-tabs)
Hard tabs


32-32: Column: 1 (MD010, no-hard-tabs)
Hard tabs


33-33: Column: 1 (MD010, no-hard-tabs)
Hard tabs


34-34: Column: 1 (MD010, no-hard-tabs)
Hard tabs


35-35: Column: 1 (MD010, no-hard-tabs)
Hard tabs


36-36: Column: 1 (MD010, no-hard-tabs)
Hard tabs


56-56: Column: 1 (MD010, no-hard-tabs)
Hard tabs


57-57: Column: 1 (MD010, no-hard-tabs)
Hard tabs


58-58: Column: 1 (MD010, no-hard-tabs)
Hard tabs


59-59: Column: 1 (MD010, no-hard-tabs)
Hard tabs


60-60: Column: 1 (MD010, no-hard-tabs)
Hard tabs


61-61: Column: 1 (MD010, no-hard-tabs)
Hard tabs


62-62: Column: 1 (MD010, no-hard-tabs)
Hard tabs


63-63: Column: 1 (MD010, no-hard-tabs)
Hard tabs


64-64: Column: 1 (MD010, no-hard-tabs)
Hard tabs


65-65: Column: 1 (MD010, no-hard-tabs)
Hard tabs


66-66: Column: 1 (MD010, no-hard-tabs)
Hard tabs


107-107: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


164-164: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified


172-172: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified

Additional comments not posted (1)
doc/model/train-fitting-dos.md (1)

4-4: Ensure consistency in icon usage for DPModel across the documentation.

Verification successful

The search results indicate that the usage of the {{ dpmodel_icon }} appears consistent across the documentation files. The icon is used in various markdown files in a uniform manner.

  • doc/backend.md
  • doc/model/dpa2.md
  • doc/model/train-se-atten.md
  • doc/model/train-se-e2-r.md
  • doc/model/train-se-e3.md
  • doc/model/train-hybrid.md
  • doc/model/train-fitting-dos.md
  • doc/model/train-energy-spin.md
  • doc/model/pairtab.md
  • doc/model/train-energy.md
  • doc/model/train-fitting-tensor.md
  • doc/model/dprc.md
  • doc/model/train-se-e2-a.md

No inconsistencies were found in the usage of the DPModel icon.

Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify consistency in DPModel icon usage across documentation.

# Test: Search for inconsistent DPModel icon usage. Expect: Consistent syntax.
rg --type markdown '{{ dpmodel_icon }}'

Length of output: 135



Script:

#!/bin/bash
# Description: Verify consistency in DPModel icon usage across documentation.

# Test: Search for inconsistent DPModel icon usage. Expect: Consistent syntax.
rg --type markdown '\{\{ dpmodel_icon \}\}'

Length of output: 3021


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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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 as 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.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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.

@github-actions github-actions bot added the Docs label Jun 13, 2024
@njzjz njzjz changed the title docs: import multi-backend documentation docs: improve multi-backend documentation Jun 13, 2024
@njzjz njzjz requested review from iProzd and wanghan-iapcm June 13, 2024 09:05
Copy link

codecov bot commented Jun 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.70%. Comparing base (5342a05) to head (6ca1ce2).
Report is 116 commits behind head on devel.

Additional details and impacted files
@@           Coverage Diff           @@
##            devel    #3875   +/-   ##
=======================================
  Coverage   82.70%   82.70%           
=======================================
  Files         517      517           
  Lines       50141    50141           
  Branches     2984     2985    +1     
=======================================
  Hits        41469    41469           
  Misses       7762     7762           
  Partials      910      910           

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

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: 3

Outside diff range and nitpick comments (5)
doc/model/sel.md (2)

Line range hint 3-3: Clarify the sentence about setting sel. Consider rephrasing to "All descriptors are required to set sel, which represents the expected maximum number of type-i neighbors of an atom."


Line range hint 5-5: Improve sentence structure for clarity. Suggested change: "If sel is insufficient, the energy will not be conserved, which can degrade the accuracy of the model."

doc/troubleshooting/howtoset_num_nodes.md (2)

Line range hint 23-23: Correct the grammatical errors. Suggested change: "Otherwise, one has to manually assign this information."

- one have to manually assign these information
+ one has to manually assign this information

Line range hint 36-36: Clarify the section title to "Parallelism within individual operators."

- ## Parallelism within an individual operators
+ ## Parallelism within individual operators
doc/train/training.md (1)

Line range hint 64-64: Correct the spelling error in "root mean square". Suggested change: "root-mean-square".

- root mean square
+ root-mean-square
Tools
LanguageTool

[uncategorized] ~33-~33: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...nvironment showing on the screen. Among them two pieces of information regarding dat...

Markdownlint

16-16: null (MD014, commands-show-output)
Dollar signs used before commands without showing output


24-24: null (MD014, commands-show-output)
Dollar signs used before commands without showing output

doc/test/model-deviation.md Outdated Show resolved Hide resolved
doc/model/sel.md Show resolved Hide resolved
doc/train/training-advanced.md Show resolved Hide resolved
doc/train/training-advanced.md Outdated Show resolved Hide resolved
njzjz and others added 2 commits June 13, 2024 06:35
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <[email protected]>
Signed-off-by: Jinzhe Zeng <[email protected]>
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: 2

Outside diff range and nitpick comments (4)
doc/model/train-fitting-dos.md (4)

6-6: Consider adding a comma for clarity.

Consider adding a comma after "DP" for better readability in the list of supported backends.

Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


Line range hint 17-17: Clarify the provision of training and validation data.

Consider rephrasing to "The training and validation data are also provided in our examples..." to clarify the ownership or source of the data.

Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


Line range hint 70-70: Add a missing comma for better readability.

Consider adding a comma after "pref_ados" to improve the readability of the list.

Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


Line range hint 71-71: Correct the verb form for grammatical accuracy.

- We also provides
+ We also provide

Correct the verb form to "provide" to match the subject "We" for grammatical accuracy.

Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...

doc/model/train-fitting-dos.md Outdated Show resolved Hide resolved
doc/model/train-fitting-dos.md Show resolved Hide resolved
@wanghan-iapcm wanghan-iapcm enabled auto-merge June 13, 2024 11:25
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Signed-off-by: Jinzhe Zeng <[email protected]>
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

Outside diff range and nitpick comments (4)
doc/model/train-fitting-dos.md (4)

1-1: Add a brief introduction or summary at the beginning of the document for better clarity and context.


Line range hint 17-17: Clarify the source of the training and validation data to avoid ambiguity.

- The training and validation data are also provided our examples.
+ The training and validation data are also provided in our examples.
Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


Line range hint 28-35: Replace hard tabs with spaces to maintain consistency and adhere to Markdown best practices.

-	"fitting_net" : {
-		"type": "dos",
-		"numb_dos": 250,
-		"sel_type": [0],
-		"neuron": [120,120,120],
-		"resnet_dt": true,
-		"fparam": 0,
-		"seed": 1,
-	},
+  "fitting_net": {
+    "type": "dos",
+    "numb_dos": 250,
+    "sel_type": [0],
+    "neuron": [120, 120, 120],
+    "resnet_dt": true,
+    "fparam": 0,
+    "seed": 1
+  },
Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...


Line range hint 56-66: Replace hard tabs with spaces in the JSON block for loss configuration to improve readability.

-	"loss" : {
-		"type": "dos",
-		"start_pref_dos": 0.0,
-		"limit_pref_dos": 0.0,
-		"start_pref_cdf": 0.0,
-		"limit_pref_cdf": 0.0,
-		"start_pref_ados": 1.0,
-		"limit_pref_ados": 1.0,
-		"start_pref_acdf": 0.0,
-		"limit_pref_acdf": 0.0
-	},
+  "loss": {
+    "type": "dos",
+    "start_pref_dos": 0.0,
+    "limit_pref_dos": 0.0,
+    "start_pref_cdf": 0.0,
+    "limit_pref_cdf": 0.0,
+    "start_pref_ados": 1.0,
+    "limit_pref_ados": 1.0,
+    "start_pref_acdf": 0.0,
+    "limit_pref_acdf": 0.0
+  },
Tools
LanguageTool

[uncategorized] ~6-~6: Possible missing comma found. (AI_HYDRA_LEO_MISSING_COMMA)
Context: ...rch_icon }}, DP {{ dpmodel_icon }} ::: Here we present an API to DeepDOS model, whi...

doc/model/train-fitting-dos.md Show resolved Hide resolved
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Jun 13, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 13, 2024
@njzjz njzjz added this pull request to the merge queue Jun 13, 2024
Merged via the queue into deepmodeling:devel with commit c644314 Jun 13, 2024
60 checks passed
@njzjz njzjz deleted the doc-cmd-pt branch June 13, 2024 21:01
mtaillefumier pushed a commit to mtaillefumier/deepmd-kit that referenced this pull request Sep 18, 2024
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Documentation**
- Clarified the process of freezing a model by removing references to
specific code sources.
- Updated command syntax for calculating neighbor statistics to include
TensorFlow and PyTorch flags.
	- Modified descriptions to specify model files instead of graph files.
- Added and adjusted commands to support both TensorFlow and PyTorch for
training, freezing, and testing models.
- Introduced a tabular format for configuring parallelism settings for
TensorFlow and PyTorch.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@coderabbitai coderabbitai bot mentioned this pull request Nov 1, 2024
@coderabbitai coderabbitai bot mentioned this pull request Dec 23, 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.

3 participants