You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2019. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 16, 2019. It is now read-only.
Training getting slower with more more Spark executors? #244
First, distributed training does not help in all cases. As you add more and more nodes to the cluster, communication cost increases. This is especially true if your model is large.
Second, you did not mention the batch size. Maybe you were comparing apples and oranges. Let's say you set batch size = 32. With 4 executors (and 1 gpu per executor), you are getting effectively 4*32=128 batch size. So the 4-node cluster has as 4X work-load as 1-node cluster. If you set batch size = 32 for single-node, and batch_size = 8 for 4-node cluster, then it is a fair comparison. But In the latter case, communication becomes bottleneck since the GPUs are likely idle most of the time, waiting to be fed.
Thanks,@junshi15
I think I get what you mean.
Anyway,with more executors,I could set bigger batch size(the actual batch size = batch size * num of executors) to make full use of GPUS comparing to single-node.
Is that correct?
Another question,
If I have two executers(1 gpu per executor), the gpu of one is idle and another is busy.Does the time cost of training depends mainly on the training time of the busy executer without consideration of communication?
Just to clarify: Does the accuracy improves, when I don't decrease the batchsize but increase the number of executors? When I understood it correctly, more batches are processed then.
Or is there any other measurable "benefit", when I don't deacrease the batchsize?
If you fixe the batch size in the prototxt file, but increase number of executors, you process more images per batch. It is not clear you will get better accuracy. There are many things you want to tune.
Folks at Facebook manage to do just that.
Activity
junshi15 commentedon Apr 10, 2017
First, distributed training does not help in all cases. As you add more and more nodes to the cluster, communication cost increases. This is especially true if your model is large.
Second, you did not mention the batch size. Maybe you were comparing apples and oranges. Let's say you set batch size = 32. With 4 executors (and 1 gpu per executor), you are getting effectively 4*32=128 batch size. So the 4-node cluster has as 4X work-load as 1-node cluster. If you set batch size = 32 for single-node, and batch_size = 8 for 4-node cluster, then it is a fair comparison. But In the latter case, communication becomes bottleneck since the GPUs are likely idle most of the time, waiting to be fed.
apli commentedon Apr 12, 2017
Thanks,@junshi15
I think I get what you mean.
Anyway,with more executors,I could set bigger batch size(the actual batch size = batch size * num of executors) to make full use of GPUS comparing to single-node.
Is that correct?
apli commentedon Apr 12, 2017
Another question,
If I have two executers(1 gpu per executor), the gpu of one is idle and another is busy.Does the time cost of training depends mainly on the training time of the busy executer without consideration of communication?
junshi15 commentedon Apr 12, 2017
This is synchronous training. The speed is limited by the slowest executor.
apli commentedon Apr 20, 2017
What's the main factor that affect the communication, the bandwith?
junshi15 commentedon Apr 20, 2017
bandwith, latency, etc. depending on your network.
mumlax commentedon Nov 7, 2017
Just to clarify: Does the accuracy improves, when I don't decrease the batchsize but increase the number of executors? When I understood it correctly, more batches are processed then.
Or is there any other measurable "benefit", when I don't deacrease the batchsize?
junshi15 commentedon Nov 7, 2017
If you fixe the batch size in the prototxt file, but increase number of executors, you process more images per batch. It is not clear you will get better accuracy. There are many things you want to tune.
Folks at Facebook manage to do just that.