mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

some err about caffe op with multiple gpu

Open dsqx71 opened this issue 10 years ago • 8 comments

It work well when using caffe op with a single gpu.

Howerer, when using caffe op with multiple gpus, I printed all gradients of operators above caffe op and find them all zeros

dsqx71 avatar Aug 09 '16 03:08 dsqx71

@HrWangChengdu could you have a look.

Could you also provide a simple code snipplet that produce this problem?

jermainewang avatar Aug 09 '16 03:08 jermainewang

data = mx.sym.Variable('data') data = mx.sym.CaffeOp(data_0=data, num_weight=2, prototxt='''layer{type:"Convolution" convolution_param { num_output: 128 pad: 1 kernel_size: 3 stride: 1 }}''') ...

model = mx.model.FeedForward( symbol=data ........) model.fit( ..... , kvstore=local_allreduce_device)

dsqx71 avatar Aug 09 '16 04:08 dsqx71

Could you run mxnet/example/caffe/caffe_net.py on multi-gpu? That works fine for me.

Taco-W avatar Aug 09 '16 04:08 Taco-W

I run the example . when I use kv-store = 'local' ,it works fine.

But if kv-store = 'local_allreduce_device', train-top-accuracy don't increase.

dsqx71 avatar Aug 09 '16 05:08 dsqx71

@mli @tqchen

piiswrong avatar Aug 09 '16 05:08 piiswrong

@HrWangChengdu This sound like some synchronization issue. Caffe probably use the default stream (Does it? I'm not sure) so you need to sync on the default stream at the end of forward/backward

piiswrong avatar Aug 10 '16 00:08 piiswrong

@piiswrong thx. I'm checking on this.

Taco-W avatar Aug 10 '16 01:08 Taco-W

@piiswrong I guess this issue could be closed.

Taco-W avatar Aug 13 '16 03:08 Taco-W