CNTK icon indicating copy to clipboard operation
CNTK copied to clipboard

1 bit SGD and not scaling on more GPUs

Open saonim opened this issue 10 years ago • 5 comments

I am using the binary with 1 bit SGD. SHA1: 2f9a48c71dc0a6097498cb7e90ac3b151ab536dd

  1. Is their any flag or variable that I can use to use the other binary (not with 1 bit SGD) with 1 bit SGD? I have tried to play with different variables in the section. I have changed the gradientBits to 1, but no luck.
ParallelTrain=[
            parallelizationMethod="DataParallelSGD"
            distributedMBReading="true"
            parallelizationStartEpoch=1
            DataParallelSGD=[
                gradientBits=32
            ]
  1. Also the same code (Sample Alexnet code) runs on 2 GPUs (mpiexec -n 2 parallelTrain=true) but not with 4 GPUs. Any insights why it is not scaling on more GPUs?

saonim avatar Mar 14 '16 17:03 saonim

A lot of things may affect the scaling up with multiple GPUs or computers, e.g., hardware configuration and mini-batch size. You can first validate on CNTK's benchmark https://github.com/Alexey-Kamenev/Benchmarks. If you couldn't observe scaling up on this benchmark, you need to upgrade hardware. Otherwise, you may need to tune training parameters.

yefeng-zheng avatar Mar 15 '16 18:03 yefeng-zheng

There is no way to make binary not build with 1-bit quantization support support 1-bit. The reason is the fact that 1-bit library is a header file provided during build of CNTK. If it wasn't there during build, it cannot be retrofitted. What you are asking for is binary (loadlib) dependency on 1-bit, which is currently not supported.

As the other comment says, many things affect scale of 1-bit, and we have seen it scale very well on a large number of GPUs, so 4 should be no problem.

mradmila avatar Mar 20 '16 21:03 mradmila

BTW, in order to enable 1-bit SGD, you must say

gradientBits=1

instead of 32, which will use 32-bit floats for data exchange, which will not scale well in many scenarios.

frankseide avatar Mar 20 '16 21:03 frankseide

Note also that 1-bit SGD often requires a warm-start period. This means that at the beginning of the training, you should not enable 1-bit SGD. Only once the model is over the initial shake-out, you should enable it.

Where that point is depends on the task and model size. In our typical speech scenarios, we run about 8M samples, which is about 0.7% of our the total number of samples (so that although we cannot parallelize for the first 8M samples, we still get a very nice end-to-end speedup).

frankseide avatar Mar 20 '16 22:03 frankseide

This issue has been dormant for a while. The original question seems answer; please open a new issue if necessary. Thanks, Mark

mahilleb-msft avatar Jul 06 '17 14:07 mahilleb-msft