distributed version of SGD