tensorflow/recommenders-addons

Can some documentation be provided on how to build the TensorFlow C++ library from source to use TFRA custom ops in the TensorFlow C++ API?

WangShengguang opened this issue · 6 comments

We use TFRA for offline training, and the online service uses rpc + Tensorflow dynamic link library.

I encountered some problems during the joint compilation phase of TFRA and TF. I tried to compile it referring to this link, but was unsuccessful: #103.

Can some documentation be provided on how to build the TensorFlow C++ library from source to use TFRA custom ops in the TensorFlow C++ API?

Hi @WangShengguang, thank you for your feedback! Could you send me an email to rhdong2017@gmail.com I will add you through wechat, or could you provide more detail or code to reproduce your problem?

You may try:

./configure
bazel build -c opt --config=numa --copt="-O3" //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so //tensorflow:install_headers

Then install the *.so and headers in /usr/local/

To use TFRA custom ops, just preload the TFRA so:

LD_PRELOAD="/usr/local/lib/_cuckoo_hashtable_ops.so /usr/local/lib/_math_ops.so" ./your_app

You may try:

./configure
bazel build -c opt --config=numa --copt="-O3" //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so //tensorflow:install_headers

Then install the *.so and headers in /usr/local/

To use TFRA custom ops, just preload the TFRA so:

LD_PRELOAD="/usr/local/lib/_cuckoo_hashtable_ops.so /usr/local/lib/_math_ops.so" ./your_app

Hi @WangShengguang, could you please help check if this solution works for you? Thank you!

You may try:

./configure
bazel build -c opt --config=numa --copt="-O3" //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so //tensorflow:install_headers

Then install the *.so and headers in /usr/local/
To use TFRA custom ops, just preload the TFRA so:

LD_PRELOAD="/usr/local/lib/_cuckoo_hashtable_ops.so /usr/local/lib/_math_ops.so" ./your_app

Hi @WangShengguang, could you please help check if this solution works for you? Thank you!

@thorneliu @rhdong Thanks for answering my question. But there are some new things recently, it may take a few days.

You may try:

./configure
bazel build -c opt --config=numa --copt="-O3" //tensorflow:libtensorflow_cc.so //tensorflow:libtensorflow_framework.so //tensorflow:install_headers

Then install the *.so and headers in /usr/local/
To use TFRA custom ops, just preload the TFRA so:

LD_PRELOAD="/usr/local/lib/_cuckoo_hashtable_ops.so /usr/local/lib/_math_ops.so" ./your_app

Hi @WangShengguang, could you please help check if this solution works for you? Thank you!

@thorneliu @rhdong Thanks for answering my question. But there are some new things recently, it may take a few days.

Hi @WangShengguang, is there any update? :)

Hi @WangShengguang , we are relatively sure that the solution from @thorneliu can solve the issue. We will close this issue first. If any problem please feel free to reopen it, thank you for your feedback!