Skip to content

Commit b807bb4

Browse files
authored
docs: document more for multiprocessing (#4190)
Fix #4182. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Documentation** - Updated `lammps-command.md` to clarify GPU usage and unit handling in LAMMPS. - Enhanced `howtoset_num_nodes.md` with new sections on MPI and multiprocessing for TensorFlow and PyTorch, improving clarity and usability. - Added guidance on GPU resource allocation for parallel processes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
1 parent dcdd804 commit b807bb4

2 files changed

Lines changed: 24 additions & 2 deletions

File tree

doc/third-party/lammps-command.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
See [Environment variables](../env.md) for the runtime environment variables.
55
:::
66

7+
:::{note}
8+
Each MPI rank can only use at most one GPU card.
9+
See [How to control the parallelism of a job](../troubleshooting/howtoset_num_nodes.md) for details.
10+
:::
11+
712
## units
813

914
All units in LAMMPS except `lj` are supported. `lj` is not supported.

doc/troubleshooting/howtoset_num_nodes.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,26 @@ DeePMD-kit has three levels of parallelism.
44
To get the best performance, one should control the number of threads used by DeePMD-kit.
55
One should make sure the product of the parallel numbers is less than or equal to the number of cores available.
66

7-
## MPI (optional)
7+
## MPI or multiprocessing (optional)
88

99
Parallelism for MPI is optional and used for multiple nodes, multiple GPU cards, or sometimes multiple CPU cores.
1010

11-
To enable MPI support for training, one should [install horovod](../install/install-from-source.md#install-horovod-and-mpi4py) in advance. Note that the parallelism mode is data parallelism, so it is not expected to see the training time per batch decreases.
11+
::::{tab-set}
12+
13+
:::{tab-item} TensorFlow {{ tensorflow_icon }}
14+
15+
To enable MPI support for training in the TensorFlow interface, one should [install horovod](../install/install-from-source.md#install-horovod-and-mpi4py) in advance.
16+
17+
:::
18+
:::{tab-item} PyTorch {{ pytorch_icon }}
19+
20+
Multiprocessing support for training in the PyTorch backend is implemented with [torchrun](https://pytorch.org/docs/stable/elastic/run.html).
21+
22+
:::
23+
::::
24+
25+
Note that the parallelism mode is data parallelism, so it is not expected to see the training time per batch decreases.
26+
See [Parallel training](../train/parallel-training.md) for details.
1227

1328
MPI support for inference is not directly supported by DeePMD-kit, but indirectly supported by the third-party software. For example, [LAMMPS enables running simulations in parallel](https://docs.lammps.org/Developer_parallel.html) using the MPI parallel communication standard with distributed data. That software has to build against MPI.
1429

@@ -22,6 +37,8 @@ Note that `mpirun` here should be the same as the MPI used to build software. Fo
2237

2338
Sometimes, `$num_nodes` and the nodes information can be directly given by the HPC scheduler system, if the MPI used here is the same as the MPI used to build the scheduler system. Otherwise, one have to manually assign these information.
2439

40+
Each process can use at most one GPU card.
41+
2542
## Parallelism between independent operators
2643

2744
For CPU devices, TensorFlow and PyTorch use multiple streams to run independent operators (OP).

0 commit comments

Comments
 (0)