Skip to content

Conversation

@iProzd
Copy link
Collaborator

@iProzd iProzd commented Mar 13, 2025

Summary by CodeRabbit

  • Documentation

    • Updated documentation to correctly reference a DPA-2 example.
    • Introduced new documentation for the advanced DPA-3 model outlining its capabilities, training benchmarks, and installation requirements.
    • Expanded the documentation index and spin configuration sections to include DPA-3.
  • New Features

    • Added a README with configuration details for training a 6-layer DPA-3 model.
    • Provided a comprehensive JSON configuration file with training parameters.
    • Updated simulation instructions to support both DPA-2 and DPA-3.
  • Tests

    • Extended testing to cover DPA-3 configurations.

@iProzd iProzd marked this pull request as draft March 13, 2025 14:19
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 13, 2025

📝 Walkthrough

Walkthrough

This pull request updates documentation and examples to incorporate the new DPA-3 descriptor. It revises a reference path in the DPA-2 document and adds comprehensive new documentation for DPA-3, including its capabilities, training examples, and configuration details. The toctree in the model index is updated, and the list of supported descriptors in the PyTorch/DP section now includes DPA-3. Additionally, new example files and a test input path for DPA-3 have been added, along with a minor comment update in an existing example file.

Changes

File(s) Change Summary
doc/model/dpa2.md Updated reference example file path from jax_dpa2.lammps to jax_dpa.lammps.
doc/model/dpa3.md, doc/model/index.rst, doc/model/train-energy-spin.md Introduced the DPA-3 descriptor documentation, added a new DPA-3 document detailing model capabilities and training examples, updated the index to include DPA-3, and added DPA-3 as a supported descriptor for PyTorch/DP.
examples/water/dpa3/README.md, examples/water/dpa3/input_torch.json Added new example files for DPA-3, including a README outlining training requirements and a JSON configuration file with detailed model and training parameters.
examples/water/lmp/jax_dpa.lammps Modified comment to indicate the configuration requirement applies to both DPA-2 and DPA-3.
source/tests/common/test_examples.py Added a new test input file path entry for the DPA-3 JSON configuration.

Suggested reviewers

  • njzjz
  • wanghan-iapcm

Possibly related PRs

  • Fix: Modify docs of DPA models #4510: The changes in the main PR focus on updating the file path in the documentation for the DPA-2 model, while the retrieved PR modifies the formatting of a reference link in the same DPA-2 documentation; thus, they are related at the documentation level.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cf925bb and f0b9029.

📒 Files selected for processing (1)
  • doc/model/dpa3.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • doc/model/dpa3.md
