From 7c3a7b99e27f33c5cdc68dca9a702570f77d26b2 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Thu, 14 Aug 2025 11:27:05 +0800 Subject: [PATCH 1/5] update paddle installation document --- doc/install/easy-install.md | 15 ++++++++++++--- doc/install/install-from-source.md | 17 ++++++++++++++--- doc/train/training.md | 4 ++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/doc/install/easy-install.md b/doc/install/easy-install.md index bbf8d9b1d9..9f4d6d8861 100644 --- a/doc/install/easy-install.md +++ b/doc/install/easy-install.md @@ -185,7 +185,10 @@ Switch to the TensorFlow {{ tensorflow_icon }} tab for more information. ::::{tab-item} CUDA 12.6 ```bash -pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ +# release version +pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ +# nightly-build version +# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/ pip install deepmd-kit ``` @@ -194,7 +197,10 @@ pip install deepmd-kit ::::{tab-item} CUDA 11.8 ```bash -pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ +# release version +pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ +# nightly-build version +# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/ pip install deepmd-kit ``` @@ -203,7 +209,10 @@ pip install deepmd-kit ::::{tab-item} CPU ```bash -pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ +# release version +pip install paddlepaddle==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ +# nightly-build version +# pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ pip install deepmd-kit ``` diff --git a/doc/install/install-from-source.md b/doc/install/install-from-source.md index 1dc72c51fa..a21b8913db 100644 --- a/doc/install/install-from-source.md +++ b/doc/install/install-from-source.md @@ -99,11 +99,22 @@ To install Paddle, run ```sh # cu126 -pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ +# release version +pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ +# nightly-build version +# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/ + # cu118 -pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ +# release version +pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ +# nightly-build version +# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/ + # cpu -pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ +# release version +pip install paddlepaddle==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/ +# nightly-build version +# pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/ ``` ::: diff --git a/doc/train/training.md b/doc/train/training.md index ca0b46c0ef..6ccb43bbd7 100644 --- a/doc/train/training.md +++ b/doc/train/training.md @@ -29,10 +29,10 @@ $ dp --pt train input.json :::{tab-item} Paddle {{ paddle_icon }} ```bash -# training model in eager mode +# training model $ dp --pd train input.json -# [experimental] training model with CINN compiler for better performance, +# [experimental] training models with the CINN compiler (~40%+ speedup) # see: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/paddle_v3_features/cinn_cn.html ## If the shape(s) of batch input data are dynamic during training(default). $ CINN=1 dp --pd train input.json From ecd51f6c7ccf6795b6be827d4f79dc628470e25c Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Thu, 14 Aug 2025 16:42:10 +0800 Subject: [PATCH 2/5] update error message for border_op --- deepmd/pd/model/descriptor/repflows.py | 5 +++-- deepmd/pd/model/descriptor/repformers.py | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/deepmd/pd/model/descriptor/repflows.py b/deepmd/pd/model/descriptor/repflows.py index 4ea72daf02..d3cd277c88 100644 --- a/deepmd/pd/model/descriptor/repflows.py +++ b/deepmd/pd/model/descriptor/repflows.py @@ -69,8 +69,9 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "border_op is not available since customized Paddle OP library is not built when freezing the model. " - "See documentation for DPA3 for details." + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "To install 'border_op', run: python source/op/pd/setup.py install\n" + "For more information, please refer to the DPA3 documentation." ) # Note: this hack cannot actually save a model that can be run using LAMMPS. diff --git a/deepmd/pd/model/descriptor/repformers.py b/deepmd/pd/model/descriptor/repformers.py index 09e9b51c83..47cd2b502f 100644 --- a/deepmd/pd/model/descriptor/repformers.py +++ b/deepmd/pd/model/descriptor/repformers.py @@ -66,8 +66,9 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "border_op is not available since customized Paddle OP library is not built when freezing the model. " - "See documentation for DPA3 for details." + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "To install 'border_op', run: python source/op/pd/setup.py install\n" + "For more information, please refer to the DPA3 documentation." ) # Note: this hack cannot actually save a model that can be run using LAMMPS. From fdafdbebd0614f55ae995745665d95e6f7d4f7df Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Thu, 14 Aug 2025 16:47:06 +0800 Subject: [PATCH 3/5] Update deepmd/pd/model/descriptor/repformers.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: HydrogenSulfate <490868991@qq.com> --- deepmd/pd/model/descriptor/repformers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/pd/model/descriptor/repformers.py b/deepmd/pd/model/descriptor/repformers.py index 47cd2b502f..4151833f35 100644 --- a/deepmd/pd/model/descriptor/repformers.py +++ b/deepmd/pd/model/descriptor/repformers.py @@ -66,7 +66,7 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n" "To install 'border_op', run: python source/op/pd/setup.py install\n" "For more information, please refer to the DPA3 documentation." ) From 696941227c0885f3cfc0561a762b6561935a6c7e Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Thu, 14 Aug 2025 16:47:13 +0800 Subject: [PATCH 4/5] Update deepmd/pd/model/descriptor/repflows.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: HydrogenSulfate <490868991@qq.com> --- deepmd/pd/model/descriptor/repflows.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/pd/model/descriptor/repflows.py b/deepmd/pd/model/descriptor/repflows.py index d3cd277c88..756562e333 100644 --- a/deepmd/pd/model/descriptor/repflows.py +++ b/deepmd/pd/model/descriptor/repflows.py @@ -69,7 +69,7 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n" "To install 'border_op', run: python source/op/pd/setup.py install\n" "For more information, please refer to the DPA3 documentation." ) From f9f6cd0a91fbe32425f8b908c78dfcb1fc190185 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Fri, 15 Aug 2025 18:29:23 +0800 Subject: [PATCH 5/5] update dpa3 document --- deepmd/pd/model/descriptor/repflows.py | 2 +- deepmd/pd/model/descriptor/repformers.py | 2 +- doc/model/dpa3.md | 27 ++++++++++++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/deepmd/pd/model/descriptor/repflows.py b/deepmd/pd/model/descriptor/repflows.py index d3cd277c88..756562e333 100644 --- a/deepmd/pd/model/descriptor/repflows.py +++ b/deepmd/pd/model/descriptor/repflows.py @@ -69,7 +69,7 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n" "To install 'border_op', run: python source/op/pd/setup.py install\n" "For more information, please refer to the DPA3 documentation." ) diff --git a/deepmd/pd/model/descriptor/repformers.py b/deepmd/pd/model/descriptor/repformers.py index 47cd2b502f..4151833f35 100644 --- a/deepmd/pd/model/descriptor/repformers.py +++ b/deepmd/pd/model/descriptor/repformers.py @@ -66,7 +66,7 @@ def border_op( argument8, ) -> paddle.Tensor: raise NotImplementedError( - "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model .\n" + "The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n" "To install 'border_op', run: python source/op/pd/setup.py install\n" "For more information, please refer to the DPA3 documentation." ) diff --git a/doc/model/dpa3.md b/doc/model/dpa3.md index c63b26f90a..0ff46c438f 100644 --- a/doc/model/dpa3.md +++ b/doc/model/dpa3.md @@ -1,4 +1,4 @@ -# Descriptor DPA3 {{ pytorch_icon }} {{ jax_icon }} {{ dpmodel_icon }} +# Descriptor DPA3 {{ pytorch_icon }} {{ jax_icon }} {{ paddle_icon }} {{ dpmodel_icon }} :::{note} **Supported backends**: PyTorch {{ pytorch_icon }}, JAX {{ jax_icon }}, DP {{ dpmodel_icon }} @@ -40,7 +40,11 @@ Virial RMSEs were averaged exclusively for systems containing virial labels (`Al Note that we set `float32` in all DPA3 models, while `float64` in other models by default. -## Requirements of installation from source code {{ pytorch_icon }} +## Requirements of installation from source code {{ pytorch_icon }} {{ paddle_icon }} + +::::{tab-set} + +:::{tab-item} PyTorch {{ pytorch_icon }} To run the DPA3 model on LAMMPS via source code installation (users can skip this step if using [easy installation](../install/easy-install.md)), @@ -53,6 +57,25 @@ If one runs LAMMPS with MPI, the customized OP library for the C++ interface sho 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. +::: + +:::{tab-item} Paddle {{ paddle_icon }} + +The customized OP library for the Python interface can be installed by + +```sh +cd deepmd-kit/source/op/pd +python setup.py install +``` + +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. + +::: + +:::: + ## Limitations of the JAX backend with LAMMPS {{ jax_icon }} When using the JAX backend, 2 or more MPI ranks are not supported. One must set `map` to `yes` using the [`atom_modify`](https://docs.lammps.org/atom_modify.html) command.