Skip to content

Commit

Permalink
docs: add documentation for installation requirements of DPA-2 (#4178)
Browse files Browse the repository at this point in the history
Fix #4161.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
- Added installation requirements for the DPA-2 model in the
documentation, including customized OP library instructions.
  
- **Improvements**
- Enhanced error messaging in the `border_op` function for better user
guidance.
- Clarified parameter handling and documentation in the
`DescrptBlockRepformers` class.
- Improved logic for processing input tensors and neighbor lists in the
`forward` method.
- Strengthened input statistics handling in the `compute_input_stats`
method.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz authored Oct 7, 2024
1 parent 2feb21c commit d667929
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deepmd/pt/model/descriptor/repformers.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ def border_op(
argument8,
) -> torch.Tensor:
raise NotImplementedError(
"border_op is not available since customized PyTorch OP library is not built when freezing the model."
"border_op is not available since customized PyTorch OP library is not built when freezing the model. "
"See documentation for DPA-2 for details."
)

# Note: this hack cannot actually save a model that can be runned using LAMMPS.
Expand Down
10 changes: 10 additions & 0 deletions doc/model/dpa2.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ The DPA-2 model implementation. See https://arxiv.org/abs/2312.15492 for more de

Training example: `examples/water/dpa2/input_torch_medium.json`, see [README](../../examples/water/dpa2/README.md) for inputs in different levels.

## Requirements of installation {{ pytorch_icon }}

If one wants to run the DPA-2 model on LAMMPS, the customized OP library for the Python interface must be installed when [freezing the model](../freeze/freeze.md).

The customized OP library for the Python interface can be installed by setting environment variable {envvar}`DP_ENABLE_PYTORCH` to `1` during installation.

If one runs LAMMPS with MPI, the customized OP library for the C++ interface should be compiled against the same MPI library as the runtime MPI.
If one runs LAMMPS with MPI and CUDA devices, it is recommended to compile the customized OP library for the C++ interface with a [CUDA-Aware MPI](https://developer.nvidia.com/mpi-solutions-gpus) library and CUDA,
otherwise the communication between GPU cards falls back to the slower CPU implementation.

## Data format

DPA-2 supports both the [standard data format](../data/system.md) and the [mixed type data format](../data/system.md#mixed-type).

0 comments on commit d667929

Please sign in to comment.