From 9e47e3fab0ef14ce092f23e7ece6995b77203b22 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 1 Oct 2024 17:16:32 -0400 Subject: [PATCH 1/2] docs: add documentation for installation requirements of DPA-2 Fix #4161. Signed-off-by: Jinzhe Zeng --- deepmd/pt/model/descriptor/repformers.py | 3 ++- doc/model/dpa2.md | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deepmd/pt/model/descriptor/repformers.py b/deepmd/pt/model/descriptor/repformers.py index a9e4ef7893..fecc509015 100644 --- a/deepmd/pt/model/descriptor/repformers.py +++ b/deepmd/pt/model/descriptor/repformers.py @@ -60,7 +60,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. diff --git a/doc/model/dpa2.md b/doc/model/dpa2.md index 5de30ee6b2..e7effcc39f 100644 --- a/doc/model/dpa2.md +++ b/doc/model/dpa2.md @@ -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 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). From 6cef7a1f3cd4b539f771bfe76d144e11f144595a Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 1 Oct 2024 17:17:05 -0400 Subject: [PATCH 2/2] fix typo Signed-off-by: Jinzhe Zeng --- doc/model/dpa2.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/model/dpa2.md b/doc/model/dpa2.md index e7effcc39f..24ce5222e9 100644 --- a/doc/model/dpa2.md +++ b/doc/model/dpa2.md @@ -16,7 +16,7 @@ The customized OP library for the Python interface can be installed by setting e 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 CPU implementation, +otherwise the communication between GPU cards falls back to the slower CPU implementation. ## Data format