Asynchronous Elastic Averaging SGD
I think that it might be a good improvement if there is an implementation of the Asynchronous Elastic Averaging SGD algorithm, as discussed in the Deep Learning with Elastic Averaging SGD, contributed to the Caffe.
I would like to work on that and I am making this issue to ask the Caffe team about how should I work on that to make something that might be contributed to Caffe later on. I am still reviewing the last addition of the Multi-GPU Data Parallelism (#2903) and I would like to know which parts of the new code can be reused to implement asynchronous parallelism.
It would be good if you are interested in something like that and it will be beneficial (for anyone who might want to work on that) if you can help by providing some milestones and how to develop the new algorithm based on the current Caffe's code. I have never contributed code to a community project before so it will be good if anyone can help me to start out.
I am interested and am happy to help.
We will have to rework and make some things more generic as the modifications to the solver class and the way the weight exchanges work assume Sync SGD, but basic ideas should still work.
I suggest you branch from master and start poking in a separate branch. I would suggest you start with the basic algorithm and 2 GPUs with basic data exchange (copy through host) to make sure things function and then we can move to P2P.
@thatguymike I know that basically only Nvidia it is supported in Caffe and at Nvidia you are dedicating resources to caffe but please consider also @naibaf7 effort. I still think that we cannot support P2P on all the Opencl devices so I will consider both version.
Hence one of the reasons I suggested the first solution copy through host memory. Also, there are single node variants in the paper we might also want to look at and likely start with the synchronous version which will be much easier to debug.
One of the issues with the async version is we will have to look at the data reader again as each gpu/node becomes independent. IO systems prefer linear reads and less bouncing around. We hit this with the original async sgd code.
Sent from mobile On Aug 18, 2015 4:10 AM, "bhack" [email protected] wrote:
@thatguymike https://github.com/thatguymike I know that basically only Nvidia it is supported in Caffe and at Nvidia you are dedicating resource to caffe but please consider also @naibaf7 https://github.com/naibaf7 effort. I still think that we cannot support P2P on all the Opencl devices so I will consider both version.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/2940#issuecomment-132173760.
OK then, I will create a new branch on my repository and I will start to try new things. Also, as @thatguymike says, I think that the current solver is a bit limiting on implementing something like that.
I do not know how much time I can devote right now but I though it would be good to create an issue and anyone interested can help/suggest anything he wants. We can use this as a reference on anything that you want to contribute.
For the async solver, I think an MPI program linked with libcaffe.so will be easier to implement.
Yes and no. The issue we are going to run into with MPI is the datalayer implementation and pulling the data in a reasonable way. Getting good performance out of MPI can be tricky. For example, some MPI implementations are not GPU aware and can't use P2P. However, Inspur late last year did an MPI Sync-SGD version of Caffe.
My suggestion is still to start with getting the solver itself implemented. The paper discusses a synchronous version, so I'd start there and we can switch over to async and revisit MPI. We have interest in multinode scaling anyway, so MPI is inevitable, although @cypof did some raw socket and direct IB multicast work in the old parallel branch.
I think it would be super valuable to prototype and benchmark different approaches, even on a single 8 GPUs box. How much asynchrony helps, for what types of nn etc.
MPI is probably a great approach for multi node. We are only staying away from it to simplify the integration of Caffe to our existing infrastructure.
On Wed, Aug 19, 2015, 8:36 AM Michael Houston [email protected] wrote:
Yes and no. The issue we are going to run into with MPI is the datalayer implementation and pulling the data in a reasonable way. Getting good performance out of MPI can be tricky. For example, some MPI implementations are not GPU aware and can't use P2P. However, Inspur late last year did an MPI Sync-SGD version of Caffe.
My suggestion is still to start with getting the solver itself implemented. The paper discusses a synchronous version, so I'd start there and we can switch over to async and revisit MPI. We have interest in multinode scaling anyway, so MPI is inevitable, although @cypof https://github.com/cypof did some raw socket and direct IB multicast work in the old parallel branch.
— Reply to this email directly or view it on GitHub https://github.com/BVLC/caffe/issues/2940#issuecomment-132640974.
Closing for simplicity—Caffe has not adopted asynchrony due to the code complexity and the irreproducibility of results.