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

Not able to run tensorflow with OpenBLAS support #8350

Closed
palvi68 opened this issue Mar 13, 2017 · 4 comments
Closed

Not able to run tensorflow with OpenBLAS support #8350

palvi68 opened this issue Mar 13, 2017 · 4 comments
Labels
stat:community support Status - Community Support

Comments

@palvi68
Copy link

palvi68 commented Mar 13, 2017

Hi,

Im trying to use OpenBLAS for gemm operations instead of EIGEN with tensorflow.
I have followed the steps given in
http://eigen.tuxfamily.org/dox-devel/TopicUsingBlasLapack.html

and compiled the tensoflow android demo application with -DEIGEN_USE_BLAS support and have linked the libopenblas.a to EIGEN by placing the OpenBLAS headers and static library in eigen_archive along with BUILD file.
The BUILD File of OpenBLAS is as follows:

licenses(["notice"])

cc_library(
name = "openblas",
hdrs = glob(["include/*.h"]),
srcs = ["lib/libopenblas.a"],
visibility = ["//visibility:public"],
)

The BUILD file of EIGEN has been appended to include and link the openblas library as follows:
cc_library(
name = "eigen",
hdrs = EIGEN_MPL2_HEADER_FILES,
defines = [
# This define (mostly) guarantees we don't link any problematic
# code. We use it, but we do not rely on it, as evidenced above.
"EIGEN_MPL2_ONLY",
],
includes = ["."],
copts = ["-IOpenBLAS/include"],
deps = ["//OpenBLAS:openblas"],
visibility = ["//visibility:public"],
)

The build is given as follows:
bazel build --copt=-DEIGEN_USE_BLAS --fat_apk_cpu=arm64-v8a //tensorflow/examples/android:tensorflow_demo --verbose_failures

The Build is completed successfully and im able to run the apks installed on the target. But the print statements which i have put in OpenBLAS and Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h using android logging LOGI or LOGD doesnt get displayed in logcat of the device.

The Build fails if i dont link the openblas library in EIGEN BUILD file and use -DEIGEN_USE_BLAS, which shows that libopenblas is getting linked to EIGEN.

Can you please suggest what is the problem in the above procedure ?
How can we validate OpenBLAS is actually getting used?

@concretevitamin concretevitamin added the stat:community support Status - Community Support label Mar 15, 2017
@yaroslavvb
Copy link
Contributor

BTW, as a meta-comment, Eigen is quite deeply integrated with TensorFlow. An alternative to replacing Eigen for some functionality, would be to add new op which calls OpenBLAS explicitly. This is what's done for MKL integration of matmul -- #7333

@llhe
Copy link
Contributor

llhe commented Mar 30, 2017

This is also interesting ARM-software/ComputeLibrary#7

@whaoer
Copy link

whaoer commented Jun 20, 2018

Hi, did you solve this problem?

@dksb
Copy link
Contributor

dksb commented Oct 24, 2018

Hello, we are moving support issues from GitHub to StackOverflow. This question is better asked on StackOverflow. It is easier for users to discover support isssues on StackOverflow. There is also a larger community that reads questions there. I will close the issue here. Please post it on StackOverflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stat:community support Status - Community Support
Projects
None yet
Development

No branches or pull requests

6 participants