Merged
Conversation
Collaborator
Author
|
@Yancey1989 @typhoonzero I write a design doc about Mpi enabled, thanks for the review. |
Contributor
|
Please fix the style check first |
typhoonzero
reviewed
Apr 11, 2018
| @@ -0,0 +1,33 @@ | |||
| #MPI-enabled PaddlePaddle Design doc | |||
Contributor
There was a problem hiding this comment.
Need a space after "#"
| #MPI-enabled PaddlePaddle Design doc | ||
|
|
||
| # Background | ||
| Now, PaddlePaddle Fluid with Distribution has relatively large network bottleneck, We want to use RDMA and GPUDriect to improve and solve it, so we enabled the features to PaddlePaddle with the help of MPI. |
Contributor
There was a problem hiding this comment.
When we do distribute multi GPU training, the communication overhead between servers become the major bottleneck, because of the following reasons:
- Must copy at least once from GPU to CPU memory so that the data can be ready to transfer. And for pserver side, copy data from CPU to GPU introduce more overhead.
- GPU->CPU data transfer is 10 times slower than data transfer between GPUs or between PCIe devices.
- TCP connections can not make full use of RDMA 100Gb devices.
| # Background | ||
| Now, PaddlePaddle Fluid with Distribution has relatively large network bottleneck, We want to use RDMA and GPUDriect to improve and solve it, so we enabled the features to PaddlePaddle with the help of MPI. | ||
|
|
||
| We will introduce Open MPI API to PaddlePaddle, which can bring two benefits to PaddlePaddle: |
| We will introduce Open MPI API to PaddlePaddle, which can bring two benefits to PaddlePaddle: | ||
| 1. Enable RDMA with PaddlePaddle, which bring high-performance low latency networks. | ||
| 2. Enable GPUDriect with PaddlePaddle, which bring the highest throughput and lowest latency GPU read and write. | ||
|
|
Contributor
There was a problem hiding this comment.
Need details of the design.
| ### mpi_module | ||
| We will build a new module to package MPI send and receive process. MPI send and recvice are defferent to gRPC, the MPI [recvice](https://www.open-mpi.org/doc/v1.8/man3/MPI_Irecv.3.php) must know receive buffer size and receive buffer element. For this reason, We have to make conmunications twice, the first one is to send metadata about gradient through gRPC, the second one is the real conmunications through MPI which send gradient data to mpi_listenandserve_op. | ||
| The detail flow is below: | ||
|  |
| Launch the script using the ```mpirun``` launcher, For example: ```mpirun -np 3 -hosts node1,node2,node3 python train.py```. By doing this, We can number the actors (trainer/pserver/master) with o .. (n-1). The node's number is the Rank of the calling process in a group of comm (integer), The MPI processes identify each other using a Rank ID. We have to create a mapping between PaddlePaddle's actors and their Rank ID so that we can communicate with the correct destinations when using MPI operations. | ||
| **We have to store the Rank ID and the mapping in global variables.** | ||
|
|
||
| ## New OP/MODULE |
Contributor
There was a problem hiding this comment.
Just list things need to be changed like:
- mpi_send_op
- mpi_serv_op
- modify transpiler to support using MPI or not
- compile arg to enable MPI support
- ...
then discuss the details.
typhoonzero
reviewed
Apr 17, 2018
| @@ -0,0 +1,29 @@ | |||
|
|
|||
Contributor
There was a problem hiding this comment.
Separate the implement and design to 2 PRs.
Collaborator
Author
There was a problem hiding this comment.
I have deleted the implement now and will rebuild it in another PR.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
design doc about #9405