Skip to content

Commit dc99ba2

Browse files
doc(pd): update paddle installation scripts and paddle related content in dpa3 document (#4887)
update paddle installation scripts and custom border op error message <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated installation guides to reference PaddlePaddle 3.1.1 for CUDA 12.6, CUDA 11.8, and CPU; added nightly pre-release install examples. * Refined training docs wording and CINN note; added Paddle backend guidance and explicit OP-install instructions in DPA3 docs. * **Chores** * Improved error messages when custom Paddle operators are unavailable, adding clearer install instructions and links to documentation. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: HydrogenSulfate <490868991@qq.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 565f0af commit dc99ba2

File tree

6 files changed

+59
-14
lines changed

6 files changed

+59
-14
lines changed

deepmd/pd/model/descriptor/repflows.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ def border_op(
6969
argument8,
7070
) -> paddle.Tensor:
7171
raise NotImplementedError(
72-
"border_op is not available since customized Paddle OP library is not built when freezing the model. "
73-
"See documentation for DPA3 for details."
72+
"The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n"
73+
"To install 'border_op', run: python source/op/pd/setup.py install\n"
74+
"For more information, please refer to the DPA3 documentation."
7475
)
7576

7677
# Note: this hack cannot actually save a model that can be run using LAMMPS.

deepmd/pd/model/descriptor/repformers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ def border_op(
6666
argument8,
6767
) -> paddle.Tensor:
6868
raise NotImplementedError(
69-
"border_op is not available since customized Paddle OP library is not built when freezing the model. "
70-
"See documentation for DPA3 for details."
69+
"The 'border_op' operator is unavailable because the custom Paddle OP library was not built when freezing the model.\n"
70+
"To install 'border_op', run: python source/op/pd/setup.py install\n"
71+
"For more information, please refer to the DPA3 documentation."
7172
)
7273

7374
# Note: this hack cannot actually save a model that can be run using LAMMPS.

doc/install/easy-install.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ Switch to the TensorFlow {{ tensorflow_icon }} tab for more information.
185185
::::{tab-item} CUDA 12.6
186186

187187
```bash
188-
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
188+
# release version
189+
pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
190+
# nightly-build version
191+
# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
189192
pip install deepmd-kit
190193
```
191194

@@ -194,7 +197,10 @@ pip install deepmd-kit
194197
::::{tab-item} CUDA 11.8
195198

196199
```bash
197-
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
200+
# release version
201+
pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
202+
# nightly-build version
203+
# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/
198204
pip install deepmd-kit
199205
```
200206

@@ -203,7 +209,10 @@ pip install deepmd-kit
203209
::::{tab-item} CPU
204210

205211
```bash
206-
pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
212+
# release version
213+
pip install paddlepaddle==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
214+
# nightly-build version
215+
# pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
207216
pip install deepmd-kit
208217
```
209218

doc/install/install-from-source.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,22 @@ To install Paddle, run
9999

100100
```sh
101101
# cu126
102-
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
102+
# release version
103+
pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/
104+
# nightly-build version
105+
# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu126/
106+
103107
# cu118
104-
pip install paddlepaddle-gpu==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
108+
# release version
109+
pip install paddlepaddle-gpu==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/
110+
# nightly-build version
111+
# pip install --pre paddlepaddle-gpu -i https://www.paddlepaddle.org.cn/packages/nightly/cu118/
112+
105113
# cpu
106-
pip install paddlepaddle==3.0.0 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
114+
# release version
115+
pip install paddlepaddle==3.1.1 -i https://www.paddlepaddle.org.cn/packages/stable/cpu/
116+
# nightly-build version
117+
# pip install --pre paddlepaddle -i https://www.paddlepaddle.org.cn/packages/nightly/cpu/
107118
```
108119

109120
:::

doc/model/dpa3.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Descriptor DPA3 {{ pytorch_icon }} {{ jax_icon }} {{ dpmodel_icon }}
1+
# Descriptor DPA3 {{ pytorch_icon }} {{ jax_icon }} {{ paddle_icon }} {{ dpmodel_icon }}
22

33
:::{note}
44
**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
4040

4141
Note that we set `float32` in all DPA3 models, while `float64` in other models by default.
4242

43-
## Requirements of installation from source code {{ pytorch_icon }}
43+
## Requirements of installation from source code {{ pytorch_icon }} {{ paddle_icon }}
44+
45+
::::{tab-set}
46+
47+
:::{tab-item} PyTorch {{ pytorch_icon }}
4448

4549
To run the DPA3 model on LAMMPS via source code installation
4650
(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
5357
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,
5458
otherwise the communication between GPU cards falls back to the slower CPU implementation.
5559

60+
:::
61+
62+
:::{tab-item} Paddle {{ paddle_icon }}
63+
64+
The customized OP library for the Python interface can be installed by
65+
66+
```sh
67+
cd deepmd-kit/source/op/pd
68+
python setup.py install
69+
```
70+
71+
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.
72+
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,
73+
otherwise the communication between GPU cards falls back to the slower CPU implementation.
74+
75+
:::
76+
77+
::::
78+
5679
## Limitations of the JAX backend with LAMMPS {{ jax_icon }}
5780

5881
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.

doc/train/training.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ $ dp --pt train input.json
2929
:::{tab-item} Paddle {{ paddle_icon }}
3030

3131
```bash
32-
# training model in eager mode
32+
# training model
3333
$ dp --pd train input.json
3434

35-
# [experimental] training model with CINN compiler for better performance,
35+
# [experimental] training models with the CINN compiler (~40%+ speedup)
3636
# see: https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/guides/paddle_v3_features/cinn_cn.html
3737
## If the shape(s) of batch input data are dynamic during training(default).
3838
$ CINN=1 dp --pd train input.json

0 commit comments

Comments
 (0)