⏰ Context from checks skipped due to timeout of 90000ms (27)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Test C++ (false)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Build C library (2.14, >=2.5.0rc0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Analyze (c-cpp)

🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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: 0

🧹 Nitpick comments (1)
doc/model/dpa3.md (1)

14-16: Consider adding a placeholder for the upcoming reference.

The reference is marked as "will be released soon." This is acceptable for now, but it would be helpful to add a TODO comment or issue reference to track when this should be updated with the actual citation once published.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d040d08 and 6620abf.

📒 Files selected for processing (8)
  • doc/model/dpa2.md (1 hunks)
  • doc/model/dpa3.md (1 hunks)
  • doc/model/index.rst (1 hunks)
  • doc/model/train-energy-spin.md (1 hunks)
  • examples/water/dpa3/README.md (1 hunks)
  • examples/water/dpa3/input_torch.json (1 hunks)
  • examples/water/lmp/jax_dpa.lammps (1 hunks)
  • source/tests/common/test_examples.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Analyze (python)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Build C library (2.14, >=2.5.0rc0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Analyze (c-cpp)
🔇 Additional comments (12)
doc/model/index.rst (1)

13-13: New dpa3 Entry in Toctree
The new dpa3 entry has been correctly added to the toctree. Please verify that its indentation and ordering are consistent with the other entries so that the navigation renders as expected.

examples/water/dpa3/README.md (1)

1-5: README for DPA-3 Model Input Documentation
This new README clearly outlines the purpose and input configuration for the 6-layer DPA-3 model. Please double-check that the relative link to the DPA-3 documentation correctly resolves in the built documentation.

examples/water/lmp/jax_dpa.lammps (1)

8-8: Updated LAMMPS Comment for DPA-2/3
The updated comment now indicates that the configuration applies to both DPA-2 and DPA-3 when using the JAX backend. This added clarity is beneficial.

doc/model/dpa2.md (1)

29-29: Reference File Path Update
The reference to examples/water/lmp/jax_dpa.lammps now reflects the updated example for both DPA-2 and DPA-3. Please confirm that this change is coordinated with all relevant documentation and examples.

doc/model/train-energy-spin.md (1)

51-55: Extension of Supported Descriptors with dpa3
Adding the dpa3 descriptor to the list of supported descriptors in the PyTorch/DP section is a good update. Ensure that any further references to DPA-3 in the training examples or configuration details are updated accordingly for clarity and consistency.

source/tests/common/test_examples.py (1)

61-61: Addition of DPA3 example input file path looks good.

The new path correctly follows the established pattern of adding example input files to the test suite. This ensures that the DPA3 example configuration will be tested for argument validity.

examples/water/dpa3/input_torch.json (1)

1-94: Well-structured configuration for the DPA3 descriptor.

The JSON configuration is properly formatted and contains all necessary components for the DPA3 model:

  • Type mapping for water molecules (O, H)
  • Descriptor configuration with repflow settings
  • Appropriate fitting network parameters
  • Learning rate and loss configurations
  • Training and validation data paths

The hyperparameters align with the recommendations documented in the DPA3 documentation.

doc/model/dpa3.md (5)

1-13: Clear introduction to the DPA3 descriptor with proper formatting.

The document starts with appropriate heading and backend support icons. The introduction effectively explains the purpose and strengths of the DPA3 model as a large atomic model (LAM) designed for diverse chemical and materials systems.


18-44: Comprehensive hyperparameter test results.

The table of hyperparameter tests provides valuable guidance for users. It includes:

  • A systematic comparison across various configurations
  • Clear metrics (RMSE for energy, force, and virial)
  • Training time information
  • Comparison with DPA-2 as a baseline

This information will help users select appropriate hyperparameters based on their specific needs.


47-59: Installation requirements clearly documented.

The section properly explains the requirements for source code installation, including:

  • Custom OP library requirements
  • MPI compatibility considerations
  • CUDA-Aware MPI recommendations

This provides users with the necessary information for successful installation and optimization.


60-68: Important JAX backend limitations highlighted.

The section clearly documents the limitation regarding MPI ranks when using the JAX backend with LAMMPS, and provides the necessary command to ensure proper operation. The reference to the example file is helpful.


70-80: Concise information on data format, type embedding, and model compression.

These final sections provide important details about:

  • Supported data formats
  • Type embedding implementation
  • Model compression limitations

This completes the documentation with all necessary technical details for users.

@codecov
Copy link

codecov bot commented Mar 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.80%. Comparing base (2e4da81) to head (f0b9029).
Report is 80 commits behind head on devel.

Additional details and impacted files
@@            Coverage Diff             @@
##            devel    #4655      +/-   ##
==========================================
- Coverage   84.80%   84.80%   -0.01%     
==========================================
  Files         692      692              
  Lines       66396    66396              
  Branches     3539     3540       +1     
==========================================
- Hits        56306    56305       -1     
  Misses       8949     8949              
- Partials     1141     1142       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@iProzd iProzd marked this pull request as ready for review March 27, 2025 09:08
@iProzd iProzd requested review from njzjz and wanghan-iapcm March 27, 2025 09:08
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: 0

🧹 Nitpick comments (1)
examples/water/dpa3/input_torch.json (1)

67-93: Training Configuration and Potential Typo

The training block is comprehensive, specifying file paths for statistics, training, and validation data, as well as key hyperparameters such as batch_size, gradient_max_norm, and logging intervals. One minor note: the key "numb_steps" (line 85) might be a typographical error—consider renaming it to "num_steps" to enhance clarity and align with common naming conventions.

-    "numb_steps": 1000000,
+    "num_steps": 1000000,

Please verify whether this key is intended as a custom identifier or if a change is warranted.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5aed21f and a5c5811.

📒 Files selected for processing (1)
  • examples/water/dpa3/input_torch.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (29)
  • GitHub Check: Build wheels for cp310-manylinux_aarch64
  • GitHub Check: Build wheels for cp311-win_amd64
  • GitHub Check: Build wheels for cp311-macosx_arm64
  • GitHub Check: Build C++ (clang, clang)
  • GitHub Check: Build wheels for cp311-macosx_x86_64
  • GitHub Check: Build C++ (rocm, rocm)
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build wheels for cp311-manylinux_x86_64
  • GitHub Check: Build C++ (cuda120, cuda)
  • GitHub Check: Build C++ (cuda, cuda)
  • GitHub Check: Build C++ (cpu, cpu)
  • GitHub Check: Test Python (6, 3.12)
  • GitHub Check: Test Python (6, 3.9)
  • GitHub Check: Test Python (5, 3.12)
  • GitHub Check: Test Python (5, 3.9)
  • GitHub Check: Test Python (4, 3.12)
  • GitHub Check: Build C library (2.14, >=2.5.0rc0,<2.15, libdeepmd_c_cu11.tar.gz)
  • GitHub Check: Test Python (4, 3.9)
  • GitHub Check: Build C library (2.18, libdeepmd_c.tar.gz)
  • GitHub Check: Test Python (3, 3.12)
  • GitHub Check: Test Python (3, 3.9)
  • GitHub Check: Test Python (2, 3.12)
  • GitHub Check: Test Python (2, 3.9)
  • GitHub Check: Test Python (1, 3.12)
  • GitHub Check: Test Python (1, 3.9)
  • GitHub Check: Test C++ (false)
  • GitHub Check: Test C++ (true)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (c-cpp)
🔇 Additional comments (5)
examples/water/dpa3/input_torch.json (5)

1-7: Overall JSON Structure and Formatting is Correct

The file follows valid JSON syntax and the overall layout is clear. However, the simple "_comment" entries (e.g., "that's all") could be enriched with more descriptive text to aid future maintainers.


8-35: Detailed Descriptor Section for DPA-3

The "descriptor" section is thorough and includes all the necessary parameters for configuring DPA-3. The numerical values (e.g., for "n_dim", "e_dim", "a_dim", etc.) appear reasonable. Please verify that parameter names like "update_residual_init" (set to "const") and the activation function "silut:10.0" exactly match what the downstream processing expects.


36-49: Consistent Fitting Network Settings

The "fitting_net" configuration is consistent with the descriptor. The neuron layers, activation function, and seed are clearly specified. Consider adding more detailed comments if these values have specific implications on the network design.


50-56: Clear Learning Rate Configuration

The exponential decay learning rate setup is clear with explicit parameters for decay steps, start, and stop rates. Make sure that the chosen decay schedule aligns with the experimental setup and training dynamics.


57-66: Well-Defined Loss Function Parameters

The loss configuration appropriately defines the types and preference limits for energy, force, and volume. Confirm that these values meet the intended training criteria and that "ener" is the right type specifier.

iProzd and others added 3 commits March 27, 2025 17:53
Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
Co-authored-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
Signed-off-by: Duo <50307526+iProzd@users.noreply.github.com>
@iProzd iProzd requested a review from njzjz March 27, 2025 09:53
@wanghan-iapcm wanghan-iapcm added this pull request to the merge queue Mar 28, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 28, 2025
@njzjz njzjz added this pull request to the merge queue Mar 29, 2025
Merged via the queue into deepmodeling:devel with commit 0918b22 Mar 29, 2025
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants