How does caffe work on GPU mode?

175 views
Skip to first unread message

Jobs Bill

unread,
Apr 1, 2016, 12:34:41 AM4/1/16
to Caffe Users
Hi, everyone.

When I set caffe on GPU mode to train, caffe seems to still use cpp file when it is running. Why it still use cpp file when there is cu file for GPU on GPU mode? 

Jobs Bill

unread,
Apr 11, 2016, 4:51:50 AM4/11/16
to Caffe Users
When I set mode to GPU, but I only have the cpp file and no cu file for some layers, is it OK with caffe? Why?
Any suggestions will be appreciated.

xaw l

unread,
Apr 11, 2016, 7:50:56 AM4/11/16
to Caffe Users
If some layer have not implement forward_gpu(no cu file),the whole model will train in cpu mode.

在 2016年4月11日星期一 UTC+8下午4:51:50,Jobs Bill写道:

caik...@gmail.com

unread,
Mar 14, 2017, 7:43:20 AM3/14/17
to Caffe Users
Hi. I have the same questions with you. Did you get any answers?

在 2016年4月1日星期五 UTC+8下午12:34:41,Jobs Bill写道:

Daniel Moodie

unread,
Mar 14, 2017, 10:54:42 AM3/14/17
to Caffe Users
Each layer in caffe will call forward_gpu.  By default forward_gpu calls forward_cpu as it is expected that there is a cpu implementation.  Most layers in caffe override forward_gpu to an actual gpu implementation.
When caffe's mode is set to GPU, the forward call will call forward_gpu, otherwise it will call forward_cpu.  
This means that if a layer only has a cpu implementation (ie forward_gpu is the default), then all other layers will still call forward_gpu and then forward_cpu will be called on the layer without a forward_gpu override.
Reply all
Reply to author
Forward
0 new messages