Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Caffe over OpenCL with clBLAS / CLBlast / ViennaCL #101

Closed
kindloaf opened this issue Apr 19, 2017 · 3 comments
Closed

Caffe over OpenCL with clBLAS / CLBlast / ViennaCL #101

kindloaf opened this issue Apr 19, 2017 · 3 comments

Comments

@kindloaf
Copy link

Hi,
It seems that there are 3 ways to use Caffe over OpenCL:
(1) clBLAS
(2) CLBlast
(3) ViennaCL
Is this correct? If yes, how can I be sure which one I was using when compiling and running the benchmarks? For example, is the configuration logged in the log file, or displayed in the ck environment?

@psyhtest
Copy link
Member

@kindloaf

First, you need to find out which Caffe variant you installed. For example, on my machine I have only one variant built for android21-arm64:

$ ck show env --tags=lib,caffe
Env UID:         Target OS:      Bits: Name:                                 Version:      Tags:

cc5a35adbf43b8a5        linux-64    64 BVLC Caffe framework (opencl,clblast) trunk-8a80a89 64bits,bvlc,caffe,host-os-linux-64,lib,target-os-linux-64,v0,v0.0,vclblast,vopencl
17a825aef037ab15        linux-64    64 BVLC Caffe framework (cudnn)          trunk-8007349 64bits,bvlc,caffe,host-os-linux-64,lib,target-os-linux-64,v0,v0.8007349,vcuda,vcudnn,vmaster
4151d44fa8a64479        linux-64    64 BVLC Caffe framework (cpu)            trunk-8007349 64bits,bvlc,caffe,host-os-linux-64,lib,target-os-linux-64,v0,v0.8007349,vcpu,vmaster
d013a448284fc10f android21-arm64    64 BVLC Caffe framework (opencl,clblast) trunk-dc07695 64bits,bvlc,caffe,host-os-linux-64,lib,target-os-android21-arm64,v0,v0.0,vclblast,vopencl

In fact, the line for d013a448284fc10f already suggests that this variant was built with CLBlast (BVLC Caffe framework (opencl,clblast)) but you can verify this by looking up in its environment entry:

ck load env:d013a448284fc10f | grep CAFFE_INSTALL_DIR
      "CAFFE_INSTALL_DIR": "/home/anton/CK_TOOLS/lib-caffe-bvlc-opencl-clblast-trunk-android-ndk-4.9.x-android21-arm64/install",

Moreover, you could have had several CLBlast versions (e.g. built from the development branch or a stable version e.g. 0.10.0). To find out which one exactly was used, look up the ck-install.sh file in the installation directory (e.g. home/anton/CK_TOOLS/lib-caffe-bvlc-opencl-clblast-trunk-android-ndk-4.9.x-android21-arm64 above).

It seems that there are 3 ways to use Caffe over OpenCL

Actually, more since you can also use libDNN (although I haven't tested this for a while)! For example, you can install the lib-caffe-bvlc-opencl-libdnn-clblast-universal package which uses libDNN for convolutional layers and CLBlast for fully-connected layers:

$ ck install package:lib-caffe-bvlc-opencl-libdnn-clblast-universal

@kindloaf
Copy link
Author

Thanks for the help.

@gfursin
Copy link
Contributor

gfursin commented Apr 19, 2017

BTW, also feel free to ask questions at the CK mailing list:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